26 #include "BlendedInterfacialModel.H" 30 template<
class modelType>
33 const dictTable& modelDicts,
44 const phasePairKey& key = iter.key();
59 template<
class modelType>
62 const word& modelName,
79 template<
class modelType>
82 const word& modelName,
85 autoPtr<BlendedInterfacialModel<modelType>>,
89 const bool correctFixedFluxBCs
93 HashTable<autoPtr<modelType>, phasePairKey, phasePairKey::hash>
96 modelTypeTable tempModels;
99 const blendingMethod& blending
108 autoPtr<modelType> noModel(
nullptr);
117 const phasePairKey key(iter.key().first(), iter.key().second());
118 const phasePairKey key1In2(key.first(), key.second(),
true);
119 const phasePairKey key2In1(key.second(), key.first(),
true);
124 autoPtr<BlendedInterfacialModel<modelType>>
126 new BlendedInterfacialModel<modelType>
131 tempModels.
found(key ) ? tempModels[key ] : noModel,
132 tempModels.found(key1In2) ? tempModels[key1In2] : noModel,
133 tempModels.found(key2In1) ? tempModels[key2In1] : noModel,
158 template<
class modelType>
161 const word& modelName,
164 Pair<autoPtr<modelType>>,
168 const bool correctFixedFluxBCs
172 HashTable<autoPtr<modelType>, phasePairKey, phasePairKey::hash>
179 modelTypeTable tempModels;
187 forAllIter(
typename modelTypeTable, tempModels, tempModelIter)
189 const phasePairKey& key(tempModelIter.key());
191 if (!models.found(key))
196 Pair<autoPtr<modelType>>()
202 if (!pair.contains(phase))
205 <<
"A two-sided " << modelType::typeName <<
" was " 206 <<
"specified for the " << phase.name() <<
" side of the " 207 << pair <<
" pair, but that phase is not part of that pair." 211 models[key][pair.index(phase)] = tempModelIter().ptr();
217 template<
class GeoField>
220 const phaseModel& phase,
221 const word& fieldName,
223 PtrList<GeoField>& fieldList
226 if (fieldList.set(phase.index()))
228 fieldList[phase.index()] += field;
245 template<
class GeoField>
248 const phaseModel& phase,
249 const word& fieldName,
250 const GeoField& field,
251 PtrList<GeoField>& fieldList
254 addField(phase, fieldName, tmp<GeoField>(field), fieldList);
258 template<
class GeoField>
261 const phaseModel& phase,
262 const word& fieldName,
264 HashPtrTable<GeoField>& fieldTable
267 if (fieldTable.found(phase.name()))
269 *fieldTable[phase.name()] += field;
286 template<
class GeoField>
289 const phaseModel& phase,
290 const word& fieldName,
291 const GeoField& field,
292 HashPtrTable<GeoField>& fieldTable
295 addField(phase, fieldName, tmp<GeoField>(field), fieldTable);
301 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
305 const dimensionSet& dims,
306 PtrList<GeometricField<Type, PatchField, GeoMesh>>& fieldList
311 if (fieldList.set(
phasei))
321 new GeometricField<Type, PatchField, GeoMesh>
330 dimensioned<Type>(
"zero", dims, pTraits<Type>::zero)
337 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
341 const dimensionSet& dims,
342 HashPtrTable<GeometricField<Type, PatchField, GeoMesh>>& fieldTable
349 if (fieldTable.set(phase.name()))
357 new GeometricField<Type, PatchField, GeoMesh>
366 dimensioned<Type>(
"zero", dims, pTraits<Type>::zero)
373 template<
class modelType>
393 template<
class modelType>
396 const phaseModel& dispersed,
397 const phaseModel& continuous
400 return lookupSubModel<modelType>(orderedPhasePair(dispersed, continuous));
404 template<
class modelType>
412 BlendedInterfacialModel<modelType>::typeName,
417 if (
mesh().foundObject<BlendedInterfacialModel<modelType>>(name))
428 BlendedInterfacialModel<modelType>::typeName,
const BlendedInterfacialModel< modelType > & lookupBlendedSubModel(const phasePair &key) const
Return a blended sub model between a phase pair.
void generatePairs(const dictTable &modelDicts)
Generate pairs.
#define forAll(list, i)
Loop across all elements in list.
bool found(const word &) const
Search DictionaryBase for given keyword.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
autoPtr< T > set(const label, const word &key, T *)
Set element to pointer provided and return old element.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
phasePairTable phasePairs_
Phase pairs.
const modelType & lookupSubModel(const phasePair &key) const
Return a sub model between a phase pair.
IOobject(const word &name, const fileName &instance, const objectRegistry ®istry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
Construct from name, instance, registry, io options.
bool foundObject(const word &name) const
Is the named Type found?
word member() const
Return member (name without the extension)
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
void createSubModels(const dictTable &modelDicts, HashTable< autoPtr< modelType >, phasePairKey, phasePairKey::hash > &models)
Generate pairs and sub-model tables.
const Time & time() const
Return the top-level database.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
phaseModelList phaseModels_
Phase models.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
bool found(const Key &) const
Return true if hashedEntry is found in table.
static word groupName(Name name, const word &group)
const fvMesh & mesh_
Reference to the mesh.
const word & name() const
Name function is needed to disambiguate those inherited.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void fillFields(const word &name, const dimensionSet &dims, PtrList< GeometricField< Type, PatchField, GeoMesh >> &fieldList) const
Fill up gaps in a phase-indexed list of fields with zeros.
void generatePairsAndSubModels(const word &modelName, HashTable< autoPtr< modelType >, phasePairKey, phasePairKey::hash > &models)
Generate pairs and sub-model tables.
void addField(const phaseModel &phase, const word &fieldName, tmp< GeoField > field, PtrList< GeoField > &fieldList) const
Add the field to a phase-indexed list, with the given name,.
blendingMethodTable blendingMethods_
Blending methods.
const fvMesh & mesh() const
Return the mesh.
HashTable< dictionary, phasePairKey, phasePairKey::hash > dictTable
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.