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 -------------------------------------------------------------------------------
11 License
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 
51 namespace Foam
52 {
53 namespace regionModels
54 {
55 namespace surfaceFilmModels
56 {
57 
58 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
59 
60 defineTypeNameAndDebug(thermoSingleLayer, 0);
61 
62 addToRunTimeSelectionTable(surfaceFilmRegionModel, thermoSingleLayer, mesh);
63 
64 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
65 
66 wordList thermoSingleLayer::hsBoundaryTypes()
67 {
68  wordList bTypes(T_.boundaryField().types());
69  forAll(bTypes, patchi)
70  {
71  if
72  (
73  T_.boundaryField()[patchi].fixesValue()
74  || isA<mixedFvPatchScalarField>(T_.boundaryField()[patchi])
75  || isA<mappedFieldFvPatchField<scalar>>(T_.boundaryField()[patchi])
76  )
77  {
79  }
80  }
81 
82  return bTypes;
83 }
84 
85 
86 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
87 
89 {
90  // No additional properties to read
92 }
93 
94 
96 {
98 
100 
102 }
103 
104 
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];
124  {
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_;
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
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
218  {
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  (
241  time_.deltaTValue(),
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 
311 thermoSingleLayer::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  (
324  IOobject
325  (
326  "Cp",
327  regionMesh().time().timeName(),
328  regionMesh().thisDb(),
329  IOobject::NO_READ,
330  IOobject::AUTO_WRITE
331  ),
332  regionMesh(),
335  ),
336  kappa_
337  (
338  IOobject
339  (
340  "kappa",
341  regionMesh().time().timeName(),
342  regionMesh().thisDb(),
343  IOobject::NO_READ,
344  IOobject::AUTO_WRITE
345  ),
346  regionMesh(),
349  ),
350 
351  T_
352  (
353  IOobject
354  (
355  "Tf",
356  regionMesh().time().timeName(),
357  regionMesh().thisDb(),
358  IOobject::MUST_READ,
359  IOobject::AUTO_WRITE
360  ),
361  regionMesh()
362  ),
363  Ts_
364  (
365  IOobject
366  (
367  "Tsf",
368  regionMesh().time().timeName(),
369  regionMesh().thisDb(),
370  IOobject::NO_READ,
371  IOobject::NO_WRITE
372  ),
373  T_,
375  ),
376  Tw_
377  (
378  IOobject
379  (
380  "Twf",
381  regionMesh().time().timeName(),
382  regionMesh().thisDb(),
383  IOobject::NO_READ,
384  IOobject::NO_WRITE
385  ),
386  T_,
388  ),
389  hs_
390  (
391  IOobject
392  (
393  "hf",
394  regionMesh().time().timeName(),
395  regionMesh().thisDb(),
396  IOobject::NO_READ,
397  IOobject::NO_WRITE
398  ),
399  regionMesh(),
401  hsBoundaryTypes()
402  ),
403 
404  primaryEnergyTrans_
405  (
406  IOobject
407  (
408  "primaryEnergyTrans",
409  regionMesh().time().timeName(),
410  regionMesh().thisDb(),
411  IOobject::NO_READ,
412  IOobject::NO_WRITE
413  ),
414  regionMesh(),
417  ),
418 
419  deltaWet_(coeffs_.get<scalar>("deltaWet")),
420  hydrophilic_(coeffs_.get<bool>("hydrophilic")),
421  hydrophilicDryScale_(0.0),
422  hydrophilicWetScale_(0.0),
423 
424  hsSp_
425  (
426  IOobject
427  (
428  "hsSp",
429  regionMesh().time().timeName(),
430  regionMesh().thisDb(),
431  IOobject::NO_READ,
432  IOobject::NO_WRITE
433  ),
434  regionMesh(),
436  this->mappedPushedFieldPatchTypes<scalar>()
437  ),
438 
439  hsSpPrimary_
440  (
441  IOobject
442  (
443  hsSp_.name(), // Must have same name as hSp_ to enable mapping
444  primaryMesh().time().timeName(),
445  primaryMesh().thisDb(),
446  IOobject::NO_READ,
447  IOobject::NO_WRITE
448  ),
449  primaryMesh(),
450  dimensionedScalar(hsSp_.dimensions(), Zero)
451  ),
452 
453  TPrimary_
454  (
455  IOobject
456  (
457  "T", // Same name as T on primary region to enable mapping
458  regionMesh().time().timeName(),
459  regionMesh().thisDb(),
460  IOobject::NO_READ,
461  IOobject::NO_WRITE
462  ),
463  regionMesh(),
465  this->mappedFieldAndInternalPatchTypes<scalar>()
466  ),
467 
468  YPrimary_(),
469 
470  viscosity_(filmViscosityModel::New(*this, coeffs(), mu_)),
471  htcs_
472  (
473  heatTransferModel::New(*this, coeffs().subDict("upperSurfaceModels"))
474  ),
475  htcw_
476  (
477  heatTransferModel::New(*this, coeffs().subDict("lowerSurfaceModels"))
478  ),
479  phaseChange_(phaseChangeModel::New(*this, coeffs())),
480  radiation_(filmRadiationModel::New(*this, coeffs())),
481  withTbounds_(limitType::CLAMP_NONE),
482  Tbounds_(0, 5000)
483 {
484  unsigned userLimits(limitType::CLAMP_NONE);
485 
486  if (coeffs().readIfPresent("Tmin", Tbounds_.min()))
487  {
488  userLimits |= limitType::CLAMP_MIN;
489  Info<< " limiting minimum temperature to " << Tbounds_.min() << nl;
490  }
491 
492  if (coeffs().readIfPresent("Tmax", Tbounds_.max()))
493  {
494  userLimits |= limitType::CLAMP_MAX;
495  Info<< " limiting maximum temperature to " << Tbounds_.max() << nl;
496  }
497  withTbounds_ = limitType(userLimits);
498 
500  {
501  YPrimary_.setSize(thermo_.carrier().species().size());
502 
503  forAll(thermo_.carrier().species(), i)
504  {
505  YPrimary_.set
506  (
507  i,
508  new volScalarField
509  (
510  IOobject
511  (
512  thermo_.carrier().species()[i],
513  regionMesh().time().timeName(),
514  regionMesh().thisDb(),
517  ),
518  regionMesh(),
521  )
522  );
523  }
524  }
525 
526  if (hydrophilic_)
527  {
528  coeffs_.readEntry("hydrophilicDryScale", hydrophilicDryScale_);
529  coeffs_.readEntry("hydrophilicWetScale", hydrophilicWetScale_);
530  }
531 
532  if (readFields)
533  {
535 
536  correctAlpha();
537 
539 
540  // Update derived fields
541  hs_ == hs(T_);
542 
543  deltaRho_ == delta_*rho_;
544 
546  (
547  IOobject
548  (
549  "phi",
550  regionMesh().time().timeName(),
551  regionMesh().thisDb(),
555  ),
557  );
558 
559  phi_ == phi0;
560 
561  // Evaluate viscosity from user-model
562  viscosity_->correct(pPrimary_, T_);
563  }
564 }
565 
566 
567 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
568 
570 {}
571 
572 
573 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
574 
576 (
577  const label patchi,
578  const label facei,
579  const scalar massSource,
580  const vector& momentumSource,
581  const scalar pressureSource,
582  const scalar energySource
583 )
584 {
586  (
587  patchi,
588  facei,
589  massSource,
590  momentumSource,
591  pressureSource,
592  energySource
593  );
594 
596  << " energy = " << energySource << nl << nl;
597 
598  hsSpPrimary_.boundaryFieldRef()[patchi][facei] -= energySource;
599 }
600 
601 
603 {
605 
608 }
609 
610 
612 {
614 
615  // Solve continuity for deltaRho_
616  solveContinuity();
617 
618  // Update sub-models to provide updated source contributions
619  updateSubmodels();
620 
621  // Solve continuity for deltaRho_
622  solveContinuity();
623 
624  for (int oCorr=1; oCorr<=nOuterCorr_; oCorr++)
625  {
626  // Explicit pressure source contribution
627  tmp<volScalarField> tpu(this->pu());
628 
629  // Implicit pressure source coefficient
630  tmp<volScalarField> tpp(this->pp());
631 
632  // Solve for momentum for U_
633  tmp<fvVectorMatrix> tUEqn = solveMomentum(tpu(), tpp());
634  fvVectorMatrix& UEqn = tUEqn.ref();
635 
636  // Solve energy for hs_ - also updates thermo
637  solveEnergy();
638 
639  // Film thickness correction loop
640  for (int corr=1; corr<=nCorr_; corr++)
641  {
642  // Solve thickness for delta_
643  solveThickness(tpu(), tpp(), UEqn);
644  }
645  }
646 
647  // Update deltaRho_ with new delta_
649 
650  // Update temperature using latest hs_
651  T_ == T(hs_);
652 }
653 
656 {
657  return Cp_;
658 }
659 
662 {
663  return kappa_;
664 }
665 
668 {
669  return T_;
670 }
671 
674 {
675  return Ts_;
676 }
677 
680 {
681  return Tw_;
682 }
683 
686 {
687  return hs_;
688 }
689 
690 
692 {
694 
695  const scalarField& Tinternal = T_;
696 
697  Info<< indent << "min/mean/max(T) = "
698  << gMin(Tinternal) << ", "
699  << gAverage(Tinternal) << ", "
700  << gMax(Tinternal) << nl;
701 
702  phaseChange_->info(Info);
703 }
704 
705 
707 {
709  (
711  (
712  IOobject
713  (
714  typeName + ":Srho",
715  time().timeName(),
716  primaryMesh(),
720  ),
721  primaryMesh(),
723  )
724  );
725 
726  scalarField& Srho = tSrho.ref();
727  const scalarField& V = primaryMesh().V();
728  const scalar dt = time_.deltaTValue();
729 
731  {
732  const label filmPatchi = intCoupledPatchIDs()[i];
733 
734  scalarField patchMass =
735  primaryMassTrans_.boundaryField()[filmPatchi];
736 
737  toPrimary(filmPatchi, patchMass);
738 
739  const label primaryPatchi = primaryPatchIDs()[i];
740  const labelUList& cells =
741  primaryMesh().boundaryMesh()[primaryPatchi].faceCells();
742 
743  forAll(patchMass, j)
744  {
745  Srho[cells[j]] += patchMass[j]/(V[cells[j]]*dt);
746  }
747  }
748 
749  return tSrho;
750 }
751 
752 
754 (
755  const label i
756 ) const
757 {
758  const label vapId = thermo_.carrierId(filmThermo_->name());
759 
761  (
763  (
764  IOobject
765  (
766  typeName + ":Srho(" + Foam::name(i) + ")",
767  time_.timeName(),
768  primaryMesh(),
772  ),
773  primaryMesh(),
775  )
776  );
777 
778  if (vapId == i)
779  {
780  scalarField& Srho = tSrho.ref();
781  const scalarField& V = primaryMesh().V();
782  const scalar dt = time().deltaTValue();
783 
785  {
786  const label filmPatchi = intCoupledPatchIDs_[i];
787 
788  scalarField patchMass =
789  primaryMassTrans_.boundaryField()[filmPatchi];
790 
791  toPrimary(filmPatchi, patchMass);
792 
793  const label primaryPatchi = primaryPatchIDs()[i];
794  const labelUList& cells =
795  primaryMesh().boundaryMesh()[primaryPatchi].faceCells();
796 
797  forAll(patchMass, j)
798  {
799  Srho[cells[j]] += patchMass[j]/(V[cells[j]]*dt);
800  }
801  }
802  }
803 
804  return tSrho;
805 }
806 
807 
809 {
811  (
813  (
814  IOobject
815  (
816  typeName + ":Sh",
817  time().timeName(),
818  primaryMesh(),
822  ),
823  primaryMesh(),
825  )
826  );
827 
828  scalarField& Sh = tSh.ref();
829  const scalarField& V = primaryMesh().V();
830  const scalar dt = time_.deltaTValue();
831 
833  {
834  const label filmPatchi = intCoupledPatchIDs_[i];
835 
836  scalarField patchEnergy =
837  primaryEnergyTrans_.boundaryField()[filmPatchi];
838 
839  toPrimary(filmPatchi, patchEnergy);
840 
841  const label primaryPatchi = primaryPatchIDs()[i];
842  const labelUList& cells =
843  primaryMesh().boundaryMesh()[primaryPatchi].faceCells();
844 
845  forAll(patchEnergy, j)
846  {
847  Sh[cells[j]] += patchEnergy[j]/(V[cells[j]]*dt);
848  }
849  }
850 
851  return tSh;
852 }
853 
854 
855 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
856 
857 } // End namespace Foam
858 } // End namespace regionModels
859 } // End namespace surfaceFilmModels
860 
861 // ************************************************************************* //
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.
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.
autoPtr< phaseChangeModel > phaseChange_
Phase change.
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:116
virtual const volScalarField & Cp() const
Return the film specific heat capacity [J/kg/K].
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.
Definition: Ostream.H:493
scalar deltaTValue() const noexcept
Return time step value.
Definition: TimeStateI.H:49
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)
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
Definition: tmpI.H:235
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
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.
Definition: Ostream.H:531
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.
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.
Definition: fvPatchField.H:77
bool hasMultiComponentCarrier() const
Thermo database has multi-component carrier flag.
Definition: SLGThermo.C:219
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.
Definition: regionModelI.H:90
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.
Definition: fvMesh.H:360
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.
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.
Definition: fvMesh.H:376
Base class for surface film phase change models.
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:421
const labelList & intCoupledPatchIDs() const noexcept
List of patch IDs internally coupled with the primary region.
Definition: regionModelI.H:97
virtual void transferPrimaryRegionSourceFields()
Transfer source fields from the primary region to the film region.
Calculate the first temporal derivative.
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.
Definition: Field.H:86
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.
word timeName
Definition: getTimeIndex.H:3
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:58
void toPrimary(const label regionPatchi, List< Type > &regionField) const
Convert a local region field to the primary region.
const T & min() const noexcept
The min value (first)
Definition: MinMaxI.H:107
virtual void updateSubmodels()
Update the film sub-models.
UPtrList< const labelUList > faceCells() const
Return a list of faceCells for each patch.
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
dynamicFvMesh & mesh
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
Base class for surface film viscosity models.
const cellShapeList & cells
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.
scalar hydrophilicDryScale_
Length scale applied to deltaWet_ to determine when a wet.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
Definition: polyMesh.H:608
A class for handling words, derived from Foam::string.
Definition: word.H:63
Calculate the face-flux of the given field.
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:52
#define DebugInFunction
Report an information message using Foam::Info.
Calculate the laplacian of the given field.
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvmDdt.C:41
const dictionary & coeffs() const noexcept
Return the model coefficients dictionary.
Definition: regionModel.H:274
volScalarField kappa_
Thermal conductivity [W/m/K].
Reading is optional [identical to LAZY_READ].
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:26
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.
Definition: fvPatchField.H:64
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package, and provides:
Definition: SLGThermo.H:60
scalar hydrophilicWetScale_
Length scale applied to deltaWet_ to determine when a dry.
virtual const volScalarField & Ts() const
Return the film surface temperature [K].
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.
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.
Definition: Time.C:714
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvmDiv.C:41
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...
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.
Definition: regionModel.H:117
const basicSpecieMixture & carrier() const
Return reference to the gaseous components.
Definition: SLGThermo.C:104
virtual bool read()
Read control parameters from dictionary.
List< word > wordList
List of word.
Definition: fileName.H:59
label carrierId(const word &cmptName, bool allowNotFound=false) const
Index of carrier component.
Definition: SLGThermo.C:144
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
scalar deltaWet_
Threshold film thickness beyond which the film is considered &#39;wet&#39;.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:50
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.
Definition: regionModel.H:97
surfaceScalarField phi_
Mass flux (includes film thickness) [kg.m/s].
fvVectorMatrix & UEqn
Definition: UEqn.H:13
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
volScalarField alpha_
Film coverage indicator, 1 = covered, 0 = uncovered [].
A List with indirect addressing. Like IndirectList but does not store addressing. ...
Definition: faMatrix.H:56
virtual void preEvolveRegion()
Pre-evolve film hook.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
Nothing to be read.
PtrList< volScalarField > YPrimary_
List of specie mass fractions [0-1].
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
const T & max() const noexcept
The max value (second)
Definition: MinMaxI.H:121
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)
Check if dynamic_cast to Type is possible.
Definition: typeInfo.H:88
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)
Definition: dimensionSets.H:49
const fvMesh & primaryMesh() const noexcept
Return the reference to the primary mesh database.
Definition: regionModel.H:239
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
Definition: regionModel.H:135
A class for managing temporary objects.
Definition: HashPtrTable.H:50
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:69
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172
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.
Definition: regionModel.H:244
const dimensionSet dimArea(sqr(dimLength))
Definition: dimensionSets.H:57
Namespace for OpenFOAM.
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)
Definition: zero.H:127
virtual const volScalarField & Tw() const
Return the film wall temperature [K].