-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathreadDicts.H
140 lines (120 loc) · 4.17 KB
/
readDicts.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
Info << "Reading dissolFoam flags" << nl;
const word dissolDictName("dissolFoamDict");
IOdictionary dissolProperties
(
IOobject
(
dissolDictName,
runTime.system(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
bool writeFluxC;
if( !dissolProperties.readIfPresent<bool>("writeFluxC", writeFluxC) ){
SeriousErrorIn("main")
<< "There is no writeFluxC parameter in dissolFoam dictionary"
<< exit(FatalError);
}
bool inertia;
if( !dissolProperties.readIfPresent<bool>("inertia", inertia) ){
SeriousErrorIn("main")
<< "There is no inertia parameter in dissolFoam dictionary"
<< exit(FatalError);
}
bool limitFlux;
if( !dissolProperties.readIfPresent<bool>("limitFlux", limitFlux) ){
SeriousErrorIn("main")
<< "There is no limitFlux parameter in dissolFoam dictionary"
<< exit(FatalError);
}
if(limitFlux)
Info << "***************************************************" << nl
<< "'limitFlux' parameter is set to 'true'" << nl
<< "U & phi fields rescaled if outlet flux exceeds Qlim" << nl
<< "***************************************************" << nl
<< endl;
bool constFlux;
if( !dissolProperties.readIfPresent<bool>("constFlux", constFlux) ){
SeriousErrorIn("main")
<< "There is no constFlux parameter in dissolFoam dictionary"
<< exit(FatalError);
}
if(constFlux)
Info << "***************************************************" << nl
<< "'constFlux' parameter is set to 'true'" << nl
<< "U & phi fields always rescaled to Qlim" << nl
<< "***************************************************" << nl
<< endl;
scalar Qlim = 1.0;
if( !dissolProperties.readIfPresent<scalar>("Qlim", Qlim) ){
SeriousErrorIn("main")
<< "There is no Qlim parameter in dissolFoam dictionary"
<< exit(FatalError);
}
Info << "Reading transportProperties" << nl;
IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
const dimensionSet dimInvL2(0, -2, 0, 0, 0, 0, 0);
const dimensionSet dimDiffusion(0, 2, -1, 0, 0, 0, 0);
dimensionedScalar Kinv
(
"Kinv",
dimInvL2,
transportProperties
);
dimensionedScalar nu
(
"nu",
dimDiffusion,
transportProperties
);
dimensionedScalar D
(
"D",
dimDiffusion,
transportProperties
);
dimensionedScalar lR
(
"lR",
dimLength,
transportProperties
);
Info << "Reading convDiff subdirectory" << nl;
dictionary convDiff = mesh.solutionDict().subDict("convDiff");
double tolerance = 0; // convergence criteria for convection-diffusion
if( !convDiff.readIfPresent<double>("tolerance", tolerance) ){
SeriousErrorIn("main")
<< "No tolerance parameter in convDiff subdictionary"
<< exit(FatalError);
}
int maxIter = 0; // maximum number of iterations
if( !convDiff.readIfPresent<int>("maxIter", maxIter) ){
SeriousErrorIn("main")
<< "No maxIter parameter in convDiff subdictionary"
<< exit(FatalError);
}
Info << "***************************************************" << nl;
Info << "transportProperties, Kinv: " << Kinv << nl;
Info << "transportProperties, nu: " << nu << nl;
Info << "transportProperties, D: " << D << nl;
Info << "transportProperties, lR: " << lR << nl;
Info << "dissolFoamDict, inertia: " << inertia << nl;
Info << "dissolFoamDict, limitFlux: " << limitFlux << nl;
Info << "dissolFoamDict, constFlux: " << constFlux << nl;
Info << "dissolFoamDict, Qlim: " << Qlim << nl;
Info << "dissolFoamDict, writeFluxC: " << writeFluxC << nl;
Info << "fvSolutions, tolerance: " << tolerance << nl;
Info << "fvSolutions, maxIter: " << maxIter << nl;
Info << "***************************************************" << endl;