Go to the documentation of this file.
42 namespace regionModels
44 namespace surfaceFilmModels
86 Info<<
"kinematicSingleLayer::resetPrimaryRegionSourceTerms()" <<
endl;
99 Info<<
"kinematicSingleLayer::"
100 <<
"transferPrimaryRegionThermoFields()" <<
endl;
116 Info<<
"kinematicSingleLayer::"
117 <<
"transferPrimaryRegionSourceFields()" <<
endl;
141 if (
time().outputTime())
150 scalar addedMassTotal = 0.0;
211 Info<<
"kinematicSingleLayer::updateSubmodels()" <<
endl;
251 <<
" time step continuity errors: sum local = "
262 Info<<
"kinematicSingleLayer::solveContinuity()" <<
endl;
300 Info<<
"kinematicSingleLayer::solveMomentum()" <<
endl;
312 + forces_.correct(U_)
313 + turbulence_->Su(U_)
320 if (momentumPredictor_)
342 U_ -= nHat()*(nHat() & U_);
343 U_.correctBoundaryConditions();
359 Info<<
"kinematicSingleLayer::solveThickness()" <<
endl;
378 constrainFilmField(phiAdd, 0.0);
384 - deltarUAf*phiAdd*
rhof
386 constrainFilmField(
phid, 0.0);
394 regionMesh().setFluxRequired(delta_.name());
396 for (
int nonOrth=0; nonOrth<=nNonOrthCorr_; nonOrth++)
410 if (nonOrth == nNonOrthCorr_)
415 * regionMesh().magSf();
417 phi_ == deltaEqn.
flux();
428 U_ -= nHat()*(nHat() & U_);
430 U_.correctBoundaryConditions();
433 updateSurfaceVelocities();
444 const word& modelType,
447 const word& regionType,
453 momentumPredictor_(
solution().subDict(
"PISO").
lookup(
"momentumPredictor")),
454 nOuterCorr_(
solution().subDict(
"PISO").lookupOrDefault(
"nOuterCorr", 1)),
461 cumulativeContErr_(0.0),
463 deltaSmall_(
"deltaSmall",
dimLength, SMALL),
464 deltaCoLimit_(
solution().lookupOrDefault(
"deltaCoLimit", 1
e-4)),
478 zeroGradientFvPatchScalarField::typeName
492 zeroGradientFvPatchScalarField::typeName
506 zeroGradientFvPatchScalarField::typeName
533 zeroGradientFvPatchScalarField::typeName
558 zeroGradientFvPatchScalarField::typeName
571 zeroGradientFvPatchScalarField::typeName
577 delta_.name() +
"*" + rho_.name(),
585 zeroGradientFvPatchScalarField::typeName
614 zeroGradientFvPatchScalarField::typeName
628 zeroGradientFvPatchScalarField::typeName
634 "cloudDiameterTrans",
642 zeroGradientFvPatchScalarField::typeName
660 this->mappedPushedFieldPatchTypes<vector>()
674 this->mappedPushedFieldPatchTypes<scalar>()
688 this->mappedPushedFieldPatchTypes<scalar>()
743 this->mappedFieldAndInternalPatchTypes<vector>()
757 this->mappedFieldAndInternalPatchTypes<scalar>()
771 this->mappedFieldAndInternalPatchTypes<scalar>()
785 this->mappedFieldAndInternalPatchTypes<scalar>()
790 availableMass_(regionMesh().nCells(), 0.0),
792 injection_(*
this, coeffs_),
796 forces_(*
this, coeffs_),
802 transferPrimaryRegionThermoFields();
806 correctThermoFields();
808 deltaRho_ == delta_*rho_;
841 const scalar massSource,
842 const vector& momentumSource,
843 const scalar pressureSource,
844 const scalar energySource
849 Info<<
"\nSurface film: " <<
type() <<
": adding to film source:" <<
nl
850 <<
" mass = " << massSource <<
nl
851 <<
" momentum = " << momentumSource <<
nl
852 <<
" pressure = " << pressureSource <<
endl;
855 rhoSpPrimary_.boundaryField()[patchI][faceI] -= massSource;
856 USpPrimary_.boundaryField()[patchI][faceI] -= momentumSource;
857 pSpPrimary_.boundaryField()[patchI][faceI] -= pressureSource;
859 addedMassTotal_ += massSource;
867 Info<<
"kinematicSingleLayer::preEvolveRegion()" <<
endl;
894 Info<<
"kinematicSingleLayer::evolveRegion()" <<
endl;
915 for (
int corr=1; corr<=
nCorr_; corr++)
931 Info<<
"kinematicSingleLayer::postEvolveRegion()" <<
endl;
1059 typeName +
":primaryMassTrans",
1091 scalar addedMassTotal = 0.0;
1095 Info<<
indent <<
"added mass = " << addedMassTotal <<
nl
1096 <<
indent <<
"current mass = "
1098 <<
indent <<
"min/max(mag(U)) = " <<
gMin(
mag(Uinternal)) <<
", "
1100 <<
indent <<
"min/max(delta) = " <<
gMin(deltaInternal) <<
", "
1101 <<
gMax(deltaInternal) <<
nl
1102 <<
indent <<
"coverage = "
dimensionedScalar totalMass
virtual const volScalarField & T() const
Return the film mean temperature [K].
virtual bool read()
Read control parameters from dictionary.
virtual void correctThermoFields()
Correct the thermo fields.
volScalarField rhoSpPrimary_
Mass / [kg/m2/s].
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
scalar deltaCoLimit_
Film thickness above which Courant number calculation in valid.
const dimensionSet dimPressure
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< GeometricField< Type, fvPatchField, volMesh > > surfaceSum(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual ~kinematicSingleLayer()
Destructor.
virtual void transferPrimaryRegionThermoFields()
Transfer thermo fields from the primary region to the film region.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
volVectorField Us_
Velocity - surface / [m/s].
virtual tmp< DimensionedField< scalar, volMesh > > Srho() const
Return total mass source - Eulerian phase only.
Selector class for relaxation factors, solver type and solution.
A class for handling words, derived from string.
volVectorField USpPrimary_
Momementum / [kg/m/s2].
surfaceScalarField phid("phid", fvc::interpolate(psi) *((mesh.Sf() &fvc::interpolate(HbyA))+rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho)))
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
volVectorField USp_
Momementum / [kg/m/s2].
dimensionedScalar deltaT() const
Return time step.
virtual const volVectorField & Us() const
Return the film surface velocity [m/s].
injectionModelList injection_
Cloud injection.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
virtual void preEvolveRegion()
Pre-evolve film hook.
#define forAll(list, i)
Loop across all elements in list.
const IOdictionary & outputProperties() const
Return const access to the output properties dictionary.
A class for managing temporary objects.
const dimensionSet dimVelocity
const dimensionSet dimEnergy
const dimensionSet dimDensity
virtual const volScalarField & Ts() const
Return the film surface temperature [K].
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
autoPtr< filmTurbulenceModel > turbulence_
Turbulence model.
autoPtr< filmThermoModel > filmThermo_
Film thermo model.
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
virtual const volVectorField & U() const
Return the film velocity [m/s].
const dimensionedScalar deltaSmall_
Small delta.
Calculate the snGrad of the given volField.
virtual void evolveRegion()
Evolve the film equations.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &vf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
virtual void solveContinuity()
Solve continuity equation.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
virtual void info(Ostream &os)
Provide some info.
Calculate the divergence of the given field.
const Time & time() const
Return the reference to the time database.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
virtual void solveThickness(const volScalarField &pu, const volScalarField &pp, const fvVectorMatrix &UEqn)
Solve coupled velocity-thickness equations.
volScalarField rho_
Density / [kg/m3].
volScalarField sigma_
Surface tension / [m/s2].
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
const dimensionedVector & g
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void continuityCheck()
Continuity check.
Type gSum(const FieldField< Field, Type > &f)
dimensioned< scalar > mag(const dimensioned< Type > &)
This function object reads fields from the time directories and adds them to the mesh database for fu...
scalarField availableMass_
Available mass for transfer via sub-models.
volScalarField pPrimary_
Pressure / [Pa].
volScalarField muPrimary_
Viscosity / [Pa.s].
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
const fvMesh & primaryMesh() const
Return the reference to the primary mesh database.
tmp< volScalarField > gNormClipped() const
Return the gravity normal-to-patch component contribution.
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
SolverPerformance< Type > solve(const dictionary &)
Solve segregated or coupled returning the solution statistics.
volScalarField cloudDiameterTrans_
Parcel diameters originating from film to cloud.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
volScalarField deltaRho_
Film thickness*density (helper field) / [kg/m2].
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
virtual const volScalarField & cloudMassTrans() const
Return the film mass available for transfer to cloud.
scalar addedMassTotal_
Cumulative mass added via sources [kg].
const dimensionSet dimArea(sqr(dimLength))
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual void transferPrimaryRegionSourceFields()
Transfer source fields from the primary region to the film region.
Pre-declare SubField and related Field type.
volScalarField delta_
Film thickness / [m].
A patch is a list of labels that address the faces in the global face list.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
virtual const volScalarField & kappa() const
Return the film thermal conductivity [W/m/K].
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
virtual tmp< volScalarField > pp()
Implicit pressure source coefficient.
virtual const volScalarField & cloudDiameterTrans() const
Return the parcel diameters originating from film to cloud.
virtual void info()
Provide some feedback.
virtual void preEvolveRegion()
Pre-evolve region.
tmp< fvVectorMatrix > UEqn(fvm::div(phi, U)+MRF.DDt(U)+turbulence->divDevReff(U)==fvOptions(U))
InternalField & internalField()
Return internal field.
const dimensionedScalar phi0
Magnetic flux quantum: default SI units: [Wb].
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
scalar deltaTValue() const
Return time step value.
volVectorField Uw_
Velocity - wall / [m/s].
virtual tmp< volScalarField > primaryMassTrans() const
Return mass transfer source - Eulerian phase only.
virtual void resetPrimaryRegionSourceTerms()
Reset source term fields.
virtual tmp< fvVectorMatrix > solveMomentum(const volScalarField &pu, const volScalarField &pp)
Solve for film velocity.
virtual const surfaceScalarField & phi() const
Return the film flux [kg.m/s].
const dictionary & solution() const
Return the solution dictionary.
static autoPtr< filmTurbulenceModel > New(surfaceFilmModel &owner, const dictionary &dict)
Return a reference to the selected injection model.
virtual bool read()
Read control parameters from dictionary.
virtual void correctAlpha()
Correct film coverage field.
Switch momentumPredictor_
Momentum predictor.
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.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Macros for easy insertion into run-time selection tables.
Generic dimensioned Type class.
volVectorField U_
Velocity - mean / [m/s].
Mesh data needed to do the Finite Volume discretisation.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
errorManip< error > abort(error &err)
label nCorr_
Number of PISO-like correctors.
const double e
Elementary charge.
Ostream & indent(Ostream &os)
Indent stream.
tmp< volScalarField > mass() const
Return the current film mass.
virtual tmp< volScalarField > pu()
Explicit pressure source contribution.
volVectorField UPrimary_
Velocity / [m/s].
volScalarField pSp_
Pressure / [Pa].
scalar cumulativeContErr_
Cumulative continuity error.
surfaceScalarField phi_
Mass flux (includes film thickness) / [kg.m/s].
void correctBoundaryConditions()
Correct boundary field.
conserve internalField()+
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
defineTypeNameAndDebug(kinematicSingleLayer, 0)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
SolverPerformance< Type > solve(fvMatrix< Type > &, const dictionary &)
Solve returning the solution statistics given convergence tolerance.
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const Time & time_
Reference to the time database.
Calculate the laplacian of the given field.
virtual void correct(scalarField &availableMass, volScalarField &massToInject, volScalarField &diameterToInject)
Correct.
volScalarField alpha_
Film coverage indicator, 1 = covered, 0 = uncovered / [].
volScalarField pSpPrimary_
Pressure / [Pa].
volScalarField mu_
Dynamic viscosity / [Pa.s].
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
label nNonOrthCorr_
Number of non-orthogonal correctors.
virtual const volVectorField & Uw() const
Return the film wall velocity [m/s].
Kinematic form of single-cell layer surface film model.
virtual const volVectorField & nHat() const
Return the patch normal vectors.
volScalarField rhoPrimary_
Density / [kg/m3].
Volume integrate volField creating a volField.
virtual void updateSurfaceVelocities()
Update film surface velocities.
addToRunTimeSelectionTable(surfaceFilmModel, kinematicSingleLayer, mesh)
tmp< volScalarField > netMass() const
Return the net film mass available over the next integration.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
label readLabel(Istream &is)
virtual const volScalarField & Cp() const
Return the film specific heat capacity [J/kg/K].
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
Reconstruct volField from a face flux field.
A List with indirect addressing.
kinematicSingleLayer(const kinematicSingleLayer &)
Disallow default bitwise copy construct.
Base class for surface film models.
void size(const label)
Override size to be inconsistent with allocated storage.
static const GeometricField< Type, PatchField, GeoMesh > & null()
Return a null geometric field.
Type gMin(const FieldField< Field, Type > &f)
virtual const volScalarField & Tw() const
Return the film wall temperature [K].
virtual void postEvolveRegion()
Post-evolve film hook.
virtual const volScalarField & rho() const
Return the film density [kg/m3].
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
const dimensionSet dimVolume(pow3(dimLength))
virtual const volScalarField & deltaRho() const
Return the film thickness*density (helper field) [kg/m3].
surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)"))
virtual void updateSubmodels()
Update the film sub-models.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Generic GeometricField class.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux() const
Return the face-flux field from the matrix.
volScalarField rhoSp_
Mass / [kg/m2/s].
volScalarField cloudMassTrans_
Film mass available for transfer to cloud.
Type gMax(const FieldField< Field, Type > &f)
virtual tmp< DimensionedField< scalar, volMesh > > Sh() const
Return enthalpy source - Eulerian phase only.
word name(const complex &)
Return a string representation of a complex.
label nOuterCorr_
Number of outer correctors.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual scalar CourantNumber() const
Courant number evaluation.
stressControl lookup("compactNormalStress") >> compactNormalStress
const fvMesh & regionMesh() const
Return the region mesh database.
static autoPtr< filmThermoModel > New(surfaceFilmModel &owner, const dictionary &dict)
Return a reference to the selected phase change model.
dimensionedScalar pos(const dimensionedScalar &ds)