@@ -32,6 +32,26 @@ string MushyLayerParams::s_ADVECTIVE_VELOCITY_SCALE = "Advective";
32
32
// / Darcy velocity scale
33
33
string MushyLayerParams::s_DARCY_VELOCITY_SCALE = " Darcy" ;
34
34
35
+ void MushyLayerParams::printBCs (string bcName, Vector<int > bcTypeLo, Vector<int > bcTypeHi, RealVect bcValLo, RealVect bcValHi)
36
+ {
37
+ char buffer [100 ];
38
+ sprintf (buffer, " %-10s" , bcName.c_str ());
39
+ pout () << buffer;
40
+
41
+ Vector<string> bcTypeNames;
42
+ bcTypeNames.push_back (" Fixed" );
43
+ bcTypeNames.push_back (" No flux" );
44
+
45
+ for (int dir=0 ; dir < SpaceDim; dir ++)
46
+ {
47
+ sprintf (buffer, " |%-10s= %02.2f|%-10s= %02.2f" , m_scalarBCTypes[bcTypeLo[dir]].c_str (), bcValLo[dir],
48
+ m_scalarBCTypes[bcTypeHi[dir]].c_str (), bcValHi[dir]);
49
+ pout () << buffer;
50
+ // pout() << "| " << bcTypeLo[dir] << "= " << bcValLo[dir] << " | " << bcTypeHi[dir] << "= " << bcValHi[dir];
51
+ }
52
+ pout () << endl;
53
+ }
54
+
35
55
// Initialise in initialization list
36
56
MushyLayerParams::MushyLayerParams () : physicalProblem(PhysicalProblems::m_mushyLayer),
37
57
viscosity(-999 ),
@@ -132,37 +152,69 @@ MushyLayerParams::MushyLayerParams() : physicalProblem(PhysicalProblems::m_mushy
132
152
m_porosityFunction(ParamsPorosityFunctions::m_porosityConstant),
133
153
m_viscosityFunction(ViscosityFunction::uniformViscosity),
134
154
max_viscosity(1.0 )
135
- {}
155
+ {
156
+ m_scalarBCTypes.push_back (" fixed" );
157
+ m_scalarBCTypes.push_back (" noflux" );
158
+ m_scalarBCTypes.push_back (" open" );
159
+ m_scalarBCTypes.push_back (" inflow" );
160
+
161
+ m_vectorBCTypes.push_back (" noflow" );
162
+ m_vectorBCTypes.push_back (" inflowVelocity" );
163
+ m_vectorBCTypes.push_back (" open" );
164
+ m_vectorBCTypes.push_back (" outflownormal" );
165
+ m_vectorBCTypes.push_back (" inflowoutflow" );
166
+ m_vectorBCTypes.push_back (" noshear" );
167
+ m_vectorBCTypes.push_back (" symmetry" );
168
+ m_vectorBCTypes.push_back (" inflowPlume" );
169
+ m_vectorBCTypes.push_back (" outflowPressureGrad" );
170
+ m_vectorBCTypes.push_back (" pressureHead" );
171
+ }
136
172
137
173
MushyLayerParams::~MushyLayerParams () {
138
174
}
139
175
140
176
void
141
177
MushyLayerParams::computeDerivedBCs ()
142
178
{
179
+ pout () << " MushyLayerParams::computeDerivedBCs ThetaInitial=" << ThetaInitial
180
+ << " , H top = " << bcValEnthalpyHi[SpaceDim-1 ] << endl;
143
181
// Now do defaults for the other boundary values
144
182
for (int dir = 0 ; dir < SpaceDim; dir++) {
183
+ Real bulkCHi = bcValBulkConcentrationHi[dir];
184
+ Real bulkCLo = bcValBulkConcentrationLo[dir];
185
+
186
+ if (bcTypeBulkConcentrationHi[dir] == PhysBCUtil::Neumann)
187
+ {
188
+ bulkCHi = ThetaInitial;
189
+ }
190
+
191
+ if (bcTypeBulkConcentrationLo[dir] == PhysBCUtil::Neumann)
192
+ {
193
+ bulkCLo = ThetaInitial;
194
+ }
195
+
145
196
::computeBoundingEnergy (bcValEnthalpyHi[dir],
146
- bcValBulkConcentrationHi[dir] , bcValSolidusHi[dir],
197
+ bulkCHi , bcValSolidusHi[dir],
147
198
bcValLiquidusHi[dir], bcValEutecticHi[dir],
148
199
specificHeatRatio, stefan, compositionRatio,
149
200
waterDistributionCoeff, thetaEutectic,
150
201
ThetaEutectic);
151
- ::computeEnthalpyVars (bcValEnthalpyHi[dir], bcValBulkConcentrationHi[dir] ,
202
+ ::computeEnthalpyVars (bcValEnthalpyHi[dir], bulkCHi ,
152
203
bcValPorosityHi[dir], bcValTemperatureHi[dir],
153
204
bcValLiquidConcentrationHi[dir],
154
205
bcValSolidConcentrationHi[dir], bcValSolidusHi[dir],
155
206
bcValLiquidusHi[dir], bcValEutecticHi[dir],
156
207
specificHeatRatio, stefan, compositionRatio,
157
208
waterDistributionCoeff, thetaEutectic,
158
209
ThetaEutectic);
159
- ::computeBoundingEnergy (bcValEnthalpyLo[dir],
160
- bcValBulkConcentrationLo[dir], bcValSolidusLo[dir],
210
+
211
+ ::computeBoundingEnergy (bcValEnthalpyLo[dir], bulkCLo,
212
+ bcValSolidusLo[dir],
161
213
bcValLiquidusLo[dir], bcValEutecticLo[dir],
162
214
specificHeatRatio, stefan, compositionRatio,
163
215
waterDistributionCoeff, thetaEutectic,
164
216
ThetaEutectic);
165
- ::computeEnthalpyVars (bcValEnthalpyLo[dir], bcValBulkConcentrationLo[dir] ,
217
+ ::computeEnthalpyVars (bcValEnthalpyLo[dir], bulkCLo ,
166
218
bcValPorosityLo[dir], bcValTemperatureLo[dir],
167
219
bcValLiquidConcentrationLo[dir],
168
220
bcValSolidConcentrationLo[dir], bcValSolidusLo[dir],
@@ -183,10 +235,24 @@ MushyLayerParams::computeDerivedBCs ()
183
235
else
184
236
{
185
237
Hinitial = bcValEnthalpyLo[dir];
186
- ;
187
238
}
188
239
}
189
240
}
241
+
242
+ pout () << " After computeDerivedBCs: " << endl << " " ;
243
+ Vector<string> direction; direction.push_back (" x" ); direction.push_back (" y" ); direction.push_back (" z" );
244
+ for (int dir=0 ; dir < SpaceDim; dir ++)
245
+ {
246
+ pout () << " | " << direction[dir] << " (lo) | " << direction[dir] << " (hi) " ;
247
+ }
248
+ pout () << endl;
249
+
250
+ // printBCs("H", bcTypeEnthalpyLo, bcTypeEnthalpyHi, bcValEnthalpyLo, bcValEnthalpyHi);
251
+ // printBCs("C", bcTypeBulkConcentrationLo, bcTypeBulkConcentrationHi, bcValBulkConcentrationLo, bcValBulkConcentrationHi);
252
+ printBCs (" T" , bcTypeTemperatureLo, bcTypeTemperatureHi, bcValTemperatureLo, bcValTemperatureHi);
253
+ printBCs (" Sl" , bcTypeLiquidConcentrationLo, bcTypeLiquidConcentrationHi, bcValLiquidConcentrationLo, bcValLiquidConcentrationHi);
254
+ printBCs (" porosity" , bcTypePorosityLo, bcTypePorosityHi, bcValPorosityLo, bcValPorosityHi);
255
+
190
256
}
191
257
192
258
void MushyLayerParams::getParameters ()
@@ -628,7 +694,6 @@ void MushyLayerParams::getParameters()
628
694
629
695
630
696
// Now BC values
631
-
632
697
parseBCVals (" liquidConcentrationLoVal" , bcValLiquidConcentrationLo);
633
698
parseBCVals (" liquidConcentrationHiVal" , bcValLiquidConcentrationHi);
634
699
@@ -794,6 +859,21 @@ void MushyLayerParams::getParameters()
794
859
795
860
// uncomment to print the parameters
796
861
// printParameters();
862
+
863
+ pout () << " BCs used: " << endl << " " ;
864
+ Vector<string> direction; direction.push_back (" x" ); direction.push_back (" y" ); direction.push_back (" z" );
865
+ for (int dir=0 ; dir < SpaceDim; dir ++)
866
+ {
867
+ pout () << " | " << direction[dir] << " (lo) | " << direction[dir] << " (hi) " ;
868
+ }
869
+ pout () << endl;
870
+
871
+ printBCs (" H" , bcTypeEnthalpyLo, bcTypeEnthalpyHi, bcValEnthalpyLo, bcValEnthalpyHi);
872
+ printBCs (" C" , bcTypeBulkConcentrationLo, bcTypeBulkConcentrationHi, bcValBulkConcentrationLo, bcValBulkConcentrationHi);
873
+ printBCs (" T" , bcTypeTemperatureLo, bcTypeTemperatureHi, bcValTemperatureLo, bcValTemperatureHi);
874
+ printBCs (" Sl" , bcTypeLiquidConcentrationLo, bcTypeLiquidConcentrationHi, bcValLiquidConcentrationLo, bcValLiquidConcentrationHi);
875
+ printBCs (" porosity" , bcTypePorosityLo, bcTypePorosityHi, bcValPorosityLo, bcValPorosityHi);
876
+
797
877
}
798
878
799
879
void MushyLayerParams::parseBCs (string a_name, Vector<int >* a_bcHolder, bool required)
0 commit comments