47 void Foam::fv::codedFvModel::readCoeffs()
49 fieldName_ = coeffs().lookup<word>(
"field");
58 Foam::word Foam::fv::codedFvModel::fieldPrimitiveTypeName()
const 60 #define fieldPrimitiveTypeNameTernary(Type, nullArg) \ 61 mesh().foundObject<VolField<Type>>(fieldName_) \ 62 ? pTraits<Type>::typeName \ 69 void Foam::fv::codedFvModel::prepare
72 const dynamicCodeContext& context
75 const word primitiveTypeName = fieldPrimitiveTypeName();
78 dynCode.setFilterVariable(
"typeName",
name());
79 dynCode.setFilterVariable(
"TemplateType", primitiveTypeName);
80 dynCode.setFilterVariable(
"SourceType", primitiveTypeName +
"Source");
83 dynCode.addCompileFile(
"codedFvModelTemplate.C");
86 dynCode.addCopyFile(
"codedFvModelTemplate.H");
89 dynCode.setMakeOptions
92 "-I$(LIB_SRC)/finiteVolume/lnInclude \\\n" 93 "-I$(LIB_SRC)/meshTools/lnInclude \\\n" 94 "-I$(LIB_SRC)/sampling/lnInclude \\\n" 95 "-I$(LIB_SRC)/fvModels/lnInclude \\\n" 97 +
"\n\nLIB_LIBS = \\\n" 101 +
" -lfiniteVolume \\\n" 107 const Foam::word& Foam::fv::codedFvModel::codeName()
const 113 Foam::string Foam::fv::codedFvModel::description()
const 115 return "fvModel:: " +
name();
119 void Foam::fv::codedFvModel::clearRedirect()
const 121 redirectFvModelPtr_.clear();
138 "codeAddAlphaRhoSup",
145 Foam::fvModel& Foam::fv::codedFvModel::redirectFvModel()
const 147 if (!redirectFvModelPtr_.valid())
149 dictionary constructDict(coeffs());
150 constructDict.set(
"type",
name());
158 return redirectFvModelPtr_();
163 void Foam::fv::codedFvModel::addSupType
166 const word& fieldName
173 Info<<
"codedFvModel::addSup for source " <<
name() <<
endl;
177 redirectFvModel().addSup(eqn, fieldName);
183 void Foam::fv::codedFvModel::addSupType
187 const word& fieldName
194 Info<<
"codedFvModel::addSup for source " <<
name() <<
endl;
198 redirectFvModel().addSup(rho, eqn, fieldName);
204 void Foam::fv::codedFvModel::addSupType
209 const word& fieldName
216 Info<<
"codedFvModel::addSup for source " <<
name() <<
endl;
220 redirectFvModel().addSup(alpha, rho, eqn, fieldName);
230 const word& modelType,
235 fvModel(name, modelType, dict, mesh),
236 set_(coeffs(), mesh),
262 set_.updateMesh(mpm);
#define IMPLEMENT_FV_MODEL_ADD_ALPHA_RHO_SUP(Type, modelType)
defineTypeNameAndDebug(fixedTemperatureConstraint, 0)
#define fieldPrimitiveTypeNameTernary(Type, nullArg)
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual bool read(const dictionary &dict)
Read source dictionary.
FOR_ALL_FIELD_TYPES(IMPLEMENT_FV_MODEL_ADD_SUP, fv::codedFvModel)
virtual bool read(const dictionary &dict)
Read source dictionary.
Ostream & endl(Ostream &os)
Add newline and flush stream.
codedFvModel(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Finite volume model abstract base class.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual void updateMesh(const mapPolyMesh &)
Update for mesh changes.
A class for handling words, derived from string.
static autoPtr< fvModel > New(const word &name, const dictionary &dict, const fvMesh &mesh)
Return a reference to the selected fvModel.
static const word null
An empty word.
#define IMPLEMENT_FV_MODEL_ADD_SUP(Type, modelType)
Constructs on-the-fly fvModel source from user-supplied code.
word name(const complex &)
Return a string representation of a complex.
addToRunTimeSelectionTable(fvConstraint, fixedTemperatureConstraint, dictionary)
List< word > wordList
A List of words.
#define IMPLEMENT_FV_MODEL_ADD_RHO_SUP(Type, modelType)
Mesh data needed to do the Finite Volume discretisation.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
A class for handling character strings derived from std::string.