58 const auto&
fvOptions = nbrMesh.lookupObject<optionList>(
"fvOptions");
60 bool nbrModelFound =
false;
79 <<
" in region " << nbrMesh.name() <<
nl
94 if (mesh_.time().timeIndex() != timeIndex_)
97 timeIndex_ = mesh_.time().timeIndex();
102 nbrModel().correct();
113 const word& modelType,
125 nbrModelName_(coeffs_.get<
word>(
"nbrModel")),
128 semiImplicit_(false),
144 TName_(coeffs_.getOrDefault<
word>(
"T",
"T")),
145 TNbrName_(coeffs_.getOrDefault<
word>(
"TNbr",
"T"))
177 auto& Tmapped = tTmapped.
ref();
187 Info<<
"Volumetric integral of htc: "
191 if (mesh_.time().writeTime())
202 const auto* thermoPtr =
207 const basicThermo&
thermo = *thermoPtr;
211 eqn += htc_*(Tmapped -
T) + htcByCpv*
he -
fvm::Sp(htcByCpv,
he);
218 Info<<
"Energy exchange from region " << nbrMesh.name()
219 <<
" To " << mesh_.name() <<
" : " << energy.value()
226 <<
" on mesh " << mesh_.name()
227 <<
" could not find object basicThermo."
228 <<
" The available objects are: "
240 eqn +=
htc_*(Tmapped -
T);
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const Time & time() const noexcept
Return Time associated with the objectRegistry.
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
Abstract base-class for fluid and solid thermodynamic properties.
static const word dictName
The dictionary name ("thermophysicalProperties").
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect,...
const Type & value() const noexcept
Return const reference to value.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
const GeometricField< Type, fvPatchField, volMesh > & psi(const label i=0) const
Return psi.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
Template invariant parts for fvPatchField.
Intermediate class for handling inter-region heat exchanges.
void correct()
Correct to calculate the inter-region heat transfer coefficient.
word TNbrName_
Name of operand neighbour temperature field.
void setNbrModel()
Set the neighbour interRegionHeatTransferModel.
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
Source term to energy equation.
virtual bool read(const dictionary &dict)
Read source dictionary.
interRegionHeatTransferModel(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from dictionary.
volScalarField htc_
Heat transfer coefficient [W/m2/k] times area/volume [1/m].
virtual void calculateHtc()=0
Calculate heat transfer coefficient.
const interRegionHeatTransferModel & nbrModel() const
Return const access to the neighbour model.
word nbrModelName_
Name of the model in the neighbour mesh.
const volScalarField & htc() const
Return the heat transfer coefficient.
interRegionHeatTransferModel * nbrModel_
Pointer to neighbour interRegionHeatTransferModel.
word TName_
Name of operand temperature field.
label timeIndex_
Time index - used for updating htc.
bool semiImplicit_
Flag to activate semi-implicit coupling.
bool firstIter_
Flag to determine the first iteration.
word nbrRegionName_
Name of the neighbour region to map.
interRegionOption(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from dictionary.
virtual bool read(const dictionary &dict)
Read dictionary.
bool master_
Master or slave region.
List of finite volume options.
const word & name() const noexcept
Return const access to the source name.
const fvMesh & mesh_
Reference to the mesh database.
wordList fieldNames_
Field names to apply source to - populated by derived models.
bool active() const noexcept
True if source is active.
dictionary coeffs_
Dictionary containing source coefficients.
void resetApplied()
Resize/reset applied flag list for all fieldNames_ entries.
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
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...
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Volume integrate volField creating a volField.
Calculate the finiteVolume matrix for implicit and explicit sources.
Namespace for handling debugging switches.
Namespace for finite-volume.
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
const dimensionSet dimEnergy
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
static constexpr const zero Zero
Global zero (0).
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
const dimensionSet dimVolume(pow3(dimLength))
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
constexpr char nl
The newline '\n' character (0x0a).
psiReactionThermo & thermo
#define forAll(list, i)
Loop across all elements in list.