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();
222 template<
class modelType>
225 if (key.phase1().stationary() || key.phase2().stationary())
228 <<
"A " << modelType::typeName <<
" was specified for pair " 229 << key.name() <<
", but one of these phases is stationary. " 230 <<
"Mass transfer is not supported on stationary phases" 238 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
242 const dimensionSet& dims,
243 PtrList<GeometricField<Type, PatchField, GeoMesh>>& fieldList
248 if (fieldList.set(
phasei))
258 new GeometricField<Type, PatchField, GeoMesh>
267 dimensioned<Type>(
"zero", dims, pTraits<Type>::zero)
274 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
278 const dimensionSet& dims,
279 HashPtrTable<GeometricField<Type, PatchField, GeoMesh>>& fieldTable
286 if (fieldTable.set(phase.name()))
294 new GeometricField<Type, PatchField, GeoMesh>
303 dimensioned<Type>(
"zero", dims, pTraits<Type>::zero)
310 template<
class modelType>
348 template<
class modelType>
368 template<
class modelType>
371 const phaseModel& dispersed,
372 const phaseModel& continuous
375 return foundSubModel<modelType>(orderedPhasePair(dispersed, continuous));
379 template<
class modelType>
382 const phaseModel& dispersed,
383 const phaseModel& continuous
386 return lookupSubModel<modelType>(orderedPhasePair(dispersed, continuous));
390 template<
class modelType>
395 mesh().foundObject<BlendedInterfacialModel<modelType>>
399 BlendedInterfacialModel<modelType>::typeName,
407 BlendedInterfacialModel<modelType>::typeName,
422 template<
class modelType>
430 BlendedInterfacialModel<modelType>::typeName,
435 if (
mesh().foundObject<BlendedInterfacialModel<modelType>>(name))
446 BlendedInterfacialModel<modelType>::typeName,
461 template<
class GeoField,
class Group>
467 PtrList<GeoField>& fieldList
470 if (fieldList.set(group.index()))
472 fieldList[group.index()] +=
field;
489 template<
class GeoField,
class Group>
494 const GeoField& field,
495 PtrList<GeoField>& fieldList
498 addField(group, name, tmp<GeoField>(field), fieldList);
502 template<
class GeoField,
class Group>
508 HashPtrTable<GeoField>& fieldTable
511 if (fieldTable.found(group.name()))
513 *fieldTable[group.name()] +=
field;
530 template<
class GeoField,
class Group>
535 const GeoField& field,
536 HashPtrTable<GeoField>& fieldTable
539 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.
const fileName & name() const
Return the dictionary name.
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.
void validateMassTransfer(const phasePair &key) const
Check that mass transfer is supported across the given interface.
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.