Loading...
Searching...
No Matches
thermoSingleLayer.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2017-2023 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29#include "thermoSingleLayer.H"
30#include "fvcDdt.H"
31#include "fvcDiv.H"
32#include "fvcLaplacian.H"
33#include "fvcFlux.H"
34#include "fvm.H"
36#include "mixedFvPatchFields.H"
38#include "mapDistribute.H"
39#include "constants.H"
41
42// Sub-models
43#include "filmThermoModel.H"
44#include "filmViscosityModel.H"
45#include "heatTransferModel.H"
46#include "phaseChangeModel.H"
47#include "filmRadiationModel.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
53namespace regionModels
54{
56{
57
58// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
59
61
63
64// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
65
66wordList thermoSingleLayer::hsBoundaryTypes()
67{
68 wordList bTypes(T_.boundaryField().types());
69 forAll(bTypes, patchi)
70 {
71 if
72 (
73 T_.boundaryField()[patchi].fixesValue()
76 )
77 {
79 }
80 }
82 return bTypes;
83}
84
85
86// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
87
89{
90 // No additional properties to read
92}
93
94
96{
106{
107 rho_ == filmThermo_->rho();
108 sigma_ == filmThermo_->sigma();
109 Cp_ == filmThermo_->Cp();
110 kappa_ == filmThermo_->kappa();
111}
112
113
115{
117
119
120 forAll(hsBf, patchi)
121 {
122 const fvPatchField<scalar>& Tp = T_.boundaryField()[patchi];
125 hsBf[patchi] == hs(Tp, patchi);
126 }
127 }
128}
129
130
132{
134
135 // Push boundary film temperature into wall temperature internal field
136 for (label i=0; i<intCoupledPatchIDs_.size(); i++)
137 {
138 label patchi = intCoupledPatchIDs_[i];
139 const polyPatch& pp = regionMesh().boundaryMesh()[patchi];
140 UIndirectList<scalar>(Tw_, pp.faceCells()) =
141 T_.boundaryField()[patchi];
142 }
145 // Update film surface temperature
146 Ts_ = T_;
147 Ts_.correctBoundaryConditions();
148}
149
150
152{
154
156
157 // Update primary region fields on local region via direct mapped (coupled)
158 // boundary conditions
161 {
162 YPrimary_[i].correctBoundaryConditions();
163 }
164}
165
166
168{
170
172
173 volScalarField::Boundary& hsSpPrimaryBf =
175
176 // Convert accumulated source terms into per unit area per unit time
177 const scalar deltaT = time_.deltaTValue();
178 forAll(hsSpPrimaryBf, patchi)
179 {
180 scalarField rpriMagSfdeltaT
181 (
182 (1.0/deltaT)/primaryMesh().magSf().boundaryField()[patchi]
183 );
184
185 hsSpPrimaryBf[patchi] *= rpriMagSfdeltaT;
186 }
187
188 // Retrieve the source fields from the primary region via direct mapped
189 // (coupled) boundary conditions
190 // - fields require transfer of values for both patch AND to push the
191 // values into the first layer of internal cells
192 hsSp_.correctBoundaryConditions();
193}
194
195
197{
198 if (hydrophilic_)
199 {
200 const scalar hydrophilicDry = hydrophilicDryScale_*deltaWet_;
201 const scalar hydrophilicWet = hydrophilicWetScale_*deltaWet_;
202
203 forAll(alpha_, i)
204 {
205 if ((alpha_[i] < 0.5) && (delta_[i] > hydrophilicWet))
206 {
207 alpha_[i] = 1.0;
208 }
209 else if ((alpha_[i] > 0.5) && (delta_[i] < hydrophilicDry))
210 {
211 alpha_[i] = 0.0;
212 }
213 }
214
216 }
217 else
219 alpha_ ==
221 }
222}
223
224
226{
228
229 // Update heat transfer coefficient sub-models
230 htcs_->correct();
231 htcw_->correct();
232
233 // Update radiation
234 radiation_->correct();
235
236 // Update injection model - mass returned is mass available for injection
238
239 phaseChange_->correct
240 (
245 );
246
247 const volScalarField rMagSfDt((1/time().deltaT())/magSf());
248
249 // Vapour recoil pressure
250 pSp_ -= sqr(rMagSfDt*primaryMassTrans_)/(2*rhoPrimary_);
251
252 // Update transfer model - mass returned is mass available for transfer
254
255 // Update source fields
258
259 turbulence_->correct();
260}
261
262
264{
265 return
266 (
267 // Heat-transfer to the primary region
268 - fvm::Sp(htcs_->h()/Cp_, hs)
269 + htcs_->h()*(hs/Cp_ + alpha_*(TPrimary_ - T_))
270
271 // Heat-transfer to the wall
272 - fvm::Sp(htcw_->h()/Cp_, hs)
273 + htcw_->h()*(hs/Cp_ + alpha_*(Tw_- T_))
274 );
275}
276
277
279{
281
282 dimensionedScalar residualDeltaRho
283 (
284 "residualDeltaRho",
286 1e-10
287 );
288
289 solve
290 (
292 + fvm::div(phi_, hs_)
293 ==
294 - hsSp_
295 + q(hs_)
296 + radiation_->Shs()
297 );
298
300
301 // Evaluate viscosity from user-model
302 viscosity_->correct(pPrimary_, T_);
303
304 // Update film wall and surface temperatures
306}
307
308
309// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
310
311thermoSingleLayer::thermoSingleLayer
312(
313 const word& modelType,
314 const fvMesh& mesh,
315 const dimensionedVector& g,
316 const word& regionType,
317 const bool readFields
318)
319:
320 kinematicSingleLayer(modelType, mesh, g, regionType, false),
321 thermo_(mesh.lookupObject<SLGThermo>("SLGThermo")),
322 Cp_
323 (
325 (
326 "Cp",
327 regionMesh().time().timeName(),
328 regionMesh().thisDb(),
329 IOobject::NO_READ,
330 IOobject::AUTO_WRITE,
331 IOobject::REGISTER
332 ),
333 regionMesh(),
335 fvPatchFieldBase::zeroGradientType()
336 ),
337 kappa_
338 (
340 (
341 "kappa",
342 regionMesh().time().timeName(),
343 regionMesh().thisDb(),
344 IOobject::NO_READ,
345 IOobject::AUTO_WRITE,
346 IOobject::REGISTER
347 ),
348 regionMesh(),
350 fvPatchFieldBase::zeroGradientType()
351 ),
352
353 T_
354 (
356 (
357 "Tf",
358 regionMesh().time().timeName(),
359 regionMesh().thisDb(),
360 IOobject::MUST_READ,
361 IOobject::AUTO_WRITE,
362 IOobject::REGISTER
363 ),
364 regionMesh()
365 ),
366 Ts_
367 (
369 (
370 "Tsf",
371 regionMesh().time().timeName(),
372 regionMesh().thisDb(),
373 IOobject::NO_READ,
374 IOobject::NO_WRITE
375 ),
376 T_,
377 fvPatchFieldBase::zeroGradientType()
378 ),
379 Tw_
380 (
382 (
383 "Twf",
384 regionMesh().time().timeName(),
385 regionMesh().thisDb(),
386 IOobject::NO_READ,
387 IOobject::NO_WRITE
388 ),
389 T_,
390 fvPatchFieldBase::zeroGradientType()
391 ),
392 hs_
393 (
395 (
396 "hf",
397 regionMesh().time().timeName(),
398 regionMesh().thisDb(),
399 IOobject::NO_READ,
400 IOobject::NO_WRITE
401 ),
402 regionMesh(),
404 hsBoundaryTypes()
405 ),
406
407 primaryEnergyTrans_
408 (
410 (
411 "primaryEnergyTrans",
412 regionMesh().time().timeName(),
413 regionMesh().thisDb(),
414 IOobject::NO_READ,
415 IOobject::NO_WRITE
416 ),
417 regionMesh(),
419 fvPatchFieldBase::zeroGradientType()
420 ),
421
422 deltaWet_(coeffs_.get<scalar>("deltaWet")),
423 hydrophilic_(coeffs_.get<bool>("hydrophilic")),
424 hydrophilicDryScale_(0.0),
425 hydrophilicWetScale_(0.0),
426
427 hsSp_
428 (
430 (
431 "hsSp",
432 regionMesh().time().timeName(),
433 regionMesh().thisDb(),
434 IOobject::NO_READ,
435 IOobject::NO_WRITE
436 ),
437 regionMesh(),
439 this->mappedPushedFieldPatchTypes<scalar>()
440 ),
441
442 hsSpPrimary_
443 (
445 (
446 hsSp_.name(), // Must have same name as hSp_ to enable mapping
447 primaryMesh().time().timeName(),
448 primaryMesh().thisDb(),
449 IOobject::NO_READ,
450 IOobject::NO_WRITE
451 ),
452 primaryMesh(),
453 dimensionedScalar(hsSp_.dimensions(), Zero)
454 ),
455
456 TPrimary_
457 (
459 (
460 "T", // Same name as T on primary region to enable mapping
461 regionMesh().time().timeName(),
462 regionMesh().thisDb(),
463 IOobject::NO_READ,
464 IOobject::NO_WRITE
465 ),
466 regionMesh(),
468 this->mappedFieldAndInternalPatchTypes<scalar>()
469 ),
470
471 YPrimary_(),
472
473 viscosity_(filmViscosityModel::New(*this, coeffs(), mu_)),
474 htcs_
475 (
476 heatTransferModel::New(*this, coeffs().subDict("upperSurfaceModels"))
477 ),
478 htcw_
479 (
480 heatTransferModel::New(*this, coeffs().subDict("lowerSurfaceModels"))
481 ),
482 phaseChange_(phaseChangeModel::New(*this, coeffs())),
483 radiation_(filmRadiationModel::New(*this, coeffs())),
484 withTbounds_(limitType::CLAMP_NONE),
485 Tbounds_(0, 5000)
486{
487 unsigned userLimits(limitType::CLAMP_NONE);
488
489 if (coeffs().readIfPresent("Tmin", Tbounds_.min()))
490 {
491 userLimits |= limitType::CLAMP_MIN;
492 Info<< " limiting minimum temperature to " << Tbounds_.min() << nl;
493 }
494
495 if (coeffs().readIfPresent("Tmax", Tbounds_.max()))
496 {
497 userLimits |= limitType::CLAMP_MAX;
498 Info<< " limiting maximum temperature to " << Tbounds_.max() << nl;
499 }
500 withTbounds_ = limitType(userLimits);
501
503 {
504 YPrimary_.setSize(thermo_.carrier().species().size());
505
507 {
508 YPrimary_.set
509 (
510 i,
512 (
514 (
515 thermo_.carrier().species()[i],
517 regionMesh().thisDb(),
520 ),
521 regionMesh(),
524 )
525 );
526 }
527 }
528
529 if (hydrophilic_)
530 {
531 coeffs_.readEntry("hydrophilicDryScale", hydrophilicDryScale_);
532 coeffs_.readEntry("hydrophilicWetScale", hydrophilicWetScale_);
533 }
534
535 if (readFields)
536 {
538
539 correctAlpha();
540
542
543 // Update derived fields
544 hs_ == hs(T_);
545
547
549 (
550 IOobject
551 (
552 "phi",
554 regionMesh().thisDb(),
558 ),
560 );
561
562 phi_ == phi0;
563
564 // Evaluate viscosity from user-model
566 }
567}
568
569
570// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
573{}
574
575
576// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
577
579(
580 const label patchi,
581 const label facei,
582 const scalar massSource,
583 const vector& momentumSource,
584 const scalar pressureSource,
585 const scalar energySource
586)
587{
589 (
590 patchi,
591 facei,
592 massSource,
593 momentumSource,
594 pressureSource,
595 energySource
596 );
597
599 << " energy = " << energySource << nl << nl;
600
601 hsSpPrimary_.boundaryFieldRef()[patchi][facei] -= energySource;
602}
603
604
606{
608
611}
612
613
615{
617
618 // Solve continuity for deltaRho_
620
621 // Update sub-models to provide updated source contributions
623
624 // Solve continuity for deltaRho_
626
627 for (int oCorr=1; oCorr<=nOuterCorr_; oCorr++)
628 {
629 // Explicit pressure source contribution
630 tmp<volScalarField> tpu(this->pu());
631
632 // Implicit pressure source coefficient
633 tmp<volScalarField> tpp(this->pp());
634
635 // Solve for momentum for U_
637 fvVectorMatrix& UEqn = tUEqn.ref();
638
639 // Solve energy for hs_ - also updates thermo
640 solveEnergy();
641
642 // Film thickness correction loop
643 for (int corr=1; corr<=nCorr_; corr++)
644 {
645 // Solve thickness for delta_
646 solveThickness(tpu(), tpp(), UEqn);
647 }
648 }
649
650 // Update deltaRho_ with new delta_
652
653 // Update temperature using latest hs_
654 T_ == T(hs_);
655}
656
659{
660 return Cp_;
661}
662
665{
666 return kappa_;
667}
668
671{
672 return T_;
673}
674
677{
678 return Ts_;
679}
680
683{
684 return Tw_;
685}
686
689{
690 return hs_;
691}
692
693
695{
697
698 const scalarField& Tinternal = T_;
699
700 auto limits = gMinMax(Tinternal);
701 auto avg = gAverage(Tinternal);
702
703 Info<< indent << "min/mean/max(T) = "
704 << limits.min() << ", " << avg << ", " << limits.max() << nl;
705
706 phaseChange_->info(Info);
707}
708
709
711{
713 (
716 primaryMesh(),
718 );
719 scalarField& Srho = tSrho.ref();
720
721 const scalarField& V = primaryMesh().V();
722 const scalar dt = time_.deltaTValue();
723
725 {
726 const label filmPatchi = intCoupledPatchIDs()[i];
727 const label primaryPatchi = primaryPatchIDs()[i];
728
729 scalarField patchMass =
730 primaryMassTrans_.boundaryField()[filmPatchi];
731
732 toPrimary(filmPatchi, patchMass);
733
734 const labelUList& cells =
735 primaryMesh().boundaryMesh()[primaryPatchi].faceCells();
736
737 forAll(patchMass, j)
738 {
739 Srho[cells[j]] += patchMass[j]/(V[cells[j]]*dt);
741 }
742
743 return tSrho;
744}
745
746
748(
749 const label i
750) const
751{
752 const label vapId = thermo_.carrierId(filmThermo_->name());
753
755 (
756 IOobject::scopedName(typeName, "Srho(" + Foam::name(i) + ")"),
758 primaryMesh(),
760 );
761 scalarField& Srho = tSrho.ref();
762
763 if (vapId == i)
764 {
765 const scalarField& V = primaryMesh().V();
766 const scalar dt = time().deltaTValue();
767
769 {
770 const label filmPatchi = intCoupledPatchIDs_[i];
771 const label primaryPatchi = primaryPatchIDs()[i];
772
773 scalarField patchMass =
774 primaryMassTrans_.boundaryField()[filmPatchi];
775
776 toPrimary(filmPatchi, patchMass);
777
778 const labelUList& cells =
779 primaryMesh().boundaryMesh()[primaryPatchi].faceCells();
780
781 forAll(patchMass, j)
782 {
783 Srho[cells[j]] += patchMass[j]/(V[cells[j]]*dt);
784 }
786 }
787
788 return tSrho;
789}
790
791
793{
795 (
798 primaryMesh(),
800 );
801 scalarField& Sh = tSh.ref();
802
803 const scalarField& V = primaryMesh().V();
804 const scalar dt = time_.deltaTValue();
805
807 {
808 const label filmPatchi = intCoupledPatchIDs_[i];
809 const label primaryPatchi = primaryPatchIDs()[i];
810
811 scalarField patchEnergy =
813
814 toPrimary(filmPatchi, patchEnergy);
815
816 const labelUList& cells =
817 primaryMesh().boundaryMesh()[primaryPatchi].faceCells();
818
819 forAll(patchEnergy, j)
820 {
821 Sh[cells[j]] += patchEnergy[j]/(V[cells[j]]*dt);
822 }
823 }
824
825 return tSh;
826}
827
828
829// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
830
831} // End namespace Foam
832} // End namespace regionModels
833} // End namespace surfaceFilmModels
834
835// ************************************************************************* //
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.
Definition Field.H:93
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,...
Definition IOobject.H:191
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
Definition IOobjectI.H:50
const T & max() const noexcept
The max value.
Definition MinMax.H:217
const T & min() const noexcept
The min value.
Definition MinMax.H:207
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
Definition SLGThermo.H:63
label carrierId(const word &cmptName, bool allowNotFound=false) const
Index of carrier component.
Definition SLGThermo.C:144
const basicSpecieMixture & carrier() const
Return reference to the gaseous components.
Definition SLGThermo.C:104
bool hasMultiComponentCarrier() const
Thermo database has multi-component carrier flag.
Definition SLGThermo.C:219
scalar deltaTValue() const noexcept
Return time step value.
Definition TimeStateI.H:49
A List with indirect addressing. Like IndirectList but does not store addressing.
void size(const label n)
Older name for setAddressableSize.
Definition UList.H:118
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.
Definition dictionary.C:441
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.
Definition fvMesh.H:85
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.
Definition polyMesh.H:609
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
const Time & time_
Reference to the time database.
Definition regionModel.H:97
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 > &regionField) 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 &regionType="surfaceFilm")
Return a reference to the selected surface film model.
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.
virtual void transferPrimaryRegionThermoFields()
Transfer thermo fields from the primary region to the film region.
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 deltaRho_
Film thickness*density (helper field) [kg/m2].
volScalarField cloudDiameterTrans_
Parcel diameters originating from film to cloud.
transferModelList transfer_
Transfer with the continuous phase.
virtual void resetPrimaryRegionSourceTerms()
Reset source term fields.
surfaceScalarField phi_
Mass flux (includes film thickness) [kg.m/s].
virtual tmp< fvVectorMatrix > solveMomentum(const volScalarField &pu, const volScalarField &pp)
Solve for film velocity.
virtual tmp< volScalarField > pp()
Implicit pressure source coefficient.
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 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.
const dimensionedVector & g() const
Return the acceleration due to gravity.
Thermodynamic form of single-cell layer surface film model.
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.
virtual const volScalarField & kappa() const
Return the film thermal conductivity [W/m/K].
virtual const volScalarField & T() const
Return the film mean temperature [K].
virtual const volScalarField & Ts() const
Return the film surface temperature [K].
volScalarField Cp_
Specific heat capacity [J/kg/K].
scalar hydrophilicWetScale_
Length scale applied to deltaWet_ to determine when a dry.
virtual const volScalarField & Tw() const
Return the film wall temperature [K].
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'.
virtual void correctAlpha()
Correct film coverage field.
PtrList< volScalarField > YPrimary_
List of specie mass fractions [0-1].
scalar hydrophilicDryScale_
Length scale applied to deltaWet_ to determine when a wet.
virtual void correctThermoFields()
Correct the thermo fields.
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.
autoPtr< phaseChangeModel > phaseChange_
Phase change.
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.
virtual void correct(scalarField &availableMass, volScalarField &massToTransfer)
Correct kinematic transfers.
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
fvVectorMatrix & UEqn
Definition UEqn.H:13
auto limits
Definition setRDeltaT.H:186
dynamicFvMesh & mesh
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.
const cellShapeList & cells
word timeName
Definition getTimeIndex.H:3
#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.
Definition fvcFlux.C:27
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition fvmDiv.C:41
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition fvmDdt.C:41
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
Namespace for OpenFOAM.
Type gAverage(const FieldField< Field, Type > &f, const label comm)
The global arithmetic average of a FieldField.
List< word > wordList
List of word.
Definition fileName.H:60
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.
Definition Ostream.H:519
Ostream & indent(Ostream &os)
Indent stream.
Definition Ostream.H:481
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
Definition typeInfo.H:87
fvMatrix< vector > fvVectorMatrix
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
const dimensionSet dimVolume(pow3(dimLength))
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Vector< scalar > vector
Definition vector.H:57
UList< label > labelUList
A UList of labels.
Definition UList.H:75
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).
Definition Ostream.H:50
CEqn solve()
volScalarField & e
#define forAll(list, i)
Loop across all elements in list.
Definition stdFoam.H:299