45#include "heatTransferModel.H"
66wordList thermoSingleLayer::hsBoundaryTypes()
125 hsBf[patchi] ==
hs(Tp, patchi);
147 Ts_.correctBoundaryConditions();
162 YPrimary_[i].correctBoundaryConditions();
178 forAll(hsSpPrimaryBf, patchi)
185 hsSpPrimaryBf[patchi] *= rpriMagSfdeltaT;
192 hsSp_.correctBoundaryConditions();
209 else if ((
alpha_[i] > 0.5) && (
delta_[i] < hydrophilicDry))
311thermoSingleLayer::thermoSingleLayer
313 const word& modelType,
316 const word& regionType,
328 regionMesh().thisDb(),
343 regionMesh().thisDb(),
359 regionMesh().thisDb(),
372 regionMesh().thisDb(),
385 regionMesh().thisDb(),
398 regionMesh().thisDb(),
411 "primaryEnergyTrans",
413 regionMesh().thisDb(),
422 deltaWet_(coeffs_.get<scalar>(
"deltaWet")),
423 hydrophilic_(coeffs_.get<bool>(
"hydrophilic")),
424 hydrophilicDryScale_(0.0),
425 hydrophilicWetScale_(0.0),
433 regionMesh().thisDb(),
439 this->mappedPushedFieldPatchTypes<scalar>()
448 primaryMesh().thisDb(),
462 regionMesh().thisDb(),
468 this->mappedFieldAndInternalPatchTypes<scalar>()
484 withTbounds_(limitType::CLAMP_NONE),
582 const scalar massSource,
583 const vector& momentumSource,
584 const scalar pressureSource,
585 const scalar energySource
599 <<
" energy = " << energySource <<
nl <<
nl;
601 hsSpPrimary_.boundaryFieldRef()[patchi][facei] -= energySource;
643 for (
int corr=1; corr<=
nCorr_; corr++)
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const uniformDimensionedVectorField & g
const dimensionSet & dimensions() const noexcept
Return dimensions.
static const char *const typeName
Typename for Field.
wordList types() const
Return a list of the patch types.
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())
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
GeometricBoundaryField< scalar, fvPatchField, volMesh > Boundary
void correctBoundaryConditions()
Correct boundary field.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
@ NO_REGISTER
Do not request registration (bool: false).
@ REGISTER
Request registration (bool: true).
@ NO_READ
Nothing to be read.
@ READ_IF_PRESENT
Reading is optional [identical to LAZY_READ].
@ MUST_READ
Reading required.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
@ AUTO_WRITE
Automatically write from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
const T & max() const noexcept
The max value.
const T & min() const noexcept
The min value.
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
label carrierId(const word &cmptName, bool allowNotFound=false) const
Index of carrier component.
const basicSpecieMixture & carrier() const
Return reference to the gaseous components.
bool hasMultiComponentCarrier() const
Thermo database has multi-component carrier flag.
scalar deltaTValue() const noexcept
Return time step value.
A List with indirect addressing. Like IndirectList but does not store addressing.
void size(const label n)
Older name for setAddressableSize.
const word & name() const
Name function is needed to disambiguate those inherited from regIOobject and dictionary.
const speciesTable & species() const
Return the table of species.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
Mesh data needed to do the Finite Volume discretisation.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
Template invariant parts for fvPatchField.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
This boundary condition provides a self-contained version of the mapped condition....
UPtrList< const labelUList > faceCells() const
Return a list of faceCells for each patch.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A patch is a list of labels that address the faces in the global face list.
const Time & time_
Reference to the time database.
const labelList & primaryPatchIDs() const noexcept
List of patch IDs on the primary region coupled to this region.
const Time & time() const noexcept
Return the reference to the time database.
dictionary coeffs_
Model coefficients dictionary.
const fvMesh & regionMesh() const
Return the region mesh database.
const labelList & intCoupledPatchIDs() const noexcept
List of patch IDs internally coupled with the primary region.
const fvMesh & primaryMesh() const noexcept
Return the reference to the primary mesh database.
void toPrimary(const label regionPatchi, List< Type > ®ionField) const
Convert a local region field to the primary region.
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
const dictionary & coeffs() const noexcept
Return the model coefficients dictionary.
wordList mappedFieldAndInternalPatchTypes() const
Return boundary types for mapped field patches.
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
wordList mappedPushedFieldPatchTypes() const
Return boundary types for pushed mapped field patches.
static autoPtr< surfaceFilmModel > New(const fvMesh &mesh, const dimensionedVector &g, const word ®ionType="surfaceFilm")
Return a reference to the selected surface film model.
Base class for film radiation models.
Base class for surface film viscosity models.
Base class for film heat transfer models.
virtual void correct(scalarField &availableMass, volScalarField &massToInject, volScalarField &diameterToInject)
Correct.
Kinematic form of single-cell layer surface film model.
virtual void solveThickness(const volScalarField &pu, const volScalarField &pp, fvVectorMatrix &UEqn)
Solve coupled velocity-thickness equations.
volScalarField rho_
Density [kg/m3].
virtual void transferPrimaryRegionThermoFields()
Transfer thermo fields from the primary region to the film region.
volVectorField U_
Velocity - mean [m/s].
virtual void solveContinuity()
Solve continuity equation.
volScalarField sigma_
Surface tension [m/s2].
virtual void addSources(const label patchi, const label facei, const scalar massSource, const vector &momentumSource, const scalar pressureSource, const scalar energySource=0)
External hook to add sources to the film.
volScalarField rhoPrimary_
Density [kg/m3].
volScalarField pPrimary_
Pressure [Pa].
injectionModelList injection_
Cloud injection.
volScalarField rhoSp_
Mass [kg/m2/s].
volScalarField deltaRho_
Film thickness*density (helper field) [kg/m2].
volScalarField cloudDiameterTrans_
Parcel diameters originating from film to cloud.
transferModelList transfer_
Transfer with the continuous phase.
volScalarField delta_
Film thickness [m].
virtual void resetPrimaryRegionSourceTerms()
Reset source term fields.
label nOuterCorr_
Number of outer correctors.
virtual void preEvolveRegion()
Pre-evolve film hook.
surfaceScalarField phi_
Mass flux (includes film thickness) [kg.m/s].
virtual tmp< fvVectorMatrix > solveMomentum(const volScalarField &pu, const volScalarField &pp)
Solve for film velocity.
label nCorr_
Number of PISO-like correctors.
virtual tmp< volScalarField > pp()
Implicit pressure source coefficient.
virtual void info()
Provide some feedback.
volScalarField mu_
Dynamic viscosity [Pa.s].
virtual void transferPrimaryRegionSourceFields()
Transfer source fields from the primary region to the film region.
volScalarField primaryMassTrans_
Film mass available for transfer to the primary region.
volScalarField pSp_
Pressure [Pa].
volScalarField cloudMassTrans_
Film mass available for transfer to cloud.
autoPtr< filmThermoModel > filmThermo_
Film thermo model.
scalarField availableMass_
Available mass for transfer via sub-models.
virtual bool read()
Read control parameters from dictionary.
virtual tmp< volScalarField > pu()
Explicit pressure source contribution.
autoPtr< filmTurbulenceModel > turbulence_
Turbulence model.
volScalarField alpha_
Film coverage indicator, 1 = covered, 0 = uncovered [].
Base class for surface film phase change models.
Base class for surface film models.
const dimensionedVector & g() const
Return the acceleration due to gravity.
Thermodynamic form of single-cell layer surface film model.
limitType
Enumerated limiter type.
@ CLAMP_MAX
Clamp maximum value.
@ CLAMP_MIN
Clamp minimum value.
volScalarField TPrimary_
Temperature [K].
virtual void transferPrimaryRegionThermoFields()
Transfer thermo fields from the primary region to the film region.
volScalarField kappa_
Thermal conductivity [W/m/K].
autoPtr< heatTransferModel > htcw_
Heat transfer coefficient between wall and film [W/m2/K].
virtual const volScalarField & hs() const
Return the film sensible enthalpy [J/kg].
virtual tmp< fvScalarMatrix > q(volScalarField &hs) const
Return the wall/surface heat transfer term for the enthalpy equation.
virtual void updateSurfaceTemperatures()
Correct the film surface and wall temperatures.
autoPtr< filmRadiationModel > radiation_
Radiation.
virtual void addSources(const label patchi, const label facei, const scalar massSource, const vector &momentumSource, const scalar pressureSource, const scalar energySource)
External hook to add sources to the film.
volScalarField Tw_
Temperature - wall [K].
virtual const volScalarField & kappa() const
Return the film thermal conductivity [W/m/K].
virtual ~thermoSingleLayer()
Destructor.
virtual const volScalarField & T() const
Return the film mean temperature [K].
virtual const volScalarField & Ts() const
Return the film surface temperature [K].
bool hydrophilic_
Activation flag.
volScalarField Cp_
Specific heat capacity [J/kg/K].
virtual void solveEnergy()
Solve energy equation.
volScalarField hsSp_
Energy [J/m2/s].
scalar hydrophilicWetScale_
Length scale applied to deltaWet_ to determine when a dry.
virtual const volScalarField & Tw() const
Return the film wall temperature [K].
volScalarField hsSpPrimary_
Energy [J/m2/s].
virtual const volScalarField & Cp() const
Return the film specific heat capacity [J/kg/K].
virtual void resetPrimaryRegionSourceTerms()
Reset source term fields.
scalarMinMax Tbounds_
Temperature limits (optional).
scalar deltaWet_
Threshold film thickness beyond which the film is considered 'wet'.
volScalarField T_
Temperature - mean [K].
virtual void preEvolveRegion()
Pre-evolve film hook.
virtual void correctAlpha()
Correct film coverage field.
PtrList< volScalarField > YPrimary_
List of specie mass fractions [0-1].
volScalarField primaryEnergyTrans_
Film energy transfer.
scalar hydrophilicDryScale_
Length scale applied to deltaWet_ to determine when a wet.
virtual void correctThermoFields()
Correct the thermo fields.
virtual void info()
Provide some feedback.
virtual void updateSubmodels()
Update the film sub-models.
virtual void transferPrimaryRegionSourceFields()
Transfer source fields from the primary region to the film region.
const SLGThermo & thermo_
Reference to the SLGThermo.
volScalarField hs_
Sensible enthalpy [J/kg].
autoPtr< phaseChangeModel > phaseChange_
Phase change.
limitType withTbounds_
Limiting type.
virtual tmp< volScalarField::Internal > Srho() const
Return total mass source - Eulerian phase only.
autoPtr< filmViscosityModel > viscosity_
Viscosity model.
autoPtr< heatTransferModel > htcs_
Heat transfer coefficient between film surface and primary.
virtual bool read()
Read control parameters from dictionary.
virtual void correctHsForMappedT()
Correct sensible enthalpy for mapped temperature fields.
virtual tmp< volScalarField::Internal > Sh() const
Return enthalpy source - Eulerian phase only.
virtual void evolveRegion()
Evolve the film equations.
volScalarField Ts_
Temperature - surface [K].
virtual void correct(scalarField &availableMass, volScalarField &massToTransfer)
Correct kinematic transfers.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
Calculate the first temporal derivative.
Calculate the divergence of the given field.
Calculate the face-flux of the given field.
Calculate the laplacian of the given field.
#define DebugInfo
Report an information message using Foam::Info.
#define DebugInFunction
Report an information message using Foam::Info.
const dimensionedScalar phi0
Magnetic flux quantum: default SI units: [Wb].
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
Type gAverage(const FieldField< Field, Type > &f, const label comm)
The global arithmetic average of a FieldField.
List< word > wordList
List of word.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
const dimensionSet dimless
Dimensionless.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
dimensionedScalar pos0(const dimensionedScalar &ds)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimEnergy
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionSet dimArea(sqr(dimLength))
messageStream Info
Information stream (stdout output on master, null elsewhere).
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & indent(Ostream &os)
Indent stream.
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
fvMatrix< vector > fvVectorMatrix
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0).
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.
UList< label > labelUList
A UList of labels.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.