humidityTemperatureCoupledMixedFvPatchScalarField.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) 2015-2020 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
30 #include "fvPatchFieldMapper.H"
31 #include "volFields.H"
32 #include "surfaceFields.H"
33 #include "mappedPatchBase.H"
35 
36 // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
37 
38 const Foam::Enum
39 <
41 >
42 Foam::humidityTemperatureCoupledMixedFvPatchScalarField::massModeTypeNames_
43 ({
44  { massTransferMode::mtConstantMass, "constantMass" },
45  { massTransferMode::mtCondensation, "condensation" },
46  { massTransferMode::mtEvaporation, "evaporation" },
47  {
48  massTransferMode::mtCondensationAndEvaporation,
49  "condensationAndEvaporation"
50  },
51 });
52 
53 
54 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
55 
56 Foam::scalar Foam::humidityTemperatureCoupledMixedFvPatchScalarField::Sh
57 (
58  const scalar Re,
59  const scalar Sc
60 ) const
61 {
62  if (Re < 5.0E+05)
63  {
64  return 0.664*sqrt(Re)*cbrt(Sc);
65  }
66  else
67  {
68  return 0.037*pow(Re, 0.8)*cbrt(Sc);
69  }
70 }
71 
72 
73 Foam::scalar
74 Foam::humidityTemperatureCoupledMixedFvPatchScalarField::htcCondensation
75 (
76  const scalar Tsat,
77  const scalar Re
78 ) const
79 {
80  if (Tsat > 295 && Tsat < 373)
81  {
82  return 51104 + 2044*Tsat;
83  }
84  else
85  {
86  return 255510;
87  }
88 }
89 
90 
92 Foam::humidityTemperatureCoupledMixedFvPatchScalarField::thicknessField
93 (
94  const word& fieldName,
95  const fvMesh& mesh
96 )
97 {
99 
100  if (!ptr)
101  {
102  ptr = new volScalarField
103  (
104  IOobject
105  (
106  fieldName,
107  mesh.time().timeName(),
108  mesh,
111  ),
112  mesh,
114  );
115 
116  ptr->store();
117  }
118 
119  return *ptr;
120 }
121 
122 
123 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
124 
127 (
128  const fvPatch& p,
130 )
131 :
132  mixedFvPatchScalarField(p, iF),
134  (
135  patch(),
136  "fluidThermo",
137  "undefined",
138  "undefined-K",
139  "undefined-alpha"
140  ),
141  mode_(mtConstantMass),
142  pName_("p"),
143  UName_("U"),
144  rhoName_("rho"),
145  muName_("thermo:mu"),
146  TnbrName_("T"),
147  qrNbrName_("none"),
148  qrName_("none"),
149  specieName_("none"),
150  liquid_(nullptr),
151  liquidDict_(nullptr),
152  mass_(patch().size(), Zero),
153  Tvap_(0.0),
154  myKDelta_(patch().size(), Zero),
155  dmHfg_(patch().size(), Zero),
156  mpCpTp_(patch().size(), Zero),
157  Mcomp_(0.0),
158  L_(0.0),
159  fluid_(false),
160  cp_(patch().size(), Zero),
161  thickness_(patch().size(), Zero),
162  rho_(patch().size(), Zero)
163 {
164  this->refValue() = 0.0;
165  this->refGrad() = 0.0;
166  this->valueFraction() = 1.0;
167 }
168 
169 
172 (
174  const fvPatch& p,
176  const fvPatchFieldMapper& mapper
177 )
178 :
179  mixedFvPatchScalarField(psf, p, iF, mapper),
181  mode_(psf.mode_),
182  pName_(psf.pName_),
183  UName_(psf.UName_),
184  rhoName_(psf.rhoName_),
185  muName_(psf.muName_),
186  TnbrName_(psf.TnbrName_),
187  qrNbrName_(psf.qrNbrName_),
188  qrName_(psf.qrName_),
189  specieName_(psf.specieName_),
190  liquid_(psf.liquid_.clone()),
191  liquidDict_(psf.liquidDict_),
192  mass_(psf.mass_, mapper),
193  Tvap_(psf.Tvap_),
194  myKDelta_(psf.myKDelta_, mapper),
195  dmHfg_(psf.dmHfg_, mapper),
196  mpCpTp_(psf.mpCpTp_, mapper),
197  Mcomp_(psf.Mcomp_),
198  L_(psf.L_),
199  fluid_(psf.fluid_),
200  cp_(psf.cp_, mapper),
201  thickness_(psf.thickness_, mapper),
202  rho_(psf.rho_, mapper)
203 {}
204 
205 
208 (
209  const fvPatch& p,
211  const dictionary& dict
212 )
213 :
214  mixedFvPatchScalarField(p, iF),
216  mode_(mtCondensationAndEvaporation),
217  pName_(dict.getOrDefault<word>("p", "p")),
218  UName_(dict.getOrDefault<word>("U", "U")),
219  rhoName_(dict.getOrDefault<word>("rho", "rho")),
220  muName_(dict.getOrDefault<word>("mu", "thermo:mu")),
221  TnbrName_(dict.getOrDefault<word>("Tnbr", "T")),
222  qrNbrName_(dict.getOrDefault<word>("qrNbr", "none")),
223  qrName_(dict.getOrDefault<word>("qr", "none")),
224  specieName_(dict.getOrDefault<word>("specie", "none")),
225  liquid_(nullptr),
226  liquidDict_(),
227  mass_(patch().size(), Zero),
228  Tvap_(0.0),
229  myKDelta_(patch().size(), Zero),
230  dmHfg_(patch().size(), Zero),
231  mpCpTp_(patch().size(), Zero),
232  Mcomp_(0.0),
233  L_(0.0),
234  fluid_(false),
235  cp_(patch().size(), Zero),
236  thickness_(patch().size(), Zero),
237  rho_(patch().size(), Zero)
238 {
239  if (!isA<mappedPatchBase>(this->patch().patch()))
240  {
242  << "\n patch type '" << p.type()
243  << "' not type '" << mappedPatchBase::typeName << "'"
244  << "\n for patch " << p.name()
245  << " of field " << internalField().name()
246  << " in file " << internalField().objectPath()
247  << exit(FatalIOError);
248  }
249 
250  fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
251 
252  if (massModeTypeNames_.readIfPresent("mode", dict, mode_))
253  {
254  fluid_ = true;
255  }
256 
257  if (fluid_)
258  {
259  switch(mode_)
260  {
261  case mtConstantMass:
262  {
263  thickness_ = scalarField("thickness", dict, p.size());
264  cp_ = scalarField("cp", dict, p.size());
265  rho_ = scalarField("rho", dict, p.size());
266 
267  break;
268  }
269  case mtCondensation:
270  case mtEvaporation:
271  case mtCondensationAndEvaporation:
272  {
273  dict.readEntry("carrierMolWeight", Mcomp_);
274  dict.readEntry("L", L_);
275  dict.readEntry("Tvap", Tvap_);
276  liquidDict_ = dict.subDict("liquid");
277  liquid_ =
278  liquidProperties::New(liquidDict_.subDict(specieName_));
279 
280  if (dict.found("thickness"))
281  {
282  scalarField& Tp = *this;
283  const scalarField& magSf = patch().magSf();
284 
285  // Assume initially standard pressure for rho calculation
286  scalar pf = 1e5;
287  thickness_ = scalarField("thickness", dict, p.size());
288  forAll(thickness_, i)
289  {
290  mass_[i] =
291  thickness_[i]*liquid_->rho(pf, Tp[i])*magSf[i];
292  }
293  }
294  fluid_ = true;
295 
296  break;
297  }
298  default:
299  {
301  << "Did not find mode " << mode_
302  << " on patch " << patch().name()
303  << nl
304  << "Please set 'mode' to one of "
305  << massModeTypeNames_.sortedToc()
306  << exit(FatalIOError);
307  }
308  }
309  }
310 
311 
312 
313  if (dict.found("refValue"))
314  {
315  // Full restart
316  refValue() = scalarField("refValue", dict, p.size());
317  refGrad() = scalarField("refGradient", dict, p.size());
318  valueFraction() = scalarField("valueFraction", dict, p.size());
319  }
320  else
321  {
322  // Start from user entered data. Assume fixedValue.
323  refValue() = *this;
324  refGrad() = 0.0;
325  valueFraction() = 1.0;
326  }
327 }
328 
329 
332 (
335 )
336 :
337  mixedFvPatchScalarField(psf, iF),
339  mode_(psf.mode_),
340  pName_(psf.pName_),
341  UName_(psf.UName_),
342  rhoName_(psf.rhoName_),
343  muName_(psf.muName_),
344  TnbrName_(psf.TnbrName_),
345  qrNbrName_(psf.qrNbrName_),
346  qrName_(psf.qrName_),
347  specieName_(psf.specieName_),
348  liquid_(psf.liquid_.clone()),
349  liquidDict_(psf.liquidDict_),
350  mass_(psf.mass_),
351  Tvap_(psf.Tvap_),
352  myKDelta_(psf.myKDelta_),
353  dmHfg_(psf.dmHfg_),
354  mpCpTp_(psf.mpCpTp_),
355  Mcomp_(psf.Mcomp_),
356  L_(psf.L_),
357  fluid_(psf.fluid_),
358  cp_(psf.cp_),
359  thickness_(psf.thickness_),
360  rho_(psf.rho_)
361 {}
362 
363 
364 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
365 
367 (
368  const fvPatchFieldMapper& m
369 )
370 {
371  mixedFvPatchScalarField::autoMap(m);
372 
373  if (fluid_)
374  {
375  mass_.autoMap(m);
376  myKDelta_.autoMap(m);
377  dmHfg_.autoMap(m);
378  mpCpTp_.autoMap(m);
379  cp_.autoMap(m);
380  thickness_.autoMap(m);
381  rho_.autoMap(m);
382  }
383 }
384 
385 
387 (
388  const fvPatchScalarField& ptf,
389  const labelList& addr
390 )
391 {
392  mixedFvPatchScalarField::rmap(ptf, addr);
393 
395  refCast<const humidityTemperatureCoupledMixedFvPatchScalarField>
396  (
397  ptf
398  );
399 
400  if (fluid_)
401  {
402  mass_.rmap(tiptf.mass_, addr);
403  myKDelta_.rmap(tiptf.myKDelta_, addr);
404  dmHfg_.rmap(tiptf.dmHfg_, addr);
405  mpCpTp_.rmap(tiptf.mpCpTp_, addr);
406  cp_.rmap(tiptf.cp_, addr);
407  thickness_.rmap(tiptf.thickness_, addr);
408  rho_.rmap(tiptf.rho_, addr);
409  }
410 }
411 
412 
414 {
415  if (updated())
416  {
417  return;
418  }
419 
420  // Get the coupling information from the mappedPatchBase
421  const mappedPatchBase& mpp =
422  refCast<const mappedPatchBase>(patch().patch());
423 
424  const scalarField& magSf = patch().magSf();
425 
426  const label nbrPatchI = mpp.samplePolyPatch().index();
427  const polyMesh& mesh = patch().boundaryMesh().mesh();
428  const polyMesh& nbrMesh = mpp.sampleMesh();
429  const fvPatch& nbrPatch =
430  refCast<const fvMesh>(nbrMesh).boundary()[nbrPatchI];
431 
433  nbrField =
434  refCast
435  <
437  >
438  (
439  nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
440  );
441 
442  // Swap to obtain full local values of neighbour internal field
443  scalarField nbrIntFld(nbrField.patchInternalField());
444  mpp.distribute(nbrIntFld);
445 
446 
447  scalarField& Tp = *this;
448 
449  const volScalarField& T =
450  static_cast<const volScalarField&>(internalField());
451 
452  const scalarField TpOld(T.oldTime().boundaryField()[patch().index()]);
453 
454  scalarField Tin(patchInternalField());
455 
456  const scalarField K(this->kappa(*this));
457 
458  // Neighbour kappa done separately because we need kappa solid for the
459  // htc correlation
460  scalarField nbrK(nbrField.kappa(*this));
461  mpp.distribute(nbrK);
462 
463  scalarField nrbDeltaCoeffs(nbrPatch.deltaCoeffs());
464  mpp.distribute(nrbDeltaCoeffs);
465 
466  scalarField KDeltaNbr(nbrField.kappa(*this)*nbrPatch.deltaCoeffs());
467  mpp.distribute(KDeltaNbr);
468 
469  myKDelta_ = K*patch().deltaCoeffs();
470 
471  scalarField dm(patch().size(), Zero);
472 
473  // Fluid Side
474  if (fluid_)
475  {
476  scalarField Yvp(patch().size(), Zero);
477  const scalar dt = mesh.time().deltaTValue();
478 
479  const scalarField myDelta(patch().deltaCoeffs());
480 
481  if (mode_ != mtConstantMass)
482  {
483  scalarField cp(patch().size(), Zero);
484  scalarField hfg(patch().size(), Zero);
485  scalarField htc(patch().size(), GREAT);
486  scalarField liquidRho(patch().size(), Zero);
487 
490  (
491  refCast
492  <
494  >
495  (
496  patch().lookupPatchField<volScalarField, scalar>
497  (
498  specieName_
499  )
500  )
501  );
502 
503  const fvPatchScalarField& pp =
504  patch().lookupPatchField<volScalarField, scalar>(pName_);
505 
506  const fvPatchVectorField& Up =
507  patch().lookupPatchField<volVectorField, vector>(UName_);
508 
509  const fvPatchScalarField& rhop =
510  patch().lookupPatchField<volScalarField, scalar>(rhoName_);
511 
512  const fvPatchScalarField& mup =
513  patch().lookupPatchField<volScalarField, scalar>(muName_);
514 
515  const vectorField Ui(Up.patchInternalField());
516  const scalarField Yi(Yp.patchInternalField());
517 
518  forAll(Tp, faceI)
519  {
520  const scalar Tf = Tp[faceI];
521  const scalar Tint = Tin[faceI];
522  const vector Uf = Ui[faceI];
523  const scalar pf = pp[faceI];
524 
525  const scalar muf = mup[faceI];
526  const scalar rhof = rhop[faceI];
527  const scalar nuf = muf/rhof;
528  const scalar pSat = liquid_->pv(pf, Tint);
529  const scalar Mv = liquid_->W();
530  const scalar TSat = liquid_->pvInvert(pSat);
531  const scalar Re = mag(Uf)*L_/nuf;
532 
533  cp[faceI] = liquid_->Cp(pf, Tf);
534  hfg[faceI] = liquid_->hl(pf, Tf);
535 
536  // Calculate relative humidity
537  const scalar invMwmean =
538  Yi[faceI]/Mv + (1.0 - Yi[faceI])/Mcomp_;
539  const scalar Xv = Yi[faceI]/invMwmean/Mv;
540  const scalar RH = min(Xv*pf/pSat, 1.0);
541 
542  scalar RHmin = 0.01;
543  scalar Tdew = -GREAT;
544 
545  if (RH > RHmin)
546  {
547  scalar b = 243.5;
548  scalar c = 17.65;
549  scalar TintDeg = Tint - 273;
550  Tdew =
551  b*(log(RH) + (c*TintDeg)/(b + TintDeg))
552  /(c - log(RH) - ((c*TintDeg)/(b + TintDeg))) + 273;
553  }
554 
555  if
556  (
557  Tf < Tdew
558  && RH > RHmin
559  && (
560  mode_ == mtCondensation
561  || mode_ == mtCondensationAndEvaporation
562  )
563  )
564  {
565  htc[faceI] = htcCondensation(TSat, Re)*nbrK[faceI]/L_;
566 
567  scalar htcTotal =
568  1.0/((1.0/myKDelta_[faceI]) + (1.0/htc[faceI]));
569 
570  // Heat flux [W] (>0 heat is converted into mass)
571  const scalar q = (Tint - Tf)*htcTotal*magSf[faceI];
572 
573  // Mass flux rate [Kg/s/m2]
574  dm[faceI] = q/hfg[faceI]/magSf[faceI];
575 
576  mass_[faceI] += q/hfg[faceI]*dt;
577 
578  // -dYp/dn = q/Dab (fixedGradient)
579  const scalar Dab = liquid_->D(pf, Tf);
580  Yvp[faceI] =
581  -min(dm[faceI]/Dab/rhof, Yi[faceI]*myDelta[faceI]);
582  }
583  else if
584  (
585  Tf > Tvap_
586  && mass_[faceI] > 0.0
587  && (
588  mode_ == mtEvaporation
589  || mode_ == mtCondensationAndEvaporation
590  )
591  )
592  {
593  const scalar Dab = liquid_->D(pf, Tf);
594 
595  const scalar Sc = nuf/Dab;
596  const scalar Sh = this->Sh(Re, Sc);
597 
598  const scalar Ys = Mv*pSat/(Mv*pSat + Mcomp_*(pf - pSat));
599 
600  // Mass transfer coefficient [m/s]
601  const scalar hm = Dab*Sh/L_;
602 
603  const scalar Yinf = max(Yi[faceI], 0.0);
604 
605  // Mass flux rate [Kg/s/m2]
606  dm[faceI] = -rhof*hm*max((Ys - Yinf), 0.0)/(1.0 - Ys);
607 
608  // Set fixedGradient for carrier species.
609  Yvp[faceI] = -dm[faceI]/Dab/rhof;
610 
611  // Total mass accumulated [Kg]
612  mass_[faceI] += dm[faceI]*magSf[faceI]*dt;
613 
614  htc[faceI] = htcCondensation(TSat, Re)*nbrK[faceI]/L_;
615  }
616  else if (Tf > Tdew && Tf < Tvap_ && mass_[faceI] > 0.0)
617  {
618  htc[faceI] = htcCondensation(TSat, Re)*nbrK[faceI]/L_;
619  }
620  else if (mass_[faceI] == 0.0)
621  {
622  // Do nothing
623  }
624 
625  liquidRho[faceI] = liquid_->rho(pf, Tf);
626  }
627 
628  mass_ = max(mass_, scalar(0));
629 
630  Yp.gradient() = Yvp;
631 
632  // Output film delta (e.g. H2OThickness) [m]
633  const word fieldName(specieName_ + "Thickness");
634 
635  scalarField& pDelta =
636  thicknessField
637  (
638  fieldName,
639  refCast<const fvMesh>(mesh)
640  ).boundaryFieldRef()[patch().index()];
641 
642 
643  pDelta = mass_/liquidRho/magSf;
644 
645  // Weight myKDelta and htc
646  myKDelta_ = 1.0/((1.0/myKDelta_) + (1.0/htc));
647 
648  mpCpTp_ = mass_*cp/dt/magSf;
649 
650  // Heat flux due to change of phase [W/m2]
651  dmHfg_ = dm*hfg;
652  }
653  else
654  {
655  // Inertia term [W/K/m2]
656  mpCpTp_ = thickness_*rho_*cp_/dt;
657  }
658  }
659 
660  scalarField mpCpTpNbr(patch().size(), Zero);
661  scalarField dmHfgNbr(patch().size(), Zero);
662 
663  if (!fluid_)
664  {
665  mpCpTpNbr = nbrField.mpCpTp();
666  mpp.distribute(mpCpTpNbr);
667 
668  dmHfgNbr = nbrField.dmHfg();
669  mpp.distribute(dmHfgNbr);
670  }
671 
672  // Obtain Rad heat (qr)
673  scalarField qr(Tp.size(), Zero);
674  if (qrName_ != "none")
675  {
676  qr = patch().lookupPatchField<volScalarField, scalar>(qrName_);
677  }
678 
679  scalarField qrNbr(Tp.size(), Zero);
680  if (qrNbrName_ != "none")
681  {
682  qrNbr = nbrPatch.lookupPatchField<volScalarField, scalar>(qrNbrName_);
683  mpp.distribute(qrNbr);
684  }
685 
686  const scalarField dmHfg(dmHfgNbr + dmHfg_);
687 
688  const scalarField mpCpdt(mpCpTpNbr + mpCpTp_);
689 
690  // qr > 0 (heat up the wall)
691  scalarField alpha(KDeltaNbr + mpCpdt - (qr + qrNbr)/Tp);
692 
693  valueFraction() = alpha/(alpha + myKDelta_);
694 
695  refValue() = (KDeltaNbr*nbrIntFld + mpCpdt*TpOld + dmHfg)/alpha;
696 
697  mixedFvPatchScalarField::updateCoeffs();
698 
699  if (debug && fluid_)
700  {
701  scalar Qdm = gSum(dm);
702  scalar QMass = gSum(mass_);
703  scalar Qt = gSum(myKDelta_*(Tp - Tin)*magSf);
704  scalar QtSolid = gSum(KDeltaNbr*(Tp - nbrIntFld)*magSf);
705 
706  Info<< mesh.name() << ':'
707  << patch().name() << ':'
708  << internalField().name() << " <- "
709  << nbrMesh.name() << ':'
710  << nbrPatch.name() << ':'
711  << internalField().name() << " :" << nl
712  << " Total mass flux [Kg/s] : " << Qdm << nl
713  << " Total mass on the wall [Kg] : " << QMass << nl
714  << " Total heat (>0 leaving the wall to the fluid) [W] : "
715  << Qt << nl
716  << " Total heat (>0 leaving the wall to the solid) [W] : "
717  << QtSolid << nl
718  << " wall temperature "
719  << " min:" << gMin(*this)
720  << " max:" << gMax(*this)
721  << " avg:" << gAverage(*this)
722  << endl;
723  }
724 }
725 
726 
728 (
729  Ostream& os
730 ) const
731 {
733  os.writeEntryIfDifferent<word>("p", "p", pName_);
734  os.writeEntryIfDifferent<word>("U", "U", UName_);
735  os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
736  os.writeEntryIfDifferent<word>("mu", "thermo:mu", muName_);
737  os.writeEntryIfDifferent<word>("Tnbr", "T", TnbrName_);
738  os.writeEntryIfDifferent<word>("qrNbr", "none", qrNbrName_);
739  os.writeEntryIfDifferent<word>("qr", "none", qrName_);
740 
741  if (fluid_)
742  {
743  os.writeEntry("mode", massModeTypeNames_[mode_]);
744 
745  os.writeEntryIfDifferent<word>("specie", "none", specieName_);
746 
747  os.writeEntry("carrierMolWeight", Mcomp_);
748 
749  os.writeEntry("L", L_);
750  os.writeEntry("Tvap", Tvap_);
751  os.writeEntry("fluid", fluid_);
752  mass_.writeEntry("mass", os);
753 
754  if (mode_ == mtConstantMass)
755  {
756  cp_.writeEntry("cp", os);
757  rho_.writeEntry("rho", os);
758  }
759 
760  thickness_.writeEntry("thickness", os);
761  word liq = "liquid";
762  os << token::TAB << token::TAB << liq;
763  liquidDict_.write(os);
764  }
765 
767 }
768 
769 
770 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
771 
772 namespace Foam
773 {
775  (
778  );
779 }
780 
781 
782 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::fvPatchField< scalar >
volFields.H
Foam::objectRegistry::getObjectPtr
Type * getObjectPtr(const word &name, const bool recursive=false) const
Definition: objectRegistryTemplates.C:423
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mpCpTp
const scalarField mpCpTp() const
Return mpCpTp.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:396
Foam::Ostream::writeEntryIfDifferent
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
Definition: Ostream.H:244
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:52
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::Enum
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: IOstreamOption.H:57
Foam::IOobject::AUTO_WRITE
Definition: IOobject.H:129
Foam::IOobject::name
const word & name() const
Return name.
Definition: IOobjectI.H:70
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::dimLength
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:53
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::liquidProperties::New
static autoPtr< liquidProperties > New(const word &name)
Return a pointer to a new liquidProperties created from name.
Definition: liquidProperties.C:91
Foam::dictionary::found
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
Definition: dictionary.C:364
Foam::gAverage
Type gAverage(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:604
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::mappedPatchBase::samplePolyPatch
const polyPatch & samplePolyPatch() const
Get the patch on the region.
Definition: mappedPatchBase.C:1619
Foam::Time::timeName
static word timeName(const scalar t, const int precision=precision_)
Definition: Time.C:780
Uf
autoPtr< surfaceVectorField > Uf
Definition: createUfIfPresent.H:33
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:367
Foam::temperatureCoupledBase
Common functions used in temperature coupled boundaries.
Definition: temperatureCoupledBase.H:110
Foam::FatalIOError
IOerror FatalIOError
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
surfaceFields.H
Foam::surfaceFields.
fvPatchFieldMapper.H
Foam::gSum
Type gSum(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:594
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:728
Foam::fvPatch::name
virtual const word & name() const
Return name.
Definition: fvPatch.H:167
Foam::mappedPatchBase
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
Definition: mappedPatchBase.H:112
Foam::constant::electromagnetic::kappa
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Foam::fixedGradientFvPatchField::gradient
virtual Field< Type > & gradient()
Return gradient at boundary.
Definition: fixedGradientFvPatchField.H:190
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:58
Foam::mappedPatchBase::sampleMesh
const polyMesh & sampleMesh() const
Get the region mesh.
Definition: mappedPatchBase.C:1606
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
Foam::Field< scalar >
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::dmHfg
const scalarField dmHfg() const
Return dmHfg.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:402
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::humidityTemperatureCoupledMixedFvPatchScalarField
humidityTemperatureCoupledMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:127
Foam::mappedPatchBase::distribute
void distribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
Definition: mappedPatchBaseTemplates.C:29
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary::subDict
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Definition: dictionary.C:528
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::fvPatchField::patchInternalField
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch as patch field.
Definition: fvPatchField.C:225
Foam::dictionary::readEntry
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
Definition: dictionaryTemplates.C:314
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:43
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:413
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
humidityTemperatureCoupledMixedFvPatchScalarField.H
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:75
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
Foam::fvPatch::lookupPatchField
const GeometricField::Patch & lookupPatchField(const word &name, const GeometricField *=nullptr, const Type *=nullptr) const
Definition: fvPatchFvMeshTemplates.C:34
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::log
dimensionedScalar log(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:262
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::refCast
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:131
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
fixedGradientFvPatchFields.H
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::rmap
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:387
Foam::cp
bool cp(const fileName &src, const fileName &dst, const bool followLink=true)
Copy the source to the destination (recursively if necessary).
Definition: MSwindows.C:802
Foam::nl
constexpr char nl
Definition: Ostream.H:385
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::Vector< scalar >
Foam::TimeState::deltaTValue
scalar deltaTValue() const
Return time step value.
Definition: TimeStateI.H:42
Foam::List< label >
Foam::sqrt
dimensionedScalar sqrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:144
Foam::token::TAB
Tab [isspace].
Definition: token.H:118
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::fvPatch::deltaCoeffs
const scalarField & deltaCoeffs() const
Definition: fvPatch.C:190
Foam::temperatureCoupledBase::kappa
virtual tmp< scalarField > kappa(const scalarField &Tp) const
Given patch temperature calculate corresponding K field.
Definition: temperatureCoupledBase.C:138
Foam::Re
scalarField Re(const UList< complex > &cf)
Extract real component.
Definition: complexField.C:159
Foam::Ostream::writeEntry
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Definition: Ostream.H:232
Foam::vtk::write
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Definition: foamVtkOutputTemplates.C:35
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:275
FatalIOErrorInFunction
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:401
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::temperatureCoupledBase::write
void write(Ostream &os) const
Write.
Definition: temperatureCoupledBase.C:426
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::makePatchTypeField
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Foam::gMin
Type gMin(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:593
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::massTransferMode
massTransferMode
Modes of mass transfer.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:202
Foam::cbrt
dimensionedScalar cbrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:155
Foam::fixedGradientFvPatchField
This boundary condition supplies a fixed gradient condition, such that the patch values are calculate...
Definition: fixedGradientFvPatchField.H:108
rhof
surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)"))
Foam::dictionary::getOrDefault
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:122
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::IOobject::NO_READ
Definition: IOobject.H:123
Foam::humidityTemperatureCoupledMixedFvPatchScalarField
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:192
Foam::fvPatchField< scalar >::operator=
virtual void operator=(const UList< scalar > &)
Definition: fvPatchField.C:379
Foam::patchIdentifier::index
label index() const
The index of this patch in the boundaryMesh.
Definition: patchIdentifier.H:158
Foam::gMax
Type gMax(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:592
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::name
const word & name() const
Return reference to name.
Definition: fvMesh.H:295
mappedPatchBase.H