28#include "BlendedInterfacialModel.H"
32template<
class modelType>
61template<
class modelType>
64 const word& modelName,
73 dictTable modelDicts(lookup(modelName));
81template<
class modelType>
84 const word& modelName,
91 const bool correctFixedFluxBCs
98 modelTypeTable tempModels;
99 generatePairsAndSubModels(modelName, tempModels);
103 blendingMethods_.found(modelName)
104 ? blendingMethods_[modelName]
105 : blendingMethods_.found(member(modelName))
106 ? blendingMethods_[member(modelName)]
107 : blendingMethods_[
"default"]
121 const phasePairKey key(iter.key().first(), iter.key().second());
122 const phasePairKey key1In2(key.first(), key.second(),
true);
123 const phasePairKey key2In1(key.second(), key.first(),
true);
128 autoPtr<BlendedInterfacialModel<modelType>>
130 new BlendedInterfacialModel<modelType>
132 phaseModels_[key.first()],
133 phaseModels_[key.second()],
135 tempModels.found(key ) ? tempModels[key ] : noModel,
136 tempModels.found(key1In2) ? tempModels[key1In2] : noModel,
137 tempModels.found(key2In1) ? tempModels[key2In1] : noModel,
143 if (!phasePairs_.found(key))
152 phaseModels_[key.first()],
153 phaseModels_[key.second()]
162template<
class modelType>
165 const word& modelName,
172 const bool correctFixedFluxBCs
183 modelTypeTable tempModels;
184 generatePairsAndSubModels
191 forAllIter(
typename modelTypeTable, tempModels, tempModelIter)
195 if (!models.found(
key))
206 if (!pair.contains(
phase))
209 <<
"A two-sided " << modelType::typeName <<
" was "
210 <<
"specified for the " <<
phase.
name() <<
" side of the "
211 << pair <<
" pair, but that phase is not part of that pair."
215 models[key][pair.index(
phase)].reset(tempModelIter().ptr());
221template<
class GeoField>
225 const word& fieldName,
230 if (fieldList.set(
phase.index()))
249template<
class GeoField>
252 const phaseModel& phase,
253 const word& fieldName,
254 const GeoField&
field,
255 PtrList<GeoField>& fieldList
262template<
class GeoField>
266 const word& fieldName,
290template<
class GeoField>
293 const phaseModel& phase,
294 const word& fieldName,
295 const GeoField&
field,
296 HashPtrTable<GeoField>& fieldTable
305template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
315 if (fieldList.set(
phasei))
320 const phaseModel& phase = this->phaseModels_[
phasei];
325 new GeometricField<Type, PatchField, GeoMesh>
330 this->mesh_.time().timeName(),
334 dimensioned<Type>(dims,
Zero)
341template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
345 const dimensionSet& dims,
346 HashPtrTable<GeometricField<Type, PatchField, GeoMesh>>& fieldTable
351 const phaseModel& phase = this->phaseModels_[
phasei];
353 if (fieldTable.set(phase.name()))
366 this->mesh_.time().timeName(),
377template<
class modelType>
384 if (
mesh().foundObject<modelType>(
name))
399 mesh().foundObject<modelType>
415template<
class modelType>
420 if (
key.ordered() ||
mesh().foundObject<modelType>(
name))
435template<
class modelType>
438 const phaseModel& dispersed,
439 const phaseModel& continuous
446template<
class modelType>
457template<
class modelType>
489template<
class modelType>
497 BlendedInterfacialModel<modelType>::typeName,
502 if (
mesh().foundObject<BlendedInterfacialModel<modelType>>(
name))
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Generic GeometricField class.
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
bool set(const Key &key, T *ptr)
Assign a new entry, overwrites existing.
A HashTable similar to std::unordered_map.
bool found(const Key &key) const
Same as contains().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static word member(const word &name)
Return member (name without the extension).
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
An ordered pair of two objects of type <T> with first() and second() elements.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
const word & name() const
Name function is needed to disambiguate those inherited from regIOobject and dictionary.
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Generic dimensioned Type class.
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
const word & name() const
An ordered or unorder pair of phase names. Typically specified as follows.
phasePairKey::hasher hash
Alternative name for functor.
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
label index(const phaseModel &phase) const
Return the index of the given phase. Generates a FatalError if.
bool contains(const phaseModel &phase) const
Return true if this phasePair contains the given phase.
void createSubModels(const dictTable &modelDicts, HashTable< autoPtr< modelType >, phasePairKey, phasePairKey::hash > &models)
Generate pairs and sub-model tables.
void generatePairs(const dictTable &modelDicts)
Generate pairs.
phaseModelList phaseModels_
Phase models.
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.
const modelType & lookupSubModel(const phasePair &key) const
Return a sub model between a phase pair.
const BlendedInterfacialModel< modelType > & lookupBlendedSubModel(const phasePair &key) const
Return a blended sub model between a phase pair.
bool foundBlendedSubModel(const phasePair &key) const
Check availability of a blended sub model for a given phase pair.
void generatePairsAndSubModels(const word &modelName, HashTable< autoPtr< modelType >, phasePairKey, phasePairKey::hash > &models)
Generate pairs and sub-model tables.
bool foundSubModel(const phasePair &key) const
Check availability of a sub model for a given phase pair.
phasePairTable phasePairs_
Phase pairs.
const fvMesh & mesh() const
Return the mesh.
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.
HashTable< dictionary, phasePairKey, phasePairKey::hash > dictTable
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
const word & name() const
Lookup type of boundary radiation properties.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr auto key(const Type &t) noexcept
Helper function to return the enum value.
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAll(list, i)
Loop across all elements in list.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object.