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 | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "thermoSingleLayer.H"
27 #include "fvcDiv.H"
28 #include "fvcLaplacian.H"
29 #include "fvm.H"
30 #include "fvcDdt.H"
34 #include "mapDistribute.H"
35 #include "constants.H"
36 
37 // Sub-models
38 #include "filmThermoModel.H"
39 #include "filmViscosityModel.H"
40 #include "heatTransferModel.H"
41 #include "phaseChangeModel.H"
42 #include "filmRadiationModel.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 namespace regionModels
49 {
50 namespace surfaceFilmModels
51 {
52 
53 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
54 
56 
58 
59 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
60 
62 {
63  wordList bTypes(T_.boundaryField().types());
64  forAll(bTypes, patchI)
65  {
66  if
67  (
68  T_.boundaryField()[patchI].fixesValue()
70  )
71  {
73  }
74  }
75 
76  return bTypes;
77 }
78 
79 
80 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
81 
83 {
84  // no additional properties to read
86 }
87 
88 
90 {
91  if (debug)
92  {
93  Info<< "thermoSingleLayer::resetPrimaryRegionSourceTerms()" << endl;
94  }
95 
97 
98  hsSpPrimary_ == dimensionedScalar("zero", hsSp_.dimensions(), 0.0);
99 }
100 
101 
103 {
104  rho_ == filmThermo_->rho();
105  sigma_ == filmThermo_->sigma();
106  Cp_ == filmThermo_->Cp();
107  kappa_ == filmThermo_->kappa();
108 }
109 
110 
112 {
114 
115  forAll(T_.boundaryField(), patchI)
116  {
117  const fvPatchField<scalar>& Tp = T_.boundaryField()[patchI];
119  {
120  hs_.boundaryField()[patchI] == hs(Tp, patchI);
121  }
122  }
123 }
124 
125 
127 {
129 
130  // Push boundary film temperature into wall temperature internal field
131  for (label i=0; i<intCoupledPatchIDs_.size(); i++)
132  {
133  label patchI = intCoupledPatchIDs_[i];
134  const polyPatch& pp = regionMesh().boundaryMesh()[patchI];
135  UIndirectList<scalar>(Tw_, pp.faceCells()) =
136  T_.boundaryField()[patchI];
137  }
139 
140  // Update film surface temperature
141  Ts_ = T_;
143 }
144 
145 
147 {
148  if (debug)
149  {
150  Info<< "thermoSingleLayer::transferPrimaryRegionThermoFields()" << endl;
151  }
152 
154 
155  // Update primary region fields on local region via direct mapped (coupled)
156  // boundary conditions
158  forAll(YPrimary_, i)
159  {
160  YPrimary_[i].correctBoundaryConditions();
161  }
162 }
163 
164 
166 {
167  if (debug)
168  {
169  Info<< "thermoSingleLayer::transferPrimaryRegionSourceFields()" << endl;
170  }
171 
173 
174  // Convert accummulated source terms into per unit area per unit time
175  const scalar deltaT = time_.deltaTValue();
177  {
178  const scalarField& priMagSf =
179  primaryMesh().magSf().boundaryField()[patchI];
180 
181  hsSpPrimary_.boundaryField()[patchI] /= priMagSf*deltaT;
182  }
183 
184  // Retrieve the source fields from the primary region via direct mapped
185  // (coupled) boundary conditions
186  // - fields require transfer of values for both patch AND to push the
187  // values into the first layer of internal cells
189 
190  // Apply enthalpy source as difference between incoming and actual states
191  hsSp_ -= rhoSp_*hs_;
192 
193  if (time().outputTime())
194  {
195  if (debug)
196  {
197  hsSp_.write();
198  }
199  }
200 }
201 
202 
204 {
205  if (hydrophilic_)
206  {
207  const scalar hydrophilicDry = hydrophilicDryScale_*deltaWet_;
208  const scalar hydrophilicWet = hydrophilicWetScale_*deltaWet_;
209 
210  forAll(alpha_, i)
211  {
212  if ((alpha_[i] < 0.5) && (delta_[i] > hydrophilicWet))
213  {
214  alpha_[i] = 1.0;
215  }
216  else if ((alpha_[i] > 0.5) && (delta_[i] < hydrophilicDry))
217  {
218  alpha_[i] = 0.0;
219  }
220  }
221 
223  }
224  else
225  {
226  alpha_ ==
228  }
229 }
230 
231 
233 {
234  if (debug)
235  {
236  Info<< "thermoSingleLayer::updateSubmodels()" << endl;
237  }
238 
239  // Update heat transfer coefficient sub-models
240  htcs_->correct();
241  htcw_->correct();
242 
243  scalarField availableMass(alpha_*availableMass_);
244 
245  phaseChange_->correct
246  (
247  time_.deltaTValue(),
248  availableMass,
251  );
252 
253  // Update radiation
254  radiation_->correct();
255 
256  // Update kinematic sub-models
258 
259  // Update source fields
262 
263  // Vapour recoil pressure
264  pSp_ -= sqr(primaryMassPCTrans_/magSf()/time().deltaT())/2.0/rhoPrimary_;
265 }
266 
267 
269 {
270 // Only apply heat transfer where the film is present
271 // - leads to temperature unboundedness?
272 // volScalarField boundedAlpha(max(alpha_, ROOTVSMALL));
273 // volScalarField htcst(htcs_->h()*boundedAlpha);
274 // volScalarField htcwt(htcw_->h()*boundedAlpha);
275 
276  return
277  (
278  - fvm::Sp(htcs_->h()/Cp_, hs)
280 
281  - fvm::Sp(htcw_->h()/Cp_, hs)
283  );
284 }
285 
286 
288 {
289  if (debug)
290  {
291  Info<< "thermoSingleLayer::solveEnergy()" << endl;
292  }
293 
294 
295  dimensionedScalar residualDeltaRho
296  (
297  "residualDeltaRho",
298  deltaRho_.dimensions(),
299  1e-10
300  );
301 
302  solve
303  (
305  + fvm::div(phi_, hs_)
306  ==
307  - hsSp_
308  + alpha_*q(hs_)
309  + alpha_*radiation_->Shs()
310 // - fvm::SuSp(rhoSp_, hs_)
311  - rhoSp_*hs_
312  + fvc::ddt(residualDeltaRho + deltaRho_, hs_)
313  - fvm::ddt(residualDeltaRho + deltaRho_, hs_)
314  );
315 
317 
318  // evaluate viscosity from user-model
319  viscosity_->correct(pPrimary_, T_);
320 
321  // Update film wall and surface temperatures
323 }
324 
325 
326 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
327 
329 (
330  const word& modelType,
331  const fvMesh& mesh,
332  const dimensionedVector& g,
333  const word& regionType,
334  const bool readFields
335 )
336 :
337  kinematicSingleLayer(modelType, mesh, g, regionType, false),
338  thermo_(mesh.lookupObject<SLGThermo>("SLGThermo")),
339  Cp_
340  (
341  IOobject
342  (
343  "Cp",
344  time().timeName(),
345  regionMesh(),
348  ),
349  regionMesh(),
351  zeroGradientFvPatchScalarField::typeName
352  ),
353  kappa_
354  (
355  IOobject
356  (
357  "kappa",
358  time().timeName(),
359  regionMesh(),
362  ),
363  regionMesh(),
365  (
366  "kappa",
368  0.0
369  ),
370  zeroGradientFvPatchScalarField::typeName
371  ),
372 
373  T_
374  (
375  IOobject
376  (
377  "Tf",
378  time().timeName(),
379  regionMesh(),
382  ),
383  regionMesh()
384  ),
385  Ts_
386  (
387  IOobject
388  (
389  "Tsf",
390  time().timeName(),
391  regionMesh(),
394  ),
395  T_,
396  zeroGradientFvPatchScalarField::typeName
397  ),
398  Tw_
399  (
400  IOobject
401  (
402  "Twf",
403  time().timeName(),
404  regionMesh(),
407  ),
408  T_,
409  zeroGradientFvPatchScalarField::typeName
410  ),
411  hs_
412  (
413  IOobject
414  (
415  "hf",
416  time().timeName(),
417  regionMesh(),
420  ),
421  regionMesh(),
422  dimensionedScalar("zero", dimEnergy/dimMass, 0.0),
423  hsBoundaryTypes()
424  ),
425 
426  primaryMassPCTrans_
427  (
428  IOobject
429  (
430  "primaryMassPCTrans",
431  time().timeName(),
432  regionMesh(),
435  ),
436  regionMesh(),
437  dimensionedScalar("zero", dimMass, 0),
438  zeroGradientFvPatchScalarField::typeName
439  ),
440  primaryEnergyPCTrans_
441  (
442  IOobject
443  (
444  "primaryEnergyPCTrans",
445  time().timeName(),
446  regionMesh(),
449  ),
450  regionMesh(),
451  dimensionedScalar("zero", dimEnergy, 0),
452  zeroGradientFvPatchScalarField::typeName
453  ),
454 
455  deltaWet_(readScalar(coeffs_.lookup("deltaWet"))),
456  hydrophilic_(readBool(coeffs_.lookup("hydrophilic"))),
457  hydrophilicDryScale_(0.0),
458  hydrophilicWetScale_(0.0),
459 
460  hsSp_
461  (
462  IOobject
463  (
464  "hsSp",
465  time().timeName(),
466  regionMesh(),
469  ),
470  regionMesh(),
472  this->mappedPushedFieldPatchTypes<scalar>()
473  ),
474 
475  hsSpPrimary_
476  (
477  IOobject
478  (
479  hsSp_.name(), // must have same name as hSp_ to enable mapping
480  time().timeName(),
481  primaryMesh(),
484  ),
485  primaryMesh(),
486  dimensionedScalar("zero", hsSp_.dimensions(), 0.0)
487  ),
488 
489  TPrimary_
490  (
491  IOobject
492  (
493  "T", // same name as T on primary region to enable mapping
494  time().timeName(),
495  regionMesh(),
498  ),
499  regionMesh(),
500  dimensionedScalar("zero", dimTemperature, 0.0),
501  this->mappedFieldAndInternalPatchTypes<scalar>()
502  ),
503 
504  YPrimary_(),
505 
506  viscosity_(filmViscosityModel::New(*this, coeffs(), mu_)),
507  htcs_
508  (
509  heatTransferModel::New(*this, coeffs().subDict("upperSurfaceModels"))
510  ),
511  htcw_
512  (
513  heatTransferModel::New(*this, coeffs().subDict("lowerSurfaceModels"))
514  ),
515  phaseChange_(phaseChangeModel::New(*this, coeffs())),
516  radiation_(filmRadiationModel::New(*this, coeffs())),
517  Tmin_(-VGREAT),
518  Tmax_(VGREAT)
519 {
520  if (coeffs().readIfPresent("Tmin", Tmin_))
521  {
522  Info<< " limiting minimum temperature to " << Tmin_ << endl;
523  }
524 
525  if (coeffs().readIfPresent("Tmax", Tmax_))
526  {
527  Info<< " limiting maximum temperature to " << Tmax_ << endl;
528  }
529 
530  if (thermo_.hasMultiComponentCarrier())
531  {
532  YPrimary_.setSize(thermo_.carrier().species().size());
533 
534  forAll(thermo_.carrier().species(), i)
535  {
536  YPrimary_.set
537  (
538  i,
539  new volScalarField
540  (
541  IOobject
542  (
543  thermo_.carrier().species()[i],
544  time().timeName(),
545  regionMesh(),
548  ),
549  regionMesh(),
550  dimensionedScalar("zero", dimless, 0.0),
551  pSp_.boundaryField().types()
552  )
553  );
554  }
555  }
556 
557  if (hydrophilic_)
558  {
559  coeffs_.lookup("hydrophilicDryScale") >> hydrophilicDryScale_;
560  coeffs_.lookup("hydrophilicWetScale") >> hydrophilicWetScale_;
561  }
562 
563  if (readFields)
564  {
565  transferPrimaryRegionThermoFields();
566 
567  correctAlpha();
568 
569  correctThermoFields();
570 
571  // Update derived fields
572  hs_ == hs(T_);
573 
574  deltaRho_ == delta_*rho_;
575 
577  (
578  IOobject
579  (
580  "phi",
581  time().timeName(),
582  regionMesh(),
585  false
586  ),
587  fvc::interpolate(deltaRho_*U_) & regionMesh().Sf()
588  );
589 
590  phi_ == phi0;
591 
592  // evaluate viscosity from user-model
593  viscosity_->correct(pPrimary_, T_);
594  }
595 }
596 
597 
598 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
599 
601 {}
602 
603 
604 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
605 
607 (
608  const label patchI,
609  const label faceI,
610  const scalar massSource,
611  const vector& momentumSource,
612  const scalar pressureSource,
613  const scalar energySource
614 )
615 {
617  (
618  patchI,
619  faceI,
620  massSource,
621  momentumSource,
622  pressureSource,
623  energySource
624  );
625 
626  if (debug)
627  {
628  Info<< " energy = " << energySource << nl << endl;
629  }
630 
631  hsSpPrimary_.boundaryField()[patchI][faceI] -= energySource;
632 }
633 
634 
636 {
637  if (debug)
638  {
639  Info<< "thermoSingleLayer::preEvolveRegion()" << endl;
640  }
641 
643 
645 
646  // Update phase change
649 }
650 
651 
653 {
654  if (debug)
655  {
656  Info<< "thermoSingleLayer::evolveRegion()" << endl;
657  }
658 
659  // Update sub-models to provide updated source contributions
660  updateSubmodels();
661 
662  // Solve continuity for deltaRho_
663  solveContinuity();
664 
665  for (int oCorr=1; oCorr<=nOuterCorr_; oCorr++)
666  {
667  // Explicit pressure source contribution
668  tmp<volScalarField> tpu(this->pu());
669 
670  // Implicit pressure source coefficient
671  tmp<volScalarField> tpp(this->pp());
672 
673  // Solve for momentum for U_
674  tmp<fvVectorMatrix> UEqn = solveMomentum(tpu(), tpp());
675 
676  // Solve energy for hs_ - also updates thermo
677  solveEnergy();
678 
679  // Film thickness correction loop
680  for (int corr=1; corr<=nCorr_; corr++)
681  {
682  // Solve thickness for delta_
683  solveThickness(tpu(), tpp(), UEqn());
684  }
685  }
686 
687  // Update deltaRho_ with new delta_
688  deltaRho_ == delta_*rho_;
689 
690  // Update temperature using latest hs_
691  T_ == T(hs_);
692 }
693 
694 
696 {
697  return Cp_;
698 }
699 
700 
702 {
703  return kappa_;
704 }
705 
706 
708 {
709  return T_;
710 }
711 
712 
714 {
715  return Ts_;
716 }
717 
718 
720 {
721  return Tw_;
722 }
723 
724 
726 {
727  return hs_;
728 }
729 
730 
732 {
733  return primaryMassPCTrans_;
734 }
735 
736 
738 {
740 
741  const scalarField& Tinternal = T_.internalField();
742 
743  Info<< indent << "min/max(T) = " << gMin(Tinternal) << ", "
744  << gMax(Tinternal) << nl;
745 
746  phaseChange_->info(Info);
747 }
748 
749 
751 {
753  (
755  (
756  IOobject
757  (
758  typeName + ":Srho",
759  time().timeName(),
760  primaryMesh(),
763  false
764  ),
765  primaryMesh(),
767  )
768  );
769 
770  scalarField& Srho = tSrho();
771  const scalarField& V = primaryMesh().V();
772  const scalar dt = time_.deltaTValue();
773 
775  {
776  const label filmPatchI = intCoupledPatchIDs()[i];
777 
778  scalarField patchMass =
779  primaryMassPCTrans_.boundaryField()[filmPatchI];
780 
781  toPrimary(filmPatchI, patchMass);
782 
783  const label primaryPatchI = primaryPatchIDs()[i];
784  const unallocLabelList& cells =
785  primaryMesh().boundaryMesh()[primaryPatchI].faceCells();
786 
787  forAll(patchMass, j)
788  {
789  Srho[cells[j]] = patchMass[j]/(V[cells[j]]*dt);
790  }
791  }
792 
793  return tSrho;
794 }
795 
796 
798 (
799  const label i
800 ) const
801 {
802  const label vapId = thermo_.carrierId(filmThermo_->name());
803 
805  (
807  (
808  IOobject
809  (
810  typeName + ":Srho(" + Foam::name(i) + ")",
811  time_.timeName(),
812  primaryMesh(),
815  false
816  ),
817  primaryMesh(),
819  )
820  );
821 
822  if (vapId == i)
823  {
824  scalarField& Srho = tSrho();
825  const scalarField& V = primaryMesh().V();
826  const scalar dt = time().deltaTValue();
827 
828  forAll(intCoupledPatchIDs_, i)
829  {
830  const label filmPatchI = intCoupledPatchIDs_[i];
831 
832  scalarField patchMass =
833  primaryMassPCTrans_.boundaryField()[filmPatchI];
834 
835  toPrimary(filmPatchI, patchMass);
836 
837  const label primaryPatchI = primaryPatchIDs()[i];
838  const unallocLabelList& cells =
839  primaryMesh().boundaryMesh()[primaryPatchI].faceCells();
840 
841  forAll(patchMass, j)
842  {
843  Srho[cells[j]] = patchMass[j]/(V[cells[j]]*dt);
844  }
845  }
846  }
847 
848  return tSrho;
849 }
850 
851 
853 {
855  (
857  (
858  IOobject
859  (
860  typeName + ":Sh",
861  time().timeName(),
862  primaryMesh(),
865  false
866  ),
867  primaryMesh(),
869  )
870  );
871 /*
872  phase change energy fed back into the film...
873 
874  scalarField& Sh = tSh();
875  const scalarField& V = primaryMesh().V();
876  const scalar dt = time_.deltaTValue();
877 
878  forAll(intCoupledPatchIDs_, i)
879  {
880  const label filmPatchI = intCoupledPatchIDs_[i];
881 
882  scalarField patchEnergy =
883  primaryEnergyPCTrans_.boundaryField()[filmPatchI];
884 
885  toPrimary(filmPatchI, patchEnergy);
886 
887  const label primaryPatchI = primaryPatchIDs()[i];
888  const unallocLabelList& cells =
889  primaryMesh().boundaryMesh()[primaryPatchI].faceCells();
890 
891  forAll(patchEnergy, j)
892  {
893  Sh[cells[j]] += patchEnergy[j]/(V[cells[j]]*dt);
894  }
895  }
896 */
897  return tSh;
898 }
899 
900 
901 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
902 
903 } // end namespace Foam
904 } // end namespace regionModels
905 } // end namespace surfaceFilmModels
906 
907 // ************************************************************************* //
Foam::fvPatchField< scalar >
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::solveEnergy
virtual void solveEnergy()
Solve energy equation.
Definition: thermoSingleLayer.C:287
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::Tw_
volScalarField Tw_
Temperature - wall / [K].
Definition: thermoSingleLayer.H:106
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::read
virtual bool read()
Read control parameters from dictionary.
Definition: kinematicSingleLayer.C:55
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::read
virtual bool read()
Read control parameters from dictionary.
Definition: thermoSingleLayer.C:82
filmThermoModel.H
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::transferPrimaryRegionThermoFields
virtual void transferPrimaryRegionThermoFields()
Transfer thermo fields from the primary region to the film region.
Definition: kinematicSingleLayer.C:95
Foam::dimless
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::resetPrimaryRegionSourceTerms
virtual void resetPrimaryRegionSourceTerms()
Reset source term fields.
Definition: thermoSingleLayer.C:89
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::info
virtual void info()
Provide some feedback.
Definition: thermoSingleLayer.C:737
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::hs
virtual const volScalarField & hs() const
Return the film sensible enthalpy [J/kg].
Definition: thermoSingleLayer.C:725
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::regionModels::surfaceFilmModels::phaseChangeModel::New
static autoPtr< phaseChangeModel > New(surfaceFilmModel &owner, const dictionary &dict)
Return a reference to the selected phase change model.
Definition: phaseChangeModelNew.C:40
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::correctHsForMappedT
virtual void correctHsForMappedT()
Correct sensible enthalpy for mapped temperature fields.
Definition: thermoSingleLayer.C:111
Foam::TimeState::deltaT
dimensionedScalar deltaT() const
Return time step.
Definition: TimeState.C:79
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::~thermoSingleLayer
virtual ~thermoSingleLayer()
Destructor.
Definition: thermoSingleLayer.C:600
Foam::IOobject::AUTO_WRITE
@ AUTO_WRITE
Definition: IOobject.H:117
Foam::dimLength
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:50
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::preEvolveRegion
virtual void preEvolveRegion()
Pre-evolve film hook.
Definition: kinematicSingleLayer.C:863
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::SLGThermo
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
Definition: SLGThermo.H:62
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::viscosity_
autoPtr< filmViscosityModel > viscosity_
Viscosity model.
Definition: thermoSingleLayer.H:169
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::htcs_
autoPtr< heatTransferModel > htcs_
Heat transfer coefficient bewteen film surface and primary.
Definition: thermoSingleLayer.H:173
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::dimEnergy
const dimensionSet dimEnergy
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::filmThermo_
autoPtr< filmThermoModel > filmThermo_
Film thermo model.
Definition: kinematicSingleLayer.H:204
thermoSingleLayer
Thermodynamic form of single-cell layer surface film model.
Foam::fvc::interpolate
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &vf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
Definition: surfaceInterpolate.C:110
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::solveContinuity
virtual void solveContinuity()
Solve continuity equation.
Definition: kinematicSingleLayer.C:258
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::primaryMassTrans
virtual tmp< volScalarField > primaryMassTrans() const
Return mass transfer source - Eulerian phase only.
Definition: thermoSingleLayer.C:731
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::phaseChange_
autoPtr< phaseChangeModel > phaseChange_
Phase change.
Definition: thermoSingleLayer.H:179
fvcDiv.H
Calculate the divergence of the given field.
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::primaryEnergyPCTrans_
volScalarField primaryEnergyPCTrans_
Film energy evolved via phase change.
Definition: thermoSingleLayer.H:118
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::Cp
virtual const volScalarField & Cp() const
Return the film specific heat capacity [J/kg/K].
Definition: thermoSingleLayer.C:695
Foam::regionModels::regionModel::time
const Time & time() const
Return the reference to the time database.
Definition: regionModelI.H:37
Foam::GeometricField::boundaryField
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
Definition: GeometricField.C:735
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::hsBoundaryTypes
wordList hsBoundaryTypes()
Return boundary types for sensible enthalpy field.
Definition: thermoSingleLayer.C:61
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer
Definition: kinematicSingleLayer.H:63
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:351
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::rho_
volScalarField rho_
Density / [kg/m3].
Definition: kinematicSingleLayer.H:111
Foam::IOobject::MUST_READ
@ MUST_READ
Definition: IOobject.H:108
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::sigma_
volScalarField sigma_
Surface tension / [m/s2].
Definition: kinematicSingleLayer.H:117
Foam::polyMesh::boundaryMesh
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:421
g
const dimensionedVector & g
Definition: setRegionFluidFields.H:33
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::kappa
virtual const volScalarField & kappa() const
Return the film thermal conductivity [W/m/K].
Definition: thermoSingleLayer.C:701
Foam::constant::standard::Tstd
const dimensionedScalar Tstd
Standard temperature.
Definition: thermodynamicConstants.C:47
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::T_
volScalarField T_
Temperature - mean / [K].
Definition: thermoSingleLayer.H:100
Foam::readFields
This function object reads fields from the time directories and adds them to the mesh database for fu...
Definition: readFields.H:104
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::Cp_
volScalarField Cp_
Specific heat capacity / [J/kg/K].
Definition: thermoSingleLayer.H:94
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::hydrophilicDryScale_
scalar hydrophilicDryScale_
Length scale applied to deltaWet_ to determine when a wet.
Definition: thermoSingleLayer.H:132
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::availableMass_
scalarField availableMass_
Available mass for transfer via sub-models.
Definition: kinematicSingleLayer.H:207
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::pPrimary_
volScalarField pPrimary_
Pressure / [Pa].
Definition: kinematicSingleLayer.H:192
Foam::IOobject::NO_WRITE
@ NO_WRITE
Definition: IOobject.H:118
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:79
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::correctThermoFields
virtual void correctThermoFields()
Correct the thermo fields.
Definition: thermoSingleLayer.C:102
thermoSingleLayer.H
Foam::fvm::Sp
tmp< fvMatrix< Type > > Sp(const DimensionedField< scalar, volMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)
Foam::fvMesh::magSf
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
Definition: fvMeshGeometry.C:358
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::evolveRegion
virtual void evolveRegion()
Evolve the film equations.
Definition: thermoSingleLayer.C:652
Foam::regionModels::regionModel::primaryMesh
const fvMesh & primaryMesh() const
Return the reference to the primary mesh database.
Definition: regionModelI.H:31
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::deltaWet_
scalar deltaWet_
Threshold film thickness beyond which the film is considered 'wet'.
Definition: thermoSingleLayer.H:122
mappedFieldFvPatchField.H
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::hsSp_
volScalarField hsSp_
Energy / [J/m2/s].
Definition: thermoSingleLayer.H:146
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::deltaRho_
volScalarField deltaRho_
Film thickness*density (helper field) / [kg/m2].
Definition: kinematicSingleLayer.H:138
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::transferPrimaryRegionThermoFields
virtual void transferPrimaryRegionThermoFields()
Transfer thermo fields from the primary region to the film region.
Definition: thermoSingleLayer.C:146
Foam::dimArea
const dimensionSet dimArea(sqr(dimLength))
Definition: dimensionSets.H:57
Foam::fvMesh::V
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
Definition: fvMeshGeometry.C:199
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:59
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::transferPrimaryRegionSourceFields
virtual void transferPrimaryRegionSourceFields()
Transfer source fields from the primary region to the film region.
Definition: kinematicSingleLayer.C:112
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::delta_
volScalarField delta_
Film thickness / [m].
Definition: kinematicSingleLayer.H:123
Foam::IOobject::NO_READ
@ NO_READ
Definition: IOobject.H:111
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::Info
messageStream Info
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Foam::regionModels::singleLayerRegion::magSf
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
Definition: singleLayerRegion.C:220
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::pp
virtual tmp< volScalarField > pp()
Implicit pressure source coefficient.
Definition: kinematicSingleLayer.C:181
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::info
virtual void info()
Provide some feedback.
Definition: kinematicSingleLayer.C:1085
UEqn
tmp< fvVectorMatrix > UEqn(fvm::div(phi, U)+MRF.DDt(U)+turbulence->divDevReff(U)==fvOptions(U))
Foam::GeometricField::internalField
InternalField & internalField()
Return internal field.
Definition: GeometricField.C:724
Foam::constant::electromagnetic::phi0
const dimensionedScalar phi0
Magnetic flux quantum: default SI units: [Wb].
Foam::regionModels::surfaceFilmModels::filmViscosityModel::New
static autoPtr< filmViscosityModel > New(surfaceFilmModel &owner, const dictionary &dict, volScalarField &mu)
Return a reference to the selected phase change model.
Definition: filmViscosityModelNew.C:40
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:41
Foam::TimeState::deltaTValue
scalar deltaTValue() const
Return time step value.
Definition: TimeState.H:100
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::resetPrimaryRegionSourceTerms
virtual void resetPrimaryRegionSourceTerms()
Reset source term fields.
Definition: kinematicSingleLayer.C:82
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::Ts_
volScalarField Ts_
Temperature - surface / [K].
Definition: thermoSingleLayer.H:103
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::solveMomentum
virtual tmp< fvVectorMatrix > solveMomentum(const volScalarField &pu, const volScalarField &pp)
Solve for film velocity.
Definition: kinematicSingleLayer.C:293
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::primaryMassPCTrans_
volScalarField primaryMassPCTrans_
Film mass evolved via phase change.
Definition: thermoSingleLayer.H:115
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::updateSubmodels
virtual void updateSubmodels()
Update the film sub-models.
Definition: thermoSingleLayer.C:232
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::T
virtual const volScalarField & T() const
Return the film mean temperature [K].
Definition: thermoSingleLayer.C:707
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:838
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::YPrimary_
PtrList< volScalarField > YPrimary_
List of specie mass fractions / [0-1].
Definition: thermoSingleLayer.H:163
fvm.H
Foam::regionModels::surfaceFilmModels::filmRadiationModel::New
static autoPtr< filmRadiationModel > New(surfaceFilmModel &owner, const dictionary &dict)
Return a reference to the selected phase change model.
Definition: filmRadiationModelNew.C:40
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::TPrimary_
volScalarField TPrimary_
Temperature / [K].
Definition: thermoSingleLayer.H:160
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::Srho
virtual tmp< DimensionedField< scalar, volMesh > > Srho() const
Return total mass source - Eulerian phase only.
Definition: thermoSingleLayer.C:750
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::Sh
virtual tmp< DimensionedField< scalar, volMesh > > Sh() const
Return enthalpy source - Eulerian phase only.
Definition: thermoSingleLayer.C:852
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::dimMass
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:49
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::nCorr_
label nCorr_
Number of PISO-like correctors.
Definition: kinematicSingleLayer.H:91
Foam::e
const double e
Elementary charge.
Definition: doubleFloat.H:94
Foam::indent
Ostream & indent(Ostream &os)
Indent stream.
Definition: Ostream.H:221
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:268
constants.H
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::preEvolveRegion
virtual void preEvolveRegion()
Pre-evolve film hook.
Definition: thermoSingleLayer.C:635
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::pu
virtual tmp< volScalarField > pu()
Explicit pressure source contribution.
Definition: kinematicSingleLayer.C:159
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::pSp_
volScalarField pSp_
Pressure / [Pa].
Definition: kinematicSingleLayer.H:166
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::phi_
surfaceScalarField phi_
Mass flux (includes film thickness) / [kg.m/s].
Definition: kinematicSingleLayer.H:141
Foam::regionModels::regionModel::primaryPatchIDs
const labelList & primaryPatchIDs() const
Return the list of patch IDs on the primary region coupled.
Definition: regionModelI.H:172
filmRadiationModel.H
Foam::GeometricField::correctBoundaryConditions
void correctBoundaryConditions()
Correct boundary field.
Definition: GeometricField.C:885
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::hsSpPrimary_
volScalarField hsSpPrimary_
Energy / [J/m2/s].
Definition: thermoSingleLayer.H:153
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::hs_
volScalarField hs_
Sensible enthalpy / [J/kg].
Definition: thermoSingleLayer.H:109
Foam::GeometricField::GeometricBoundaryField::types
wordList types() const
Return a list of the patch types.
Definition: GeometricBoundaryField.C:534
Foam::regionModels::surfaceFilmModels::defineTypeNameAndDebug
defineTypeNameAndDebug(kinematicSingleLayer, 0)
Foam::solve
SolverPerformance< Type > solve(fvMatrix< Type > &, const dictionary &)
Solve returning the solution statistics given convergence tolerance.
Foam::fvm::ddt
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvmDdt.C:46
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:49
Foam::regionModels::regionModel::time_
const Time & time_
Reference to the time database.
Definition: regionModel.H:90
fvcLaplacian.H
Calculate the laplacian of the given field.
Foam::readScalar
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
Definition: doubleScalar.H:63
Foam::mappedFieldFvPatchField
This boundary condition provides a self-contained version of the mapped condition....
Definition: mappedFieldFvPatchField.H:111
mapDistribute.H
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::alpha_
volScalarField alpha_
Film coverage indicator, 1 = covered, 0 = uncovered / [].
Definition: kinematicSingleLayer.H:126
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:607
Foam::Vector< scalar >
Foam::isA
bool isA(const Type &t)
Check if a dynamic_cast to typeid is possible.
Definition: typeInfo.H:134
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::rhoPrimary_
volScalarField rhoPrimary_
Density / [kg/m3].
Definition: kinematicSingleLayer.H:195
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
filmViscosityModel.H
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::kappa_
volScalarField kappa_
Thermal conductivity / [W/m/K].
Definition: thermoSingleLayer.H:97
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:161
timeName
word timeName
Definition: getTimeIndex.H:3
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::hydrophilic_
bool hydrophilic_
Activation flag.
Definition: thermoSingleLayer.H:128
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::thermoSingleLayer
thermoSingleLayer(const thermoSingleLayer &)
Disallow default bitwise copy construct.
Foam::regionModels::surfaceFilmModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(surfaceFilmModel, kinematicSingleLayer, mesh)
Foam::regionModels::surfaceFilmModels::heatTransferModel::New
static autoPtr< heatTransferModel > New(surfaceFilmModel &owner, const dictionary &dict)
Return a reference to the selected phase change model.
Definition: heatTransferModelNew.C:40
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::radiation_
autoPtr< filmRadiationModel > radiation_
Radiation.
Definition: thermoSingleLayer.H:182
Foam::dimTemperature
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:52
Foam::regionModels::regionModel::intCoupledPatchIDs_
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
Definition: regionModel.H:117
Foam::UIndirectList
A List with indirect addressing.
Definition: fvMatrix.H:106
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::correctAlpha
virtual void correctAlpha()
Correct film coverage field.
Definition: thermoSingleLayer.C:203
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::hydrophilicWetScale_
scalar hydrophilicWetScale_
Length scale applied to deltaWet_ to determine when a dry.
Definition: thermoSingleLayer.H:136
fvcDdt.H
Calculate the first temporal derivative.
Foam::fvc::ddt
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::Tw
virtual const volScalarField & Tw() const
Return the film wall temperature [K].
Definition: thermoSingleLayer.C:719
cells
const cellShapeList & cells
Definition: gmvOutputHeader.H:3
Foam::readBool
bool readBool(Istream &)
Definition: boolIO.C:60
Foam::List::size
void size(const label)
Override size to be inconsistent with allocated storage.
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::htcw_
autoPtr< heatTransferModel > htcw_
Heat transfer coefficient bewteen wall and film [W/m2/K].
Definition: thermoSingleLayer.H:176
Foam::gMin
Type gMin(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:563
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::Ts
virtual const volScalarField & Ts() const
Return the film surface temperature [K].
Definition: thermoSingleLayer.C:713
Foam::dimVolume
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:58
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::updateSubmodels
virtual void updateSubmodels()
Update the film sub-models.
Definition: kinematicSingleLayer.C:207
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::fvm::div
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvmDiv.C:46
Foam::IOobject::READ_IF_PRESENT
@ READ_IF_PRESENT
Definition: IOobject.H:110
zeroGradientFvPatchFields.H
Foam::regionModels::regionModel::intCoupledPatchIDs
const labelList & intCoupledPatchIDs() const
Return the list of patch IDs internally coupled with the.
Definition: regionModelI.H:179
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::rhoSp_
volScalarField rhoSp_
Mass / [kg/m2/s].
Definition: kinematicSingleLayer.H:169
Foam::gMax
Type gMax(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:562
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
phaseChangeModel.H
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::nOuterCorr_
label nOuterCorr_
Number of outer correctors.
Definition: kinematicSingleLayer.H:88
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::updateSurfaceTemperatures
virtual void updateSurfaceTemperatures()
Correct the film surface and wall temperatures.
Definition: thermoSingleLayer.C:126
Foam::regionModels::surfaceFilmModels::thermoSingleLayer::transferPrimaryRegionSourceFields
virtual void transferPrimaryRegionSourceFields()
Transfer source fields from the primary region to the film region.
Definition: thermoSingleLayer.C:165
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::regionModels::regionModel::regionMesh
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:61
Foam::pos
dimensionedScalar pos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:190