45 #include "heatTransferModel.H" 53 namespace regionModels
55 namespace surfaceFilmModels
66 wordList thermoSingleLayer::hsBoundaryTypes()
125 hsBf[patchi] ==
hs(Tp, patchi);
162 YPrimary_[i].correctBoundaryConditions();
178 forAll(hsSpPrimaryBf, patchi)
185 hsSpPrimaryBf[patchi] *= rpriMagSfdeltaT;
209 else if ((
alpha_[i] > 0.5) && (
delta_[i] < hydrophilicDry))
311 thermoSingleLayer::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),
487 unsigned userLimits(limitType::CLAMP_NONE);
491 userLimits |= limitType::CLAMP_MIN;
497 userLimits |= limitType::CLAMP_MAX;
582 const scalar massSource,
583 const vector& momentumSource,
584 const scalar pressureSource,
585 const scalar energySource
599 <<
" energy = " << energySource <<
nl <<
nl;
643 for (
int corr=1; corr<=
nCorr_; corr++)
701 <<
gMin(Tinternal) <<
", " volScalarField Ts_
Temperature - surface [K].
virtual bool read()
Read control parameters from dictionary.
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
volScalarField hsSpPrimary_
Energy [J/m2/s].
volScalarField Tw_
Temperature - wall [K].
autoPtr< filmThermoModel > filmThermo_
Film thermo model.
autoPtr< heatTransferModel > htcw_
Heat transfer coefficient between wall and film [W/m2/K].
virtual void correctAlpha()
Correct film coverage field.
volScalarField TPrimary_
Temperature [K].
autoPtr< phaseChangeModel > phaseChange_
Phase change.
void size(const label n)
Older name for setAddressableSize.
virtual const volScalarField & Cp() const
Return the film specific heat capacity [J/kg/K].
virtual void preEvolveRegion()
Pre-evolve film hook.
autoPtr< filmTurbulenceModel > turbulence_
Turbulence model.
virtual void resetPrimaryRegionSourceTerms()
Reset source term fields.
const word zeroGradientType
A zeroGradient patch field type.
virtual void correct(scalarField &availableMass, volScalarField &massToInject, volScalarField &diameterToInject)
Correct.
Ostream & indent(Ostream &os)
Indent stream.
scalar deltaTValue() const noexcept
Return time step value.
volScalarField primaryMassTrans_
Film mass available for transfer to the primary region.
Kinematic form of single-cell layer surface film model.
virtual void transferPrimaryRegionSourceFields()
Transfer source fields from the primary region to the film region.
Type gMin(const FieldField< Field, Type > &f)
limitType withTbounds_
Limiting type.
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
wordList types() const
Return a list of the patch types.
virtual void transferPrimaryRegionThermoFields()
Transfer thermo fields from the primary region to the film region.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual const volScalarField & kappa() const
Return the film thermal conductivity [W/m/K].
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 speciesTable & species() const
Return the table of species.
bool hydrophilic_
Activation flag.
const dimensionedScalar phi0
Magnetic flux quantum: default SI units: [Wb].
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
virtual void transferPrimaryRegionThermoFields()
Transfer thermo fields from the primary region to the film region.
Template invariant parts for fvPatchField.
bool hasMultiComponentCarrier() const
Thermo database has multi-component carrier flag.
virtual void solveEnergy()
Solve energy equation.
scalarField availableMass_
Available mass for transfer via sub-models.
volScalarField cloudDiameterTrans_
Parcel diameters originating from film to cloud.
const labelList & primaryPatchIDs() const noexcept
List of patch IDs on the primary region coupled to this region.
autoPtr< heatTransferModel > htcs_
Heat transfer coefficient between film surface and primary.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
const Time & time() const
Return the top-level database.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
virtual void updateSurfaceTemperatures()
Correct the film surface and wall temperatures.
virtual tmp< volScalarField::Internal > Srho() const
Return total mass source - Eulerian phase only.
injectionModelList injection_
Cloud injection.
addToRunTimeSelectionTable(surfaceFilmRegionModel, kinematicSingleLayer, mesh)
Macros for easy insertion into run-time selection tables.
virtual void solveContinuity()
Solve continuity equation.
virtual tmp< volScalarField > pp()
Implicit pressure source coefficient.
volScalarField deltaRho_
Film thickness*density (helper field) [kg/m2].
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
volScalarField sigma_
Surface tension [m/s2].
Base class for surface film phase change models.
#define forAll(list, i)
Loop across all elements in list.
const labelList & intCoupledPatchIDs() const noexcept
List of patch IDs internally coupled with the primary region.
virtual void info()
Provide some feedback.
volScalarField rho_
Density [kg/m3].
virtual void transferPrimaryRegionSourceFields()
Transfer source fields from the primary region to the film region.
Calculate the first temporal derivative.
volScalarField hsSp_
Energy [J/m2/s].
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...
static const char *const typeName
Typename for Field.
virtual tmp< fvScalarMatrix > q(volScalarField &hs) const
Return the wall/surface heat transfer term for the enthalpy equation.
virtual void correct(scalarField &availableMass, volScalarField &massToTransfer)
Correct kinematic transfers.
const dimensionSet dimVolume(pow3(dimLength))
void toPrimary(const label regionPatchi, List< Type > ®ionField) const
Convert a local region field to the primary region.
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
const T & min() const noexcept
The min value (first)
virtual void updateSubmodels()
Update the film sub-models.
UPtrList< const labelUList > faceCells() const
Return a list of faceCells for each patch.
volScalarField T_
Temperature - mean [K].
const dimensionedScalar e
Elementary charge.
virtual void info()
Provide some feedback.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Base class for surface film viscosity models.
virtual tmp< fvVectorMatrix > solveMomentum(const volScalarField &pu, const volScalarField &pp)
Solve for film velocity.
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.
limitType
Enumerated limiter type.
scalar hydrophilicDryScale_
Length scale applied to deltaWet_ to determine when a wet.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
Calculate the face-flux of the given field.
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
#define DebugInFunction
Report an information message using Foam::Info.
Calculate the laplacian of the given field.
volScalarField pPrimary_
Pressure [Pa].
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
const dictionary & coeffs() const noexcept
Return the model coefficients dictionary.
volVectorField U_
Velocity - mean [m/s].
volScalarField kappa_
Thermal conductivity [W/m/K].
Reading is optional [identical to LAZY_READ].
const fvMesh & regionMesh() const
Return the region mesh database.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package, and provides:
scalar hydrophilicWetScale_
Length scale applied to deltaWet_ to determine when a dry.
virtual const volScalarField & Ts() const
Return the film surface temperature [K].
volScalarField delta_
Film thickness [m].
volScalarField pSp_
Pressure [Pa].
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
SolverPerformance< Type > solve(faMatrix< Type > &, const dictionary &solverControls)
Solve returning the solution statistics given convergence tolerance.
virtual tmp< volScalarField > pu()
Explicit pressure source contribution.
#define DebugInfo
Report an information message using Foam::Info.
const SLGThermo & thermo_
Reference to the SLGThermo.
Calculate the divergence of the given field.
volScalarField rhoPrimary_
Density [kg/m3].
const uniformDimensionedVectorField & g
dimensionedScalar pos0(const dimensionedScalar &ds)
virtual void evolveRegion()
Evolve the film equations.
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.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
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...
label nCorr_
Number of PISO-like correctors.
Type gMax(const FieldField< Field, Type > &f)
virtual void resetPrimaryRegionSourceTerms()
Reset source term fields.
volScalarField primaryEnergyTrans_
Film energy transfer.
virtual void correctThermoFields()
Correct the thermo fields.
autoPtr< filmRadiationModel > radiation_
Radiation.
const dimensionSet dimEnergy
transferModelList transfer_
Transfer with the continuous phase.
dictionary coeffs_
Model coefficients dictionary.
const basicSpecieMixture & carrier() const
Return reference to the gaseous components.
virtual bool read()
Read control parameters from dictionary.
List< word > wordList
List of word.
label carrierId(const word &cmptName, bool allowNotFound=false) const
Index of carrier component.
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
scalar deltaWet_
Threshold film thickness beyond which the film is considered 'wet'.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
volScalarField Cp_
Specific heat capacity [J/kg/K].
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Type gAverage(const FieldField< Field, Type > &f)
const Time & time_
Reference to the time database.
surfaceScalarField phi_
Mass flux (includes film thickness) [kg.m/s].
virtual ~thermoSingleLayer()
Destructor.
Mesh data needed to do the Finite Volume discretisation.
volScalarField alpha_
Film coverage indicator, 1 = covered, 0 = uncovered [].
A List with indirect addressing. Like IndirectList but does not store addressing. ...
virtual void preEvolveRegion()
Pre-evolve film hook.
label nOuterCorr_
Number of outer correctors.
static tmp< DimensionedField< Type, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const Field< Type > &iField)
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions, copy of internal field...
PtrList< volScalarField > YPrimary_
List of specie mass fractions [0-1].
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
const T & max() const noexcept
The max value (second)
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
void correctBoundaryConditions()
Correct boundary field.
virtual const volScalarField & hs() const
Return the film sensible enthalpy [J/kg].
messageStream Info
Information stream (stdout output on master, null elsewhere)
autoPtr< filmViscosityModel > viscosity_
Viscosity model.
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 cloudMassTrans_
Film mass available for transfer to cloud.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
This boundary condition provides a self-contained version of the mapped condition. It does not use information on the patch; instead it holds the data locally.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
const fvMesh & primaryMesh() const noexcept
Return the reference to the primary mesh database.
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
A patch is a list of labels that address the faces in the global face list.
volScalarField rhoSp_
Mass [kg/m2/s].
Base class for film radiation models.
Defines the attributes of an object for which implicit objectRegistry management is supported...
scalarMinMax Tbounds_
Temperature limits (optional)
defineTypeNameAndDebug(kinematicSingleLayer, 0)
virtual void correctHsForMappedT()
Correct sensible enthalpy for mapped temperature fields.
virtual void solveThickness(const volScalarField &pu, const volScalarField &pp, fvVectorMatrix &UEqn)
Solve coupled velocity-thickness equations.
volScalarField hs_
Sensible enthalpy [J/kg].
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
Do not request registration (bool: false)
virtual tmp< volScalarField::Internal > Sh() const
Return enthalpy source - Eulerian phase only.
const Time & time() const noexcept
Return the reference to the time database.
const dimensionSet dimArea(sqr(dimLength))
const dimensionSet & dimensions() const noexcept
Return dimensions.
Base class for film heat transfer models.
virtual const volScalarField & T() const
Return the film mean temperature [K].
static constexpr const zero Zero
Global zero (0)
virtual const volScalarField & Tw() const
Return the film wall temperature [K].