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 | Copyright (C) 2015 OpenCFD Ltd.
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 
28 #include "fvPatchFieldMapper.H"
29 #include "volFields.H"
30 #include "surfaceFields.H"
31 #include "mappedPatchBase.H"
33 
34 // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38  template<>
39  const char* Foam::NamedEnum
40  <
41  Foam::
44  4
45  >::names[] =
46  {
47  "constantMass",
48  "condensation",
49  "evaporation",
50  "condensationAndEvaporation"
51  };
52 }
53 
54 const Foam::NamedEnum
55 <
57  4
59 
60 
61 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
62 
64 (
65  const scalar Re,
66  const scalar Sc
67 ) const
68 {
69  if (Re < 5.0E+05)
70  {
71  return 0.664*sqrt(Re)*cbrt(Sc);
72  }
73  else
74  {
75  return 0.037*pow(Re, 0.8)*cbrt(Sc);
76  }
77 }
78 
79 
80 Foam::scalar
82 (
83  const scalar Tsat,
84  const scalar Re
85 ) const
86 {
87  if (Tsat > 295 && Tsat < 373)
88  {
89  return 51104 + 2044*Tsat;
90  }
91  else
92  {
93  return 255510;
94  }
95 }
96 
97 
100 (
101  const word& fieldName,
102  const fvMesh& mesh
103 )
104 {
105  if (!mesh.foundObject<volScalarField>(fieldName))
106  {
107  tmp<volScalarField> tField
108  (
109  new volScalarField
110  (
111  IOobject
112  (
113  fieldName,
114  mesh.time().timeName(),
115  mesh,
116  IOobject::NO_READ,
117  IOobject::AUTO_WRITE
118  ),
119  mesh,
120  dimensionedScalar("zero", dimLength, 0.0)
121  )
122  );
123 
124  tField.ptr()->store();
125  }
126 
127  return
128  const_cast<volScalarField&>
129  (
130  mesh.lookupObject<volScalarField>(fieldName)
131  );
132 }
133 
134 
135 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
136 
139 (
140  const fvPatch& p,
142 )
143 :
144  mixedFvPatchScalarField(p, iF),
145  temperatureCoupledBase(patch(), "fluidThermo", "undefined", "undefined-K"),
146  mode_(mtConstantMass),
147  pName_("p"),
148  UName_("U"),
149  rhoName_("rho"),
150  muName_("thermo:mu"),
151  TnbrName_("T"),
152  QrNbrName_("none"),
153  QrName_("none"),
154  specieName_("none"),
155  liquid_(NULL),
156  liquidDict_(NULL),
157  mass_(patch().size(), 0.0),
158  Tvap_(0.0),
159  myKDelta_(patch().size(), 0.0),
160  dmHfg_(patch().size(), 0.0),
161  mpCpTp_(patch().size(), 0.0),
162  Mcomp_(0.0),
163  L_(0.0),
164  fluid_(false),
165  cp_(patch().size(), 0.0),
166  thickness_(patch().size(), 0.0),
167  rho_(patch().size(), 0.0)
168 {
169  this->refValue() = 0.0;
170  this->refGrad() = 0.0;
171  this->valueFraction() = 1.0;
172 }
173 
174 
177 (
179  const fvPatch& p,
181  const fvPatchFieldMapper& mapper
182 )
183 :
184  mixedFvPatchScalarField(psf, p, iF, mapper),
185  temperatureCoupledBase(patch(), psf),
186  mode_(psf.mode_),
187  pName_(psf.pName_),
188  UName_(psf.UName_),
189  rhoName_(psf.rhoName_),
190  muName_(psf.muName_),
191  TnbrName_(psf.TnbrName_),
192  QrNbrName_(psf.QrNbrName_),
193  QrName_(psf.QrName_),
194  specieName_(psf.specieName_),
195  liquid_(psf.liquid_),
196  liquidDict_(psf.liquidDict_),
197  mass_(psf.mass_, mapper),
198  Tvap_(psf.Tvap_),
199  myKDelta_(psf.myKDelta_, mapper),
200  dmHfg_(psf.dmHfg_, mapper),
201  mpCpTp_(psf.mpCpTp_, mapper),
202  Mcomp_(psf.Mcomp_),
203  L_(psf.L_),
204  fluid_(psf.fluid_),
205  cp_(psf.cp_, mapper),
206  thickness_(psf.thickness_, mapper),
207  rho_(psf.rho_, mapper)
208 {}
209 
210 
213 (
214  const fvPatch& p,
216  const dictionary& dict
217 )
218 :
219  mixedFvPatchScalarField(p, iF),
220  temperatureCoupledBase(patch(), dict),
221  mode_(mtCondensationAndEvaporation),
222  pName_(dict.lookupOrDefault<word>("p", "p")),
223  UName_(dict.lookupOrDefault<word>("U", "U")),
224  rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
225  muName_(dict.lookupOrDefault<word>("mu", "thermo:mu")),
226  TnbrName_(dict.lookupOrDefault<word>("Tnbr", "T")),
227  QrNbrName_(dict.lookupOrDefault<word>("QrNbr", "none")),
228  QrName_(dict.lookupOrDefault<word>("Qr", "none")),
229  specieName_(dict.lookupOrDefault<word>("specieName", "none")),
230  liquid_(NULL),
231  liquidDict_(),
232  mass_(patch().size(), 0.0),
233  Tvap_(0.0),
234  myKDelta_(patch().size(), 0.0),
235  dmHfg_(patch().size(), 0.0),
236  mpCpTp_(patch().size(), 0.0),
237  Mcomp_(0.0),
238  L_(0.0),
239  fluid_(false),
240  cp_(patch().size(), 0.0),
241  thickness_(patch().size(), 0.0),
242  rho_(patch().size(), 0.0)
243 {
244  if (!isA<mappedPatchBase>(this->patch().patch()))
245  {
247  << "\n patch type '" << p.type()
248  << "' not type '" << mappedPatchBase::typeName << "'"
249  << "\n for patch " << p.name()
250  << " of field " << dimensionedInternalField().name()
251  << " in file " << dimensionedInternalField().objectPath()
252  << exit(FatalIOError);
253  }
254 
255  fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
256 
257  if (dict.found("mode"))
258  {
259  mode_ = massModeTypeNames_.read(dict.lookup("mode"));
260  fluid_ = true;
261  }
262 
263  if (fluid_)
264  {
265  switch(mode_)
266  {
267  case mtConstantMass:
268  {
269  thickness_ = scalarField("thickness", dict, p.size());
270  cp_ = scalarField("cp", dict, p.size());
271  rho_ = scalarField("rho", dict, p.size());
272 
273  break;
274  }
275  case mtCondensation:
276  case mtEvaporation:
277  case mtCondensationAndEvaporation:
278  {
279  Mcomp_ = readScalar(dict.lookup("carrierMolWeight"));
280  L_ = readScalar(dict.lookup("L"));
281  Tvap_ = readScalar(dict.lookup("Tvap"));
282  liquidDict_ = dict.subDict("liquid");
283  liquid_ =
284  liquidProperties::New(liquidDict_.subDict(specieName_));
285 
286  if (dict.found("thickness"))
287  {
288  scalarField& Tp = *this;
289  const scalarField& magSf = patch().magSf();
290 
291  // Assume initially standard pressure for rho calculation
292  scalar pf = 1e5;
293  thickness_ = scalarField("thickness", dict, p.size());
294  forAll(thickness_, i)
295  {
296  mass_[i] =
297  thickness_[i]*liquid_->rho(pf, Tp[i])*magSf[i];
298  }
299  }
300  fluid_ = true;
301 
302  break;
303  }
304  default:
305  {
307  << "Did not find mode " << mode_
308  << " on patch " << patch().name()
309  << nl
310  << "Please set 'mode' to one of "
311  << massModeTypeNames_.sortedToc()
312  << exit(FatalIOError);
313  }
314  }
315  }
316 
317 
318 
319  if (dict.found("refValue"))
320  {
321  // Full restart
322  refValue() = scalarField("refValue", dict, p.size());
323  refGrad() = scalarField("refGradient", dict, p.size());
324  valueFraction() = scalarField("valueFraction", dict, p.size());
325  }
326  else
327  {
328  // Start from user entered data. Assume fixedValue.
329  refValue() = *this;
330  refGrad() = 0.0;
331  valueFraction() = 1.0;
332  }
333 }
334 
335 
338 (
341 )
342 :
343  mixedFvPatchScalarField(psf, iF),
344  temperatureCoupledBase(patch(), psf),
345  mode_(psf.mode_),
346  pName_(psf.pName_),
347  UName_(psf.UName_),
348  rhoName_(psf.rhoName_),
349  muName_(psf.muName_),
350  TnbrName_(psf.TnbrName_),
351  QrNbrName_(psf.QrNbrName_),
352  QrName_(psf.QrName_),
353  specieName_(psf.specieName_),
354  liquid_(psf.liquid_),
355  liquidDict_(psf.liquidDict_),
356  mass_(psf.mass_),
357  Tvap_(psf.Tvap_),
358  myKDelta_(psf.myKDelta_),
359  dmHfg_(psf.dmHfg_),
360  mpCpTp_(psf.mpCpTp_),
361  Mcomp_(psf.Mcomp_),
362  L_(psf.L_),
363  fluid_(psf.fluid_),
364  cp_(psf.cp_),
365  thickness_(psf.thickness_),
366  rho_(psf.rho_)
367 {}
368 
369 
370 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
371 
373 (
374  const fvPatchFieldMapper& m
375 )
376 {
377  mixedFvPatchScalarField::autoMap(m);
378 
379  if (fluid_)
380  {
381  mass_.autoMap(m);
382  myKDelta_.autoMap(m);
383  dmHfg_.autoMap(m);
384  mpCpTp_.autoMap(m);
385  cp_.autoMap(m);
386  thickness_.autoMap(m);
387  rho_.autoMap(m);
388  }
389 }
390 
391 
393 (
394  const fvPatchScalarField& ptf,
395  const labelList& addr
396 )
397 {
398  mixedFvPatchScalarField::rmap(ptf, addr);
399 
401  refCast<const humidityTemperatureCoupledMixedFvPatchScalarField>
402  (
403  ptf
404  );
405 
406  if (fluid_)
407  {
408  mass_.rmap(tiptf.mass_, addr);
409  myKDelta_.rmap(tiptf.myKDelta_, addr);
410  dmHfg_.rmap(tiptf.dmHfg_, addr);
411  mpCpTp_.rmap(tiptf.mpCpTp_, addr);
412  cp_.rmap(tiptf.cp_, addr);
413  thickness_.rmap(tiptf.thickness_, addr);
414  rho_.rmap(tiptf.rho_, addr);
415  }
416 }
417 
418 
420 {
421  if (updated())
422  {
423  return;
424  }
425 
426  // Get the coupling information from the mappedPatchBase
427  const mappedPatchBase& mpp =
428  refCast<const mappedPatchBase>(patch().patch());
429 
430  const scalarField& magSf = patch().magSf();
431 
432  const label nbrPatchI = mpp.samplePolyPatch().index();
433  const polyMesh& mesh = patch().boundaryMesh().mesh();
434  const polyMesh& nbrMesh = mpp.sampleMesh();
435  const fvPatch& nbrPatch =
436  refCast<const fvMesh>(nbrMesh).boundary()[nbrPatchI];
437 
439  nbrField =
440  refCast
441  <
443  >
444  (
445  nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
446  );
447 
448  // Swap to obtain full local values of neighbour internal field
449  scalarField nbrIntFld(nbrField.patchInternalField());
450  mpp.distribute(nbrIntFld);
451 
452  scalarField& Tp = *this;
453  scalarField Tin(patchInternalField());
454 
455  const scalarField K(this->kappa(*this));
456 
457  // Neighbour kappa done separately because we need kappa solid for the
458  // htc correlation
459  scalarField nbrK(nbrField.kappa(*this));
460  mpp.distribute(nbrK);
461 
462  scalarField nrbDeltaCoeffs(nbrPatch.deltaCoeffs());
463  mpp.distribute(nrbDeltaCoeffs);
464 
465  scalarField KDeltaNbr(nbrK*nrbDeltaCoeffs);
466 
467  myKDelta_ = K*patch().deltaCoeffs();
468 
469  scalarField dm(patch().size(), 0.0);
470 
471  // Fluid Side
472  if (fluid_)
473  {
474  scalarField Yvp(patch().size(), 0.0);
475  const scalar dt = mesh.time().deltaTValue();
476 
477  const scalarField myDelta(patch().deltaCoeffs());
478 
479  if (mode_ != mtConstantMass)
480  {
481  scalarField cp(patch().size(), 0.0);
482  scalarField hfg(patch().size(), 0.0);
483  scalarField htc(patch().size(), GREAT);
484  scalarField liquidRho(patch().size(), 0.0);
485 
488  (
489  refCast
490  <
492  >
493  (
494  patch().lookupPatchField<volScalarField, scalar>
495  (
497  )
498  )
499  );
500 
501  const fvPatchScalarField& pp =
502  patch().lookupPatchField<volScalarField, scalar>(pName_);
503 
504  const fvPatchVectorField& Up =
505  patch().lookupPatchField<volVectorField, vector>(UName_);
506 
507  const fvPatchScalarField& rhop =
508  patch().lookupPatchField<volScalarField, scalar>(rhoName_);
509 
510  const fvPatchScalarField& mup =
511  patch().lookupPatchField<volScalarField, scalar>(muName_);
512 
513  const vectorField Ui(Up.patchInternalField());
514  const scalarField Yi(Yp.patchInternalField());
515 
516  forAll(Tp, faceI)
517  {
518  const scalar Tf = Tp[faceI];
519  const scalar Tint = Tin[faceI];
520  const vector Uf = Ui[faceI];
521  const scalar pf = pp[faceI];
522 
523  const scalar muf = mup[faceI];
524  const scalar rhof = rhop[faceI];
525  const scalar nuf = muf/rhof;
526  const scalar pSat = liquid_->pv(pf, Tint);
527  const scalar Mv = liquid_->W();
528  const scalar TSat = liquid_->pvInvert(pSat);
529  const scalar Re = mag(Uf)*L_/nuf;
530 
531  cp[faceI] = liquid_->Cp(pf, Tf);
532  hfg[faceI] = liquid_->hl(pf, Tf);
533 
534  // Calculate relative humidity
535  const scalar invMwmean =
536  Yi[faceI]/Mv + (1.0 - Yi[faceI])/Mcomp_;
537  const scalar Xv = Yi[faceI]/invMwmean/Mv;
538  const scalar RH = min(Xv*pf/pSat, 1.0);
539 
540  scalar RHmin = 0.01;
541  scalar Tdew = -GREAT;
542 
543  if (RH > RHmin)
544  {
545  scalar b = 243.5;
546  scalar c = 17.65;
547  scalar TintDeg = Tint - 273;
548  Tdew =
549  b*(log(RH) + (c*TintDeg)/(b + TintDeg))
550  /(c - log(RH) - ((c*TintDeg)/(b + TintDeg))) + 273;
551  }
552 
553  if
554  (
555  Tf < Tdew
556  && RH > RHmin
557  && (
560  )
561  )
562  {
563  htc[faceI] = htcCondensation(TSat, Re)*nbrK[faceI]/L_;
564 
565  scalar htcTotal =
566  1.0/((1.0/myKDelta_[faceI]) + (1.0/htc[faceI]));
567 
568  // Heat flux [W] (>0 heat is converted into mass)
569  const scalar q = (Tint - Tf)*htcTotal*magSf[faceI];
570 
571  // Mass flux rate [Kg/s/m2]
572  dm[faceI] = q/hfg[faceI]/magSf[faceI];
573 
574  mass_[faceI] += q/hfg[faceI]*dt;
575 
576  // -dYp/dn = q/Dab (fixedGradient)
577  const scalar Dab = liquid_->D(pf, Tf);
578  Yvp[faceI] =
579  -min(dm[faceI]/Dab/rhof, Yi[faceI]*myDelta[faceI]);
580  }
581  else if
582  (
583  Tf > Tvap_
584  && mass_[faceI] > 0.0
585  && (
588  )
589  )
590  {
591  const scalar Dab = liquid_->D(pf, Tf);
592 
593  const scalar Sc = nuf/Dab;
594  const scalar Sh = this->Sh(Re, Sc);
595 
596  const scalar Ys = Mv*pSat/(Mv*pSat + Mcomp_*(pf - pSat));
597 
598  // Mass transfer coefficient [m/s]
599  const scalar hm = Dab*Sh/L_;
600 
601  const scalar Yinf = max(Yi[faceI], 0.0);
602 
603  // Mass flux rate [Kg/s/m2]
604  dm[faceI] = -rhof*hm*max((Ys - Yinf), 0.0)/(1.0 - Ys);
605 
606  // Set fixedGradient for carrier species.
607  Yvp[faceI] = -dm[faceI]/Dab/rhof;
608 
609  // Total mass accumulated [Kg]
610  mass_[faceI] += dm[faceI]*magSf[faceI]*dt;
611 
612  htc[faceI] = htcCondensation(TSat, Re)*nbrK[faceI]/L_;
613  }
614  else if (Tf > Tdew && Tf < Tvap_ && mass_[faceI] > 0.0)
615  {
616  htc[faceI] = htcCondensation(TSat, Re)*nbrK[faceI]/L_;
617  }
618  else if (mass_[faceI] == 0.0)
619  {
620  // Do nothing
621  }
622 
623  liquidRho[faceI] = liquid_->rho(pf, Tf);
624  }
625 
626  mass_ = max(mass_, scalar(0));
627 
628  Yp.gradient() = Yvp;
629 
630  // Output film delta (e.g. H2OThickness) [m]
631  const word fieldName(specieName_ + "Thickness");
632 
633  scalarField& pDelta =
635  (
636  fieldName,
637  refCast<const fvMesh>(mesh)
638  ).boundaryField()[patch().index()];
639 
640 
641  pDelta = mass_/liquidRho/magSf;
642 
643  // Weight myKDelta and htc
644  myKDelta_ = 1.0/((1.0/myKDelta_) + (1.0/htc));
645 
646  mpCpTp_ = mass_*cp/dt/magSf;
647 
648  // Heat flux due to change of phase [W/m2]
649  dmHfg_ = dm*hfg;
650  }
651  else
652  {
653  // Inertia term [W/K/m2]
654  mpCpTp_ = thickness_*rho_*cp_/dt;
655  }
656  }
657 
658  scalarField myKDeltaNbr(patch().size(), 0.0);
659  scalarField mpCpTpNbr(patch().size(), 0.0);
660  scalarField dmHfgNbr(patch().size(), 0.0);
661 
662  if (!fluid_)
663  {
664  myKDeltaNbr = nbrField.myKDelta();
665  mpp.distribute(myKDeltaNbr);
666 
667  mpCpTpNbr = nbrField.mpCpTp();
668  mpp.distribute(mpCpTpNbr);
669 
670  dmHfgNbr = nbrField.dmHfg();
671  mpp.distribute(dmHfgNbr);
672  }
673 
674  // Obtain Rad heat (Qr)
675  scalarField Qr(Tp.size(), 0.0);
676  if (QrName_ != "none")
677  {
678  Qr = patch().lookupPatchField<volScalarField, scalar>(QrName_);
679  }
680 
681  scalarField QrNbr(Tp.size(), 0.0);
682  if (QrNbrName_ != "none")
683  {
684  QrNbr = nbrPatch.lookupPatchField<volScalarField, scalar>(QrNbrName_);
685  mpp.distribute(QrNbr);
686  }
687 
688  const scalarField dmHfg(dmHfgNbr + dmHfg_);
689 
690  const scalarField mpCpdt(mpCpTpNbr + mpCpTp_);
691 
692  // Qr > 0 (heat up the wall)
693  scalarField alpha(KDeltaNbr + mpCpdt - (Qr + QrNbr + dmHfg)/Tp);
694 
695  valueFraction() = alpha/(alpha + myKDelta_);
696 
697  refValue() = (KDeltaNbr*nbrIntFld + mpCpdt*Tp)/alpha;
698 
699  mixedFvPatchScalarField::updateCoeffs();
700 
701 
702  if (debug)
703  {
704  if (fluid_)
705  {
706  scalar Qdm = gSum(dm);
707  scalar QMass = gSum(mass_);
708  scalar Qt = gSum(myKDelta_*(Tp - Tin)*magSf);
709  scalar QtSolid = gSum(KDeltaNbr*(Tp - nbrIntFld)*magSf);
710 
711  Info<< mesh.name() << ':'
712  << patch().name() << ':'
713  << dimensionedInternalField().name() << " <- "
714  << nbrMesh.name() << ':'
715  << nbrPatch.name() << ':'
716  << dimensionedInternalField().name() << " :" << nl
717  << " Total mass flux [Kg/s] : " << Qdm << nl
718  << " Total mass on the wall [Kg] : " << QMass << nl
719  << " Total heat (>0 leaving the wall to the fluid) [W] : "
720  << Qt << nl
721  << " Total heat (>0 leaving the wall to the solid) [W] : "
722  << QtSolid << nl
723  << " wall temperature "
724  << " min:" << gMin(*this)
725  << " max:" << gMax(*this)
726  << " avg:" << gAverage(*this)
727  << endl;
728  }
729  }
730 }
731 
732 
734 (
735  Ostream& os
736 ) const
737 {
739  writeEntryIfDifferent<word>(os, "p", "p", pName_);
740  writeEntryIfDifferent<word>(os, "U", "U", UName_);
741  writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
742  writeEntryIfDifferent<word>(os, "mu", "thermo:mu", muName_);
743  writeEntryIfDifferent<word>(os, "Tnbr", "T", TnbrName_);
744  writeEntryIfDifferent<word>(os, "QrNbr", "none", QrNbrName_);
745  writeEntryIfDifferent<word>(os, "Qr", "none", QrName_);
746 
747  if (fluid_)
748  {
749  os.writeKeyword("mode")<< massModeTypeNames_[mode_]
751 
752  writeEntryIfDifferent<word>(os, "specieName", "none", specieName_);
753 
754  os.writeKeyword("carrierMolWeight")<< Mcomp_
756 
757  os.writeKeyword("L")<< L_ << token::END_STATEMENT << nl;
758  os.writeKeyword("Tvap")<< Tvap_ << token::END_STATEMENT << nl;
759  os.writeKeyword("fluid")<< fluid_ << token::END_STATEMENT << nl;
760  mass_.writeEntry("mass", os);
761 
762  if (mode_ == mtConstantMass)
763  {
764  cp_.writeEntry("cp", os);
765  rho_.writeEntry("rho", os);
766  }
767 
768  thickness_.writeEntry("thickness", os);
769  word liq = "liquid";
770  os << token::TAB << token::TAB << liq;
771  liquidDict_.write(os);
772  }
773 
775 }
776 
777 
778 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
779 
780 namespace Foam
781 {
783  (
786  );
787 }
788 
789 
790 // ************************************************************************* //
Foam::token::TAB
@ TAB
Definition: token.H:96
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::fluid_
bool fluid_
Fluid side.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:264
volFields.H
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mpCpTp
const scalarField mpCpTp() const
Return mpCpTp.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:384
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mass_
scalarField mass_
Mass accumulated on faces.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:243
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::token::END_STATEMENT
@ END_STATEMENT
Definition: token.H:99
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::massModeTypeNames_
static const NamedEnum< massTransferMode, 4 > massModeTypeNames_
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:203
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::QrName_
const word QrName_
Name of the radiative heat flux field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:230
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::cp_
scalarField cp_
Cp field for inert mode.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:267
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::pName_
const word pName_
Name of the pressure field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:212
p
p
Definition: pEqn.H:62
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::compressible::New
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
Definition: turbulentFluidThermoModel.C:36
Foam::dimLength
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:50
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::myKDelta_
scalarField myKDelta_
Cache myDelta.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:249
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mtCondensationAndEvaporation
@ mtCondensationAndEvaporation
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:195
Foam::gAverage
Type gAverage(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:571
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::thicknessField
volScalarField & thicknessField(const word &, const fvMesh &)
Lookup (or create) thickness field for output.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:100
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:216
dimensionedInternalField
rDeltaT dimensionedInternalField()
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::Sh
scalar Sh(const scalar Re, const scalar Sc) const
Calculation of Sh.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:64
Foam::mappedPatchBase::samplePolyPatch
const polyPatch & samplePolyPatch() const
Get the patch on the region.
Definition: mappedPatchBase.C:1246
Foam::Re
scalarField Re(const UList< complex > &cf)
Definition: complexFields.C:97
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:373
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::thickness_
scalarField thickness_
Thickness field for inert mode.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:270
Foam::temperatureCoupledBase
Common functions for use in temperature coupled boundaries.
Definition: temperatureCoupledBase.H:104
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::UName_
const word UName_
Name of the velocity field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:215
Foam::GeometricField::boundaryField
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
Definition: GeometricField.C:735
Foam::FatalIOError
IOerror FatalIOError
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::Mcomp_
scalar Mcomp_
Average molecular weight for the carrier mixture in the gas phase.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:258
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
surfaceFields.H
Foam::surfaceFields.
fvPatchFieldMapper.H
Foam::gSum
Type gSum(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:564
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:734
Foam::mag
dimensioned< scalar > mag(const dimensioned< Type > &)
Foam::mappedPatchBase
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
Definition: mappedPatchBase.H:101
Foam::cp
bool cp(const fileName &src, const fileName &dst)
Copy, recursively if necessary, the source to the destination.
Definition: POSIX.C:755
Foam::fixedGradientFvPatchField::gradient
virtual Field< Type > & gradient()
Return gradient at boundary.
Definition: fixedGradientFvPatchField.H:189
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mpCpTp_
scalarField mpCpTp_
Thermal inertia.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:255
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::fvPatch::name
const word & name() const
Return name.
Definition: fvPatch.H:149
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:56
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::dmHfg_
scalarField dmHfg_
Phase change energy.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:252
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mtEvaporation
@ mtEvaporation
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:194
Foam::mappedPatchBase::sampleMesh
const polyMesh & sampleMesh() const
Get the region mesh.
Definition: mappedPatchBase.C:1237
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
RH
volScalarField RH(IOobject("RH", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar("RH", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0))
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:28
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::rhoName_
const word rhoName_
Name of the density field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:218
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::dmHfg
const scalarField dmHfg() const
Return dmHfg.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:390
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::Info
messageStream Info
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::humidityTemperatureCoupledMixedFvPatchScalarField
humidityTemperatureCoupledMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:139
Foam::mappedPatchBase::distribute
void distribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
Definition: mappedPatchBaseTemplates.C:27
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Qr
volScalarField Qr(IOobject("Qr", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE), mesh, dimensionedScalar("Qr", dimMass/pow3(dimTime), 0.0))
Foam::fvPatchField< Type >::patchInternalField
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch as patch field.
Definition: fvPatchField.C:208
Foam::IOobject::name
const word & name() const
Return name.
Definition: IOobject.H:273
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:419
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
humidityTemperatureCoupledMixedFvPatchScalarField.H
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:73
dict
dictionary dict
Definition: searchingEngine.H:14
pSat
const dimensionedScalar & pSat
Definition: createFields.H:41
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::QrNbrName_
const word QrNbrName_
Name of the radiative heat flux in the neighbout region.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:227
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::log
dimensionedScalar log(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:253
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::tmp::ptr
T * ptr() const
Return tmp pointer for reuse.
Definition: tmpI.H:146
Foam::makePatchTypeField
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
Foam::refCast
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:106
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::Tvap_
scalar Tvap_
Vaporization temperature.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:246
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
readScalar
#define readScalar
Definition: doubleScalar.C:38
fixedGradientFvPatchFields.H
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::muName_
const word muName_
Name of the dynamic viscosity field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:221
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
Foam::max
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::specieName_
const word specieName_
Name of the species on which the mass transfered (default H2O)
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:233
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::rmap
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:393
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mtConstantMass
@ mtConstantMass
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:192
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::L_
scalar L_
Characteristic length scale.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:261
Foam::Vector< scalar >
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::sqrt
dimensionedScalar sqrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:142
scalarField
volScalarField scalarField(fieldObject, mesh)
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::rho_
scalarField rho_
Density field for inert mode.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:273
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mode_
massTransferMode mode_
Operating mode.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:206
Foam::fvPatch::deltaCoeffs
const scalarField & deltaCoeffs() const
Return the face - cell distance coeffient.
Definition: fvPatch.C:164
Foam::temperatureCoupledBase::kappa
tmp< scalarField > kappa(const scalarField &Tp) const
Given patch temperature calculate corresponding K field.
Definition: temperatureCoupledBase.C:101
Foam::Ostream::writeKeyword
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
Definition: Ostream.C:59
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::TnbrName_
const word TnbrName_
Name of temperature field on the neighbour region.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:224
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mtCondensation
@ mtCondensation
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:193
Foam::fvPatch::lookupPatchField
const GeometricField::PatchFieldType & lookupPatchField(const word &name, const GeometricField *=NULL, const Type *=NULL) const
Lookup and return the patchField of the named field from the.
Definition: fvPatchFvMeshTemplates.C:32
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
FatalIOErrorInFunction
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:330
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::gMin
Type gMin(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:563
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::massTransferMode
massTransferMode
Modes of mass transfer.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:190
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::liquid_
autoPtr< liquidProperties > liquid_
Liquid properties.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:237
Foam::cbrt
dimensionedScalar cbrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:153
Foam::fixedGradientFvPatchField
This boundary condition supplies a fixed gradient condition, such that the patch values are calculate...
Definition: fixedGradientFvPatchField.H:107
rhof
surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)"))
Foam::temperatureCoupledBase::write
void write(Ostream &) const
Write.
Definition: temperatureCoupledBase.C:225
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Uf
Uf
Definition: pEqn.H:78
Foam::humidityTemperatureCoupledMixedFvPatchScalarField
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:180
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::htcCondensation
scalar htcCondensation(const scalar TSat, const scalar Re) const
Calculation of htc from the condensed surface.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:82
Foam::min
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::patchIdentifier::index
label index() const
Return the index of this patch in the boundaryMesh.
Definition: patchIdentifier.H:133
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::myKDelta
const scalarField myKDelta() const
Return myKDelta.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:378
write
Tcoeff write()
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::liquidDict_
dictionary liquidDict_
Liquid dictionary.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:240
Foam::gMax
Type gMax(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:562
Foam::NamedEnum
Initialise the NamedEnum HashTable from the static list of names.
Definition: NamedEnum.H:52
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
mappedPatchBase.H