30 template<
class modelType>
33 const dictTable& modelDicts,
44 const phasePairKey& key = iter.key();
59 template<
class modelType>
62 const word& modelName,
69 const bool correctFixedFluxBCs
80 template<
class modelType>
83 const word& modelName,
86 autoPtr<BlendedInterfacialModel<modelType>>,
90 const bool correctFixedFluxBCs
94 HashTable<autoPtr<modelType>, phasePairKey, phasePairKey::hash>
97 modelTypeTable tempModels;
100 const blendingMethod& blending
109 autoPtr<modelType> noModel(
nullptr);
118 const phasePairKey key(iter.key().first(), iter.key().second());
137 const phaseModel& phase1 = pair.phase1();
138 const phaseModel& phase2 = pair.phase2();
139 const phasePairKey key1In2(phase1.name(), phase2.name(),
true);
140 const phasePairKey key2In1(phase2.name(), phase1.name(),
true);
145 autoPtr<BlendedInterfacialModel<modelType>>
147 new BlendedInterfacialModel<modelType>
152 tempModels.found(key) ? tempModels[key] : noModel,
153 tempModels.found(key1In2) ? tempModels[key1In2] : noModel,
154 tempModels.found(key2In1) ? tempModels[key2In1] : noModel,
163 template<
class modelType>
166 const word& modelName,
169 Pair<autoPtr<modelType>>,
173 const bool correctFixedFluxBCs
177 HashTable<autoPtr<modelType>, phasePairKey, phasePairKey::hash>
184 modelTypeTable tempModels;
192 forAllIter(
typename modelTypeTable, tempModels, tempModelIter)
194 const phasePairKey& key(tempModelIter.key());
196 if (!models.found(key))
201 Pair<autoPtr<modelType>>()
207 if (!pair.contains(phase))
210 <<
"A two-sided " << modelType::typeName <<
" was " 211 <<
"specified for the " << phase.name() <<
" side of the " 212 << pair <<
" pair, but that phase is not part of that pair." 216 models[key][pair.index(phase)] = tempModelIter().ptr();
224 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
228 const dimensionSet& dims,
229 PtrList<GeometricField<Type, PatchField, GeoMesh>>& fieldList
234 if (fieldList.set(
phasei))
244 new GeometricField<Type, PatchField, GeoMesh>
253 dimensioned<Type>(
"zero", dims, pTraits<Type>::zero)
260 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
264 const dimensionSet& dims,
265 HashPtrTable<GeometricField<Type, PatchField, GeoMesh>>& fieldTable
272 if (fieldTable.set(phase.name()))
280 new GeometricField<Type, PatchField, GeoMesh>
289 dimensioned<Type>(
"zero", dims, pTraits<Type>::zero)
296 template<
class modelType>
334 template<
class modelType>
354 template<
class modelType>
357 const phaseModel& dispersed,
358 const phaseModel& continuous
361 return foundSubModel<modelType>(orderedPhasePair(dispersed, continuous));
365 template<
class modelType>
368 const phaseModel& dispersed,
369 const phaseModel& continuous
372 return lookupSubModel<modelType>(orderedPhasePair(dispersed, continuous));
376 template<
class modelType>
381 mesh().foundObject<BlendedInterfacialModel<modelType>>
385 BlendedInterfacialModel<modelType>::typeName,
393 BlendedInterfacialModel<modelType>::typeName,
408 template<
class modelType>
416 BlendedInterfacialModel<modelType>::typeName,
421 if (
mesh().foundObject<BlendedInterfacialModel<modelType>>(name))
432 BlendedInterfacialModel<modelType>::typeName,
447 template<
class GeoField,
class Group>
453 PtrList<GeoField>& fieldList
456 if (fieldList.set(group.index()))
458 fieldList[group.index()] +=
field;
475 template<
class GeoField,
class Group>
480 const GeoField& field,
481 PtrList<GeoField>& fieldList
484 addField(group, name, tmp<GeoField>(field), fieldList);
488 template<
class GeoField,
class Group>
494 HashPtrTable<GeoField>& fieldTable
497 if (fieldTable.found(group.name()))
499 *fieldTable[group.name()] +=
field;
516 template<
class GeoField,
class Group>
521 const GeoField& field,
522 HashPtrTable<GeoField>& fieldTable
525 addField(group, name, tmp<GeoField>(field), fieldTable);
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.
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 foundBlendedSubModel(const phasePair &key) const
Check availability of a blended sub model for a given phase pair.
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.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
bool found(const Key &) const
Return true if hashedEntry is found in table.
autoPtr< BasicCompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleMomentumTransportModel::transportModel &transport)
static word groupName(Name name, const word &group)
const fvMesh & mesh_
Reference to the mesh.
bool foundSubModel(const phasePair &key) const
Check availability of a sub model for a given phase pair.
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.
blendingMethodTable blendingMethods_
Blending methods.
void generatePairsAndSubModels(const word &modelName, HashTable< autoPtr< modelType >, phasePairKey, phasePairKey::hash > &models, const bool correctFixedFluxBCs=true)
Generate pairs and sub-model tables.
static word modelName(Name name, const word &model)
Return the name of the object within the given model.
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.