ITHACA-FV
2023.1
Loading...
Searching...
No Matches
src
ITHACA_FOMPROBLEMS
steadyNS
NLsolvesteadyNS.H
Go to the documentation of this file.
1
/*---------------------------------------------------------------------------*\
2
██╗████████╗██╗ ██╗ █████╗ ██████╗ █████╗ ███████╗██╗ ██╗
3
██║╚══██╔══╝██║ ██║██╔══██╗██╔════╝██╔══██╗ ██╔════╝██║ ██║
4
██║ ██║ ███████║███████║██║ ███████║█████╗█████╗ ██║ ██║
5
██║ ██║ ██╔══██║██╔══██║██║ ██╔══██║╚════╝██╔══╝ ╚██╗ ██╔╝
6
██║ ██║ ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ╚████╔╝
7
╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═══╝
8
9
* In real Time Highly Advanced Computational Applications for Finite Volumes
10
* Copyright (C) 2017 by the ITHACA-FV authors
11
-------------------------------------------------------------------------------
12
License
13
This file is part of ITHACA-FV
14
ITHACA-FV is free software: you can redistribute it and/or modify
15
it under the terms of the GNU Lesser General Public License as published by
16
the Free Software Foundation, either version 3 of the License, or
17
(at your option) any later version.
18
ITHACA-FV is distributed in the hope that it will be useful,
19
but WITHOUT ANY WARRANTY; without even the implied warranty of
20
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
GNU Lesser General Public License for more details.
22
You should have received a copy of the GNU Lesser General Public License
23
along with ITHACA-FV. If not, see <http://www.gnu.org/licenses/>.
24
\*---------------------------------------------------------------------------*/
25
26
scalar
residual
= 1;
27
scalar
uresidual
= 1;
28
Vector<double>
uresidual_v
(0, 0, 0);
29
30
scalar
presidual
= 1;
31
scalar
csolve
= 0;
32
33
// Variable that can be changed
34
turbulence
->read();
35
std::ofstream
res_os
;
36
res_os
.open(
"./ITHACAoutput/Offline/residuals"
, std::ios_base::app);
37
38
#if defined(OFVER) && (OFVER == 6)
39
40
while
(
simple
.loop(
runTime
) &&
residual
> tolerance &&
csolve
< maxIter )
41
#else
42
while
(
simple
.loop() &&
residual
> tolerance &&
csolve
< maxIter )
43
#endif
44
{
45
Info <<
"Time = "
<<
runTime
.timeName() << nl << endl;
46
{
47
#include "
UEqn.H
"
48
#include "
pEqn.H
"
49
scalar C = 0;
50
51
for
(label
i
= 0;
i
< 3;
i
++)
52
{
53
if
(C <
uresidual_v
[
i
])
54
{
55
C =
uresidual_v
[
i
];
56
}
57
}
58
59
uresidual
= C;
60
residual
= max(
presidual
,
uresidual
);
61
Info <<
"\nResidual: "
<<
residual
<< endl << endl;
62
}
63
laminarTransport
.correct();
64
turbulence
->correct();
65
csolve
=
csolve
+ 1;
66
Info <<
"ExecutionTime = "
<<
runTime
.elapsedCpuTime() <<
" s"
67
<<
" ClockTime = "
<<
runTime
.elapsedClockTime() <<
" s"
68
<< nl << endl;
69
}
70
71
res_os
<<
residual
<< std::endl;
72
res_os
.close();
73
74
runTime
.setTime(
runTime
.startTime(), 0);
75
76
77
78
79
80
81
82
runTime
Foam::Time & runTime
Definition
createTime.H:33
csolve
scalar csolve
Definition
NLsolvesteadyNS.H:31
res_os
std::ofstream res_os
Definition
NLsolvesteadyNS.H:35
uresidual_v
Vector< double > uresidual_v(0, 0, 0)
uresidual
scalar uresidual
Definition
NLsolvesteadyNS.H:27
presidual
scalar presidual
Definition
NLsolvesteadyNS.H:30
residual
scalar residual
Definition
NLsolvesteadyNS.H:26
simple
simpleControl simple(mesh)
turbulence
turbulence
Definition
createFields.H:88
laminarTransport
singlePhaseTransportModel & laminarTransport
Definition
createFields.H:86
i
label i
Definition
pEqn.H:46
UEqn.H
pEqn.H
Generated by
1.11.0