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 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  {
78  bTypes[patchi] = fixedValueFvPatchField<scalar>::typeName;
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 {
97  if (debug)
98  {
100  }
101 
103 
104  hsSpPrimary_ == dimensionedScalar(hsSp_.dimensions(), Zero);
105 }
106 
107 
109 {
110  rho_ == filmThermo_->rho();
111  sigma_ == filmThermo_->sigma();
112  Cp_ == filmThermo_->Cp();
113  kappa_ == filmThermo_->kappa();
114 }
115 
116 
118 {
120 
121  volScalarField::Boundary& hsBf = hs_.boundaryFieldRef();
122 
123  forAll(hsBf, patchi)
124  {
125  const fvPatchField<scalar>& Tp = T_.boundaryField()[patchi];
127  {
128  hsBf[patchi] == hs(Tp, patchi);
129  }
130  }
131 }
132 
133 
135 {
137 
138  // Push boundary film temperature into wall temperature internal field
139  for (label i=0; i<intCoupledPatchIDs_.size(); i++)
140  {
141  label patchi = intCoupledPatchIDs_[i];
142  const polyPatch& pp = regionMesh().boundaryMesh()[patchi];
143  UIndirectList<scalar>(Tw_, pp.faceCells()) =
144  T_.boundaryField()[patchi];
145  }
147 
148  // Update film surface temperature
149  Ts_ = T_;
151 }
152 
153 
155 {
156  if (debug)
157  {
158  InfoInFunction << endl;
159  }
160 
162 
163  // Update primary region fields on local region via direct mapped (coupled)
164  // boundary conditions
166  forAll(YPrimary_, i)
167  {
168  YPrimary_[i].correctBoundaryConditions();
169  }
170 }
171 
172 
174 {
175  if (debug)
176  {
177  InfoInFunction << endl;
178  }
179 
181 
182  volScalarField::Boundary& hsSpPrimaryBf =
184 
185  // Convert accumulated source terms into per unit area per unit time
186  const scalar deltaT = time_.deltaTValue();
187  forAll(hsSpPrimaryBf, patchi)
188  {
189  scalarField rpriMagSfdeltaT
190  (
191  (1.0/deltaT)/primaryMesh().magSf().boundaryField()[patchi]
192  );
193 
194  hsSpPrimaryBf[patchi] *= rpriMagSfdeltaT;
195  }
196 
197  // Retrieve the source fields from the primary region via direct mapped
198  // (coupled) boundary conditions
199  // - fields require transfer of values for both patch AND to push the
200  // values into the first layer of internal cells
202 }
203 
204 
206 {
207  if (hydrophilic_)
208  {
209  const scalar hydrophilicDry = hydrophilicDryScale_*deltaWet_;
210  const scalar hydrophilicWet = hydrophilicWetScale_*deltaWet_;
211 
212  forAll(alpha_, i)
213  {
214  if ((alpha_[i] < 0.5) && (delta_[i] > hydrophilicWet))
215  {
216  alpha_[i] = 1.0;
217  }
218  else if ((alpha_[i] > 0.5) && (delta_[i] < hydrophilicDry))
219  {
220  alpha_[i] = 0.0;
221  }
222  }
223 
225  }
226  else
227  {
228  alpha_ ==
230  }
231 }
232 
233 
235 {
236  if (debug)
237  {
238  InfoInFunction << endl;
239  }
240 
241  // Update heat transfer coefficient sub-models
242  htcs_->correct();
243  htcw_->correct();
244 
245  // Update radiation
246  radiation_->correct();
247 
248  // Update injection model - mass returned is mass available for injection
250 
251  phaseChange_->correct
252  (
253  time_.deltaTValue(),
257  );
258 
259  const volScalarField rMagSfDt((1/time().deltaT())/magSf());
260 
261  // Vapour recoil pressure
262  pSp_ -= sqr(rMagSfDt*primaryMassTrans_)/(2*rhoPrimary_);
263 
264  // Update transfer model - mass returned is mass available for transfer
266 
267  // Update source fields
268  rhoSp_ += rMagSfDt*(cloudMassTrans_ + primaryMassTrans_);
270 
271  turbulence_->correct();
272 }
273 
274 
276 {
277  return
278  (
279  // Heat-transfer to the primary region
280  - fvm::Sp(htcs_->h()/Cp_, hs)
281  + htcs_->h()*(hs/Cp_ + alpha_*(TPrimary_ - T_))
282 
283  // Heat-transfer to the wall
284  - fvm::Sp(htcw_->h()/Cp_, hs)
285  + htcw_->h()*(hs/Cp_ + alpha_*(Tw_- T_))
286  );
287 }
288 
289 
291 {
292  if (debug)
293  {
294  InfoInFunction << endl;
295  }
296 
297 
298  dimensionedScalar residualDeltaRho
299  (
300  "residualDeltaRho",
301  deltaRho_.dimensions(),
302  1e-10
303  );
304 
305  solve
306  (
308  + fvm::div(phi_, hs_)
309  ==
310  - hsSp_
311  + q(hs_)
312  + radiation_->Shs()
313  );
314 
316 
317  // Evaluate viscosity from user-model
318  viscosity_->correct(pPrimary_, T_);
319 
320  // Update film wall and surface temperatures
322 }
323 
324 
325 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
326 
327 thermoSingleLayer::thermoSingleLayer
328 (
329  const word& modelType,
330  const fvMesh& mesh,
331  const dimensionedVector& g,
332  const word& regionType,
333  const bool readFields
334 )
335 :
336  kinematicSingleLayer(modelType, mesh, g, regionType, false),
337  thermo_(mesh.lookupObject<SLGThermo>("SLGThermo")),
338  Cp_
339  (
340  IOobject
341  (
342  "Cp",
343  time().timeName(),
344  regionMesh(),
347  ),
348  regionMesh(),
350  zeroGradientFvPatchScalarField::typeName
351  ),
352  kappa_
353  (
354  IOobject
355  (
356  "kappa",
357  time().timeName(),
358  regionMesh(),
361  ),
362  regionMesh(),
364  zeroGradientFvPatchScalarField::typeName
365  ),
366 
367  T_
368  (
369  IOobject
370  (
371  "Tf",
372  time().timeName(),
373  regionMesh(),
376  ),
377  regionMesh()
378  ),
379  Ts_
380  (
381  IOobject
382  (
383  "Tsf",
384  time().timeName(),
385  regionMesh(),
388  ),
389  T_,
390  zeroGradientFvPatchScalarField::typeName
391  ),
392  Tw_
393  (
394  IOobject
395  (
396  "Twf",
397  time().timeName(),
398  regionMesh(),
401  ),
402  T_,
403  zeroGradientFvPatchScalarField::typeName
404  ),
405  hs_
406  (
407  IOobject
408  (
409  "hf",
410  time().timeName(),
411  regionMesh(),
414  ),
415  regionMesh(),
417  hsBoundaryTypes()
418  ),
419 
420  primaryEnergyTrans_
421  (
422  IOobject
423  (
424  "primaryEnergyTrans",
425  time().timeName(),
426  regionMesh(),
429  ),
430  regionMesh(),
432  zeroGradientFvPatchScalarField::typeName
433  ),
434 
435  deltaWet_(coeffs_.get<scalar>("deltaWet")),
436  hydrophilic_(coeffs_.get<bool>("hydrophilic")),
437  hydrophilicDryScale_(0.0),
438  hydrophilicWetScale_(0.0),
439 
440  hsSp_
441  (
442  IOobject
443  (
444  "hsSp",
445  time().timeName(),
446  regionMesh(),
449  ),
450  regionMesh(),
452  this->mappedPushedFieldPatchTypes<scalar>()
453  ),
454 
455  hsSpPrimary_
456  (
457  IOobject
458  (
459  hsSp_.name(), // Must have same name as hSp_ to enable mapping
460  time().timeName(),
461  primaryMesh(),
464  ),
465  primaryMesh(),
466  dimensionedScalar(hsSp_.dimensions(), Zero)
467  ),
468 
469  TPrimary_
470  (
471  IOobject
472  (
473  "T", // Same name as T on primary region to enable mapping
474  time().timeName(),
475  regionMesh(),
478  ),
479  regionMesh(),
481  this->mappedFieldAndInternalPatchTypes<scalar>()
482  ),
483 
484  YPrimary_(),
485 
486  viscosity_(filmViscosityModel::New(*this, coeffs(), mu_)),
487  htcs_
488  (
489  heatTransferModel::New(*this, coeffs().subDict("upperSurfaceModels"))
490  ),
491  htcw_
492  (
493  heatTransferModel::New(*this, coeffs().subDict("lowerSurfaceModels"))
494  ),
495  phaseChange_(phaseChangeModel::New(*this, coeffs())),
496  radiation_(filmRadiationModel::New(*this, coeffs())),
497  Tmin_(-VGREAT),
498  Tmax_(VGREAT)
499 {
500  if (coeffs().readIfPresent("Tmin", Tmin_))
501  {
502  Info<< " limiting minimum temperature to " << Tmin_ << endl;
503  }
504 
505  if (coeffs().readIfPresent("Tmax", Tmax_))
506  {
507  Info<< " limiting maximum temperature to " << Tmax_ << endl;
508  }
509 
510  if (thermo_.hasMultiComponentCarrier())
511  {
512  YPrimary_.setSize(thermo_.carrier().species().size());
513 
514  forAll(thermo_.carrier().species(), i)
515  {
516  YPrimary_.set
517  (
518  i,
519  new volScalarField
520  (
521  IOobject
522  (
523  thermo_.carrier().species()[i],
524  time().timeName(),
525  regionMesh(),
528  ),
529  regionMesh(),
531  pSp_.boundaryField().types()
532  )
533  );
534  }
535  }
536 
537  if (hydrophilic_)
538  {
539  coeffs_.readEntry("hydrophilicDryScale", hydrophilicDryScale_);
540  coeffs_.readEntry("hydrophilicWetScale", hydrophilicWetScale_);
541  }
542 
543  if (readFields)
544  {
545  transferPrimaryRegionThermoFields();
546 
547  correctAlpha();
548 
549  correctThermoFields();
550 
551  // Update derived fields
552  hs_ == hs(T_);
553 
554  deltaRho_ == delta_*rho_;
555 
557  (
558  IOobject
559  (
560  "phi",
561  time().timeName(),
562  regionMesh(),
565  false
566  ),
567  fvc::flux(deltaRho_*U_)
568  );
569 
570  phi_ == phi0;
571 
572  // Evaluate viscosity from user-model
573  viscosity_->correct(pPrimary_, T_);
574  }
575 }
576 
577 
578 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
579 
581 {}
582 
583 
584 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
585 
587 (
588  const label patchi,
589  const label facei,
590  const scalar massSource,
591  const vector& momentumSource,
592  const scalar pressureSource,
593  const scalar energySource
594 )
595 {
597  (
598  patchi,
599  facei,
600  massSource,
601  momentumSource,
602  pressureSource,
603  energySource
604  );
605 
606  if (debug)
607  {
608  Info<< " energy = " << energySource << nl << endl;
609  }
610 
611  hsSpPrimary_.boundaryFieldRef()[patchi][facei] -= energySource;
612 }
613 
614 
616 {
617  if (debug)
618  {
619  InfoInFunction << endl;
620  }
621 
624 }
625 
626 
628 {
629  if (debug)
630  {
631  InfoInFunction << endl;
632  }
633 
634  // Solve continuity for deltaRho_
635  solveContinuity();
636 
637  // Update sub-models to provide updated source contributions
638  updateSubmodels();
639 
640  // Solve continuity for deltaRho_
641  solveContinuity();
642 
643  for (int oCorr=1; oCorr<=nOuterCorr_; oCorr++)
644  {
645  // Explicit pressure source contribution
646  tmp<volScalarField> tpu(this->pu());
647 
648  // Implicit pressure source coefficient
649  tmp<volScalarField> tpp(this->pp());
650 
651  // Solve for momentum for U_
652  tmp<fvVectorMatrix> UEqn = solveMomentum(tpu(), tpp());
653 
654  // Solve energy for hs_ - also updates thermo
655  solveEnergy();
656 
657  // Film thickness correction loop
658  for (int corr=1; corr<=nCorr_; corr++)
659  {
660  // Solve thickness for delta_
661  solveThickness(tpu(), tpp(), UEqn());
662  }
663  }
664 
665  // Update deltaRho_ with new delta_
666  deltaRho_ == delta_*rho_;
667 
668  // Update temperature using latest hs_
669  T_ == T(hs_);
670 }
671 
672 
674 {
675  return Cp_;
676 }
677 
678 
680 {
681  return kappa_;
682 }
683 
684 
686 {
687  return T_;
688 }
689 
690 
692 {
693  return Ts_;
694 }
695 
696 
698 {
699  return Tw_;
700 }
701 
702 
704 {
705  return hs_;
706 }
707 
708 
710 {
712 
713  const scalarField& Tinternal = T_;
714 
715  Info<< indent << "min/mean/max(T) = "
716  << gMin(Tinternal) << ", "
717  << gAverage(Tinternal) << ", "
718  << gMax(Tinternal) << nl;
719 
720  phaseChange_->info(Info);
721 }
722 
723 
725 {
727  (
729  (
730  IOobject
731  (
732  typeName + ":Srho",
733  time().timeName(),
734  primaryMesh(),
737  false
738  ),
739  primaryMesh(),
741  )
742  );
743 
744  scalarField& Srho = tSrho.ref();
745  const scalarField& V = primaryMesh().V();
746  const scalar dt = time_.deltaTValue();
747 
749  {
750  const label filmPatchi = intCoupledPatchIDs()[i];
751 
752  scalarField patchMass =
753  primaryMassTrans_.boundaryField()[filmPatchi];
754 
755  toPrimary(filmPatchi, patchMass);
756 
757  const label primaryPatchi = primaryPatchIDs()[i];
758  const labelUList& cells =
759  primaryMesh().boundaryMesh()[primaryPatchi].faceCells();
760 
761  forAll(patchMass, j)
762  {
763  Srho[cells[j]] += patchMass[j]/(V[cells[j]]*dt);
764  }
765  }
766 
767  return tSrho;
768 }
769 
770 
772 (
773  const label i
774 ) const
775 {
776  const label vapId = thermo_.carrierId(filmThermo_->name());
777 
779  (
781  (
782  IOobject
783  (
784  typeName + ":Srho(" + Foam::name(i) + ")",
785  time_.timeName(),
786  primaryMesh(),
789  false
790  ),
791  primaryMesh(),
793  )
794  );
795 
796  if (vapId == i)
797  {
798  scalarField& Srho = tSrho.ref();
799  const scalarField& V = primaryMesh().V();
800  const scalar dt = time().deltaTValue();
801 
802  forAll(intCoupledPatchIDs_, i)
803  {
804  const label filmPatchi = intCoupledPatchIDs_[i];
805 
806  scalarField patchMass =
807  primaryMassTrans_.boundaryField()[filmPatchi];
808 
809  toPrimary(filmPatchi, patchMass);
810 
811  const label primaryPatchi = primaryPatchIDs()[i];
812  const labelUList& cells =
813  primaryMesh().boundaryMesh()[primaryPatchi].faceCells();
814 
815  forAll(patchMass, j)
816  {
817  Srho[cells[j]] += patchMass[j]/(V[cells[j]]*dt);
818  }
819  }
820  }
821 
822  return tSrho;
823 }
824 
825 
827 {
829  (
831  (
832  IOobject
833  (
834  typeName + ":Sh",
835  time().timeName(),
836  primaryMesh(),
839  false
840  ),
841  primaryMesh(),
843  )
844  );
845 
846  scalarField& Sh = tSh.ref();
847  const scalarField& V = primaryMesh().V();
848  const scalar dt = time_.deltaTValue();
849 
851  {
852  const label filmPatchi = intCoupledPatchIDs_[i];
853 
854  scalarField patchEnergy =
855  primaryEnergyTrans_.boundaryField()[filmPatchi];
856 
857  toPrimary(filmPatchi, patchEnergy);
858 
859  const label primaryPatchi = primaryPatchIDs()[i];
860  const labelUList& cells =
861  primaryMesh().boundaryMesh()[primaryPatchi].faceCells();
862 
863  forAll(patchEnergy, j)
864  {
865  Sh[cells[j]] += patchEnergy[j]/(V[cells[j]]*dt);
866  }
867  }
868 
869  return tSh;
870 }
871 
872 
873 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
874 
875 } // End namespace Foam
876 } // End namespace regionModels
877 } // End namespace surfaceFilmModels
878 
879 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::fvPatchField< scalar >
Foam::IOobject::NO_WRITE
Definition: IOobject.H:130
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::solveEnergy
virtual void solveEnergy()
Solve energy equation.
Definition: thermoSingleLayer.C:290
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::Tw_
volScalarField Tw_
Temperature - wall [K].
Definition: thermoSingleLayer.H:108
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::read
virtual bool read()
Read control parameters from dictionary.
Definition: kinematicSingleLayer.C:59
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
InfoInFunction
#define InfoInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:316
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::read
virtual bool read()
Read control parameters from dictionary.
Definition: thermoSingleLayer.C:88
filmThermoModel.H
Foam::IOobject::AUTO_WRITE
Definition: IOobject.H:129
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::transferPrimaryRegionThermoFields
virtual void transferPrimaryRegionThermoFields()
Transfer thermo fields from the primary region to the film region.
Definition: kinematicSingleLayer.C:97
Foam::dimless
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
Definition: dimensionSets.H:50
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::resetPrimaryRegionSourceTerms
virtual void resetPrimaryRegionSourceTerms()
Reset source term fields.
Definition: thermoSingleLayer.C:95
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::info
virtual void info()
Provide some feedback.
Definition: thermoSingleLayer.C:709
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::hs
virtual const volScalarField & hs() const
Return the film sensible enthalpy [J/kg].
Definition: thermoSingleLayer.C:703
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::correctHsForMappedT
virtual void correctHsForMappedT()
Correct sensible enthalpy for mapped temperature fields.
Definition: thermoSingleLayer.C:117
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::~thermoSingleLayer
virtual ~thermoSingleLayer()
Destructor.
Definition: thermoSingleLayer.C:580
Foam::regionModels::surfaceFilmModels::transferModelList::correct
virtual void correct(scalarField &availableMass, volScalarField &massToTransfer)
Correct kinematic transfers.
Definition: transferModelList.C:100
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::injection_
injectionModelList injection_
Cloud injection.
Definition: kinematicSingleLayer.H:213
Foam::dimLength
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:53
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::preEvolveRegion
virtual void preEvolveRegion()
Pre-evolve film hook.
Definition: kinematicSingleLayer.C:874
Foam::SLGThermo
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
Definition: SLGThermo.H:64
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::primaryMassTrans_
volScalarField primaryMassTrans_
Film mass available for transfer to the primary region.
Definition: kinematicSingleLayer.H:150
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::viscosity_
autoPtr< filmViscosityModel > viscosity_
Viscosity model.
Definition: thermoSingleLayer.H:168
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::htcs_
autoPtr< heatTransferModel > htcs_
Heat transfer coefficient between film surface and primary.
Definition: thermoSingleLayer.H:172
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::Zero
static constexpr const zero Zero
Global zero.
Definition: zero.H:128
Foam::dimEnergy
const dimensionSet dimEnergy
Foam::gAverage
Type gAverage(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:604
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::turbulence_
autoPtr< filmTurbulenceModel > turbulence_
Turbulence model.
Definition: kinematicSingleLayer.H:219
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::filmThermo_
autoPtr< filmThermoModel > filmThermo_
Film thermo model.
Definition: kinematicSingleLayer.H:207
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::solveContinuity
virtual void solveContinuity()
Solve continuity equation.
Definition: kinematicSingleLayer.C:270
Foam::regionModels::surfaceFilmModels::heatTransferModel::New
static autoPtr< heatTransferModel > New(surfaceFilmRegionModel &film, const dictionary &dict)
Return a reference to the selected phase change model.
Definition: heatTransferModelNew.C:43
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::primaryEnergyTrans_
volScalarField primaryEnergyTrans_
Film energy transfer.
Definition: thermoSingleLayer.H:117
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::phaseChange_
autoPtr< phaseChangeModel > phaseChange_
Phase change.
Definition: thermoSingleLayer.H:178
fvcDiv.H
Calculate the divergence of the given field.
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::Cp
virtual const volScalarField & Cp() const
Return the film specific heat capacity [J/kg/K].
Definition: thermoSingleLayer.C:673
Foam::regionModels::regionModel::time
const Time & time() const
Return the reference to the time database.
Definition: regionModelI.H:39
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer
Kinematic form of single-cell layer surface film model.
Definition: kinematicSingleLayer.H:66
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::solveThickness
virtual void solveThickness(const volScalarField &pu, const volScalarField &pp, const fvVectorMatrix &UEqn)
Solve coupled velocity-thickness equations.
Definition: kinematicSingleLayer.C:363
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::rho_
volScalarField rho_
Density [kg/m3].
Definition: kinematicSingleLayer.H:114
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::sigma_
volScalarField sigma_
Surface tension [m/s2].
Definition: kinematicSingleLayer.H:120
Foam::polyMesh::boundaryMesh
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:435
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:337
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::kappa
virtual const volScalarField & kappa() const
Return the film thermal conductivity [W/m/K].
Definition: thermoSingleLayer.C:679
Foam::pos0
dimensionedScalar pos0(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:188
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::T_
volScalarField T_
Temperature - mean [K].
Definition: thermoSingleLayer.H:102
Foam::regionModels::surfaceFilmModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(surfaceFilmRegionModel, kinematicSingleLayer, mesh)
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::Cp_
volScalarField Cp_
Specific heat capacity [J/kg/K].
Definition: thermoSingleLayer.H:96
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::hydrophilicDryScale_
scalar hydrophilicDryScale_
Length scale applied to deltaWet_ to determine when a wet.
Definition: thermoSingleLayer.H:131
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::availableMass_
scalarField availableMass_
Available mass for transfer via sub-models.
Definition: kinematicSingleLayer.H:210
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::pPrimary_
volScalarField pPrimary_
Pressure [Pa].
Definition: kinematicSingleLayer.H:195
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:290
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::correctThermoFields
virtual void correctThermoFields()
Correct the thermo fields.
Definition: thermoSingleLayer.C:108
thermoSingleLayer.H
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::evolveRegion
virtual void evolveRegion()
Evolve the film equations.
Definition: thermoSingleLayer.C:627
Foam::regionModels::regionModel::primaryMesh
const fvMesh & primaryMesh() const
Return the reference to the primary mesh database.
Definition: regionModelI.H:33
Foam::wordList
List< word > wordList
A List of words.
Definition: fileName.H:59
Foam::regionModels::regionModel::toPrimary
void toPrimary(const label regionPatchi, List< Type > &regionField) const
Convert a local region field to the primary region.
Definition: regionModelTemplates.C:147
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::deltaWet_
scalar deltaWet_
Threshold film thickness beyond which the film is considered 'wet'.
Definition: thermoSingleLayer.H:121
mappedFieldFvPatchField.H
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::cloudDiameterTrans_
volScalarField cloudDiameterTrans_
Parcel diameters originating from film to cloud.
Definition: kinematicSingleLayer.H:156
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:54
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::hsSp_
volScalarField hsSp_
Energy [J/m2/s].
Definition: thermoSingleLayer.H:145
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::deltaRho_
volScalarField deltaRho_
Film thickness*density (helper field) [kg/m2].
Definition: kinematicSingleLayer.H:141
Foam::tmp::ref
T & ref() const
Definition: tmpI.H:258
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::transferPrimaryRegionThermoFields
virtual void transferPrimaryRegionThermoFields()
Transfer thermo fields from the primary region to the film region.
Definition: thermoSingleLayer.C:154
Foam::dimArea
const dimensionSet dimArea(sqr(dimLength))
Definition: dimensionSets.H:60
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::fvm::Sp
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::transferPrimaryRegionSourceFields
virtual void transferPrimaryRegionSourceFields()
Transfer source fields from the primary region to the film region.
Definition: kinematicSingleLayer.C:110
Foam::Field< scalar >
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::delta_
volScalarField delta_
Film thickness [m].
Definition: kinematicSingleLayer.H:126
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::regionModels::singleLayerRegion::magSf
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
Definition: singleLayerRegion.C:222
Foam::regionModels::regionModel::regionMesh
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:63
Foam::IOobject::READ_IF_PRESENT
Definition: IOobject.H:122
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::pp
virtual tmp< volScalarField > pp()
Implicit pressure source coefficient.
Definition: kinematicSingleLayer.C:190
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::info
virtual void info()
Provide some feedback.
Definition: kinematicSingleLayer.C:1089
Foam::constant::electromagnetic::phi0
const dimensionedScalar phi0
Magnetic flux quantum: default SI units: [Wb].
Foam::solve
SolverPerformance< Type > solve(faMatrix< Type > &, Istream &)
Solve returning the solution statistics given convergence tolerance.
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:43
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::resetPrimaryRegionSourceTerms
virtual void resetPrimaryRegionSourceTerms()
Reset source term fields.
Definition: kinematicSingleLayer.C:84
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::addSources
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.
Definition: thermoSingleLayer.C:587
Foam::regionModels::surfaceFilmModels::phaseChangeModel::New
static autoPtr< phaseChangeModel > New(surfaceFilmRegionModel &film, const dictionary &dict)
Return a reference to the selected phase change model.
Definition: phaseChangeModelNew.C:43
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::Ts_
volScalarField Ts_
Temperature - surface [K].
Definition: thermoSingleLayer.H:105
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::solveMomentum
virtual tmp< fvVectorMatrix > solveMomentum(const volScalarField &pu, const volScalarField &pp)
Solve for film velocity.
Definition: kinematicSingleLayer.C:305
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::updateSubmodels
virtual void updateSubmodels()
Update the film sub-models.
Definition: thermoSingleLayer.C:234
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::T
virtual const volScalarField & T() const
Return the film mean temperature [K].
Definition: thermoSingleLayer.C:685
timeName
word timeName
Definition: getTimeIndex.H:3
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::YPrimary_
PtrList< volScalarField > YPrimary_
List of specie mass fractions [0-1].
Definition: thermoSingleLayer.H:162
fvm.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::TPrimary_
volScalarField TPrimary_
Temperature [K].
Definition: thermoSingleLayer.H:159
Foam::dimensioned< scalar >
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
g
const uniformDimensionedVectorField & g
Definition: createFluidFields.H:24
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::dimMass
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:52
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::nCorr_
label nCorr_
Number of PISO-like correctors.
Definition: kinematicSingleLayer.H:94
Foam::indent
Ostream & indent(Ostream &os)
Indent stream.
Definition: Ostream.H:307
mixedFvPatchFields.H
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::q
virtual tmp< fvScalarMatrix > q(volScalarField &hs) const
Return the wall/surface heat transfer term for the enthalpy equation.
Definition: thermoSingleLayer.C:275
constants.H
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::preEvolveRegion
virtual void preEvolveRegion()
Pre-evolve film hook.
Definition: thermoSingleLayer.C:615
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::pu
virtual tmp< volScalarField > pu()
Explicit pressure source contribution.
Definition: kinematicSingleLayer.C:168
Foam::readFields
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
Definition: ReadFieldsTemplates.C:312
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::pSp_
volScalarField pSp_
Pressure [Pa].
Definition: kinematicSingleLayer.H:169
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::phi_
surfaceScalarField phi_
Mass flux (includes film thickness) [kg.m/s].
Definition: kinematicSingleLayer.H:144
Foam::regionModels::regionModel::primaryPatchIDs
const labelList & primaryPatchIDs() const
Return the list of patch IDs on the primary region coupled.
Definition: regionModelI.H:175
filmRadiationModel.H
Foam::GeometricField::correctBoundaryConditions
void correctBoundaryConditions()
Correct boundary field.
Definition: GeometricField.C:909
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::hsSpPrimary_
volScalarField hsSpPrimary_
Energy [J/m2/s].
Definition: thermoSingleLayer.H:152
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::hs_
volScalarField hs_
Sensible enthalpy [J/kg].
Definition: thermoSingleLayer.H:111
Foam::regionModels::surfaceFilmModels::defineTypeNameAndDebug
defineTypeNameAndDebug(kinematicSingleLayer, 0)
Foam::isA
const TargetType * isA(const Type &t)
Check if dynamic_cast to TargetType is possible.
Definition: typeInfo.H:197
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::addSources
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.
Definition: kinematicSingleLayer.C:848
Foam::fvm::ddt
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvmDdt.C:48
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:51
Foam::regionModels::regionModel::time_
const Time & time_
Reference to the time database.
Definition: regionModel.H:89
fvcLaplacian.H
Calculate the laplacian of the given field.
Foam::nl
constexpr char nl
Definition: Ostream.H:372
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::Srho
virtual tmp< volScalarField::Internal > Srho() const
Return total mass source - Eulerian phase only.
Definition: thermoSingleLayer.C:724
Foam::mappedFieldFvPatchField
This boundary condition provides a self-contained version of the mapped condition....
Definition: mappedFieldFvPatchField.H:114
mapDistribute.H
Foam::regionModels::surfaceFilmModels::filmRadiationModel::New
static autoPtr< filmRadiationModel > New(surfaceFilmRegionModel &film, const dictionary &dict)
Return a reference to the selected phase change model.
Definition: filmRadiationModelNew.C:43
Foam::regionModels::surfaceFilmModels::injectionModelList::correct
virtual void correct(scalarField &availableMass, volScalarField &massToInject, volScalarField &diameterToInject)
Correct.
Definition: injectionModelList.C:98
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::alpha_
volScalarField alpha_
Film coverage indicator, 1 = covered, 0 = uncovered [].
Definition: kinematicSingleLayer.H:129
Foam::GeometricField::boundaryFieldRef
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
Definition: GeometricField.C:752
Foam::Vector< scalar >
Foam::TimeState::deltaTValue
scalar deltaTValue() const
Return time step value.
Definition: TimeStateI.H:42
fvcFlux.H
Calculate the face-flux of the given field.
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::rhoPrimary_
volScalarField rhoPrimary_
Density [kg/m3].
Definition: kinematicSingleLayer.H:198
Foam::UList< label >
filmViscosityModel.H
Foam::constant::electromagnetic::e
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::kappa_
volScalarField kappa_
Thermal conductivity [W/m/K].
Definition: thermoSingleLayer.H:99
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::hydrophilic_
bool hydrophilic_
Activation flag.
Definition: thermoSingleLayer.H:127
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::radiation_
autoPtr< filmRadiationModel > radiation_
Radiation.
Definition: thermoSingleLayer.H:181
Foam::dimTemperature
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:55
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::transfer_
transferModelList transfer_
Transfer with the continuous phase.
Definition: kinematicSingleLayer.H:216
Foam::regionModels::regionModel::intCoupledPatchIDs_
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
Definition: regionModel.H:116
Foam::UIndirectList
A List with indirect addressing.
Definition: fvMatrix.H:109
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::correctAlpha
virtual void correctAlpha()
Correct film coverage field.
Definition: thermoSingleLayer.C:205
UEqn
fvVectorMatrix & UEqn
Definition: UEqn.H:13
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::hydrophilicWetScale_
scalar hydrophilicWetScale_
Length scale applied to deltaWet_ to determine when a dry.
Definition: thermoSingleLayer.H:135
fvcDdt.H
Calculate the first temporal derivative.
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::Sh
virtual tmp< volScalarField::Internal > Sh() const
Return enthalpy source - Eulerian phase only.
Definition: thermoSingleLayer.C:826
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::Tw
virtual const volScalarField & Tw() const
Return the film wall temperature [K].
Definition: thermoSingleLayer.C:697
cells
const cellShapeList & cells
Definition: gmvOutputHeader.H:3
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::htcw_
autoPtr< heatTransferModel > htcw_
Heat transfer coefficient between wall and film [W/m2/K].
Definition: thermoSingleLayer.H:175
Foam::gMin
Type gMin(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:593
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::Ts
virtual const volScalarField & Ts() const
Return the film surface temperature [K].
Definition: thermoSingleLayer.C:691
Foam::fvc::flux
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
Definition: fvcFlux.C:34
Foam::dimVolume
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:61
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::IOobject::NO_READ
Definition: IOobject.H:123
Foam::fvm::div
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvmDiv.C:48
zeroGradientFvPatchFields.H
Foam::regionModels::regionModel::intCoupledPatchIDs
const labelList & intCoupledPatchIDs() const
Return the list of patch IDs internally coupled with the.
Definition: regionModelI.H:182
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::rhoSp_
volScalarField rhoSp_
Mass [kg/m2/s].
Definition: kinematicSingleLayer.H:172
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::cloudMassTrans_
volScalarField cloudMassTrans_
Film mass available for transfer to cloud.
Definition: kinematicSingleLayer.H:153
Foam::gMax
Type gMax(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:592
Foam::regionModels::surfaceFilmModels::filmViscosityModel::New
static autoPtr< filmViscosityModel > New(surfaceFilmRegionModel &film, const dictionary &dict, volScalarField &mu)
Return a reference to the selected phase change model.
Definition: filmViscosityModelNew.C:43
phaseChangeModel.H
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::nOuterCorr_
label nOuterCorr_
Number of outer correctors.
Definition: kinematicSingleLayer.H:91
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::updateSurfaceTemperatures
virtual void updateSurfaceTemperatures()
Correct the film surface and wall temperatures.
Definition: thermoSingleLayer.C:134
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.H:62
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::transferPrimaryRegionSourceFields
virtual void transferPrimaryRegionSourceFields()
Transfer source fields from the primary region to the film region.
Definition: thermoSingleLayer.C:173
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::fvMesh::V
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
Definition: fvMeshGeometry.C:190
Foam::IOobject::MUST_READ
Definition: IOobject.H:120