wallBoiling.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2024-2026 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 "wallBoiling.H"
27 
28 #include "multiphaseEuler.H"
29 
31 
33 #include "partitioningModel.H"
34 #include "nucleationSiteModel.H"
35 #include "departureDiameterModel.H"
37 
42 
44 
45 /*---------------------------------------------------------------------------*\
46  Class wallBoiling::laggedProperties Declaration
47 \*---------------------------------------------------------------------------*/
48 
50 {
51  //- Typedef to shorten the name of the Jayatilleke wall function
52  typedef
55 
56  //- Wall function field
58 
59  //- Patch index
60  const label patchi;
61 
62  //- Liquid volume fraction
64 
65  //- Vapour volume fraction
67 
68  //- Liquid thermophysical transport model
70 
71  //- Vapour thermophysical transport model
73 
74  //- Liquid convective turbulent thermal diffusivity
76 
77  //- Phase convective turbulent thermal diffusivity
79 
80  //- Patch area by neighbouring cell volume ratio
82 
83  //- Liquid density
84  private: const tmp<scalarField> trhoLiquid;
85  public: const scalarField& rhoLiquid;
86 
87  //- Vapour density
88  private: const tmp<scalarField> trhoVapour;
89  public: const scalarField& rhoVapour;
90 
91  //- Liquid heat capacity
93 
94  //- Liquid laminar kinematic viscosity
95  private: const tmp<scalarField> tnuLiquid;
96  public: const scalarField& nuLiquid;
97 
98  //- Liquid laminar thermal diffusivity
100 
101  //- Liquid viscosity wall function
103 
104  //- Dimensionless wall distance
106 
107  //- Smoothing function
108  const scalarField P;
109 
110  //- Cell temperature
112 
113  //- Saturation temperature
115 
116  //- Latent heat
117  const scalarField L;
118 
119  //- Patch
120  inline const fvPatch& patch() const
121  {
122  return model.mesh().boundary()[patchi];
123  }
124 
125  //- Constructor
127  (
128  const wallBoiling& model,
129  const label patchi
130  )
131  :
132  model(model),
133  patchi(patchi),
134  alphaLiquid(model.liquid_.boundaryField()[patchi]),
135  alphaVapour(model.vapour_.boundaryField()[patchi]),
136  ttmLiquid
137  (
139  (
140  model.liquid_.name()
141  )
142  ),
143  ttmVapour
144  (
146  (
147  model.vapour_.name()
148  )
149  ),
151  (
153  ),
155  (
157  ),
158  AbyV
159  (
160  patch().magSf()
161  /scalarField
162  (
163  patch().mesh().V(),
164  patch().faceCells()
165  )
166  ),
167  trhoLiquid(model.liquid_.thermo().rho(patchi)),
168  rhoLiquid(trhoLiquid()),
169  trhoVapour(model.vapour_.thermo().rho(patchi)),
170  rhoVapour(trhoVapour()),
171  CpLiquid(model.liquid_.thermo().Cp().boundaryField()[patchi]),
172  tnuLiquid(model.liquid_.fluidThermo().nu(patchi)),
173  nuLiquid(tnuLiquid()),
175  (
176  model.liquid_.thermo().kappa().boundaryField()[patchi]/CpLiquid
177  ),
178  nutLiquid
179  (
181  (
182  ttmLiquid.momentumTransport(),
183  patchi
184  )
185  ),
187  (
188  pow025(nutLiquid.Cmu())
189  *sqrt(ttmLiquid.momentumTransport().k()().boundaryField()[patchi])
190  *ttmLiquid.momentumTransport().yb()[patchi]
191  /nuLiquid
192  ),
193  P
194  (
196  (
198  )
199  ),
200  TcLiquid
201  (
202  model.liquid_.thermo().T().boundaryField()[patchi]
203  .patchInternalField()
204  ),
205  Tsat
206  (
207  model.saturationModelPtr_->Tsat
208  (
209  static_cast<const scalarField&>
210  (
211  model.liquid_.fluidThermo().p().boundaryField()[patchi]
212  )
213  )
214  ),
215  L
216  (
217  model.L
218  (
219  patchi,
220  model.liquid_.thermo().T().boundaryField()[patchi]
221  )
222  )
223  {}
224 };
225 
226 
227 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
228 
229 namespace Foam
230 {
231 namespace fv
232 {
235 }
236 }
237 
238 
239 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
240 
241 void Foam::fv::wallBoiling::readCoeffs(const dictionary& dict)
242 {
244 
245  saturationModelPtr_.reset
246  (
248  (
249  "saturationTemperature",
250  dict
251  ).ptr()
252  );
253 
254  partitioningModel_.reset
255  (
257  (
258  dict.subDict("partitioningModel")
259  ).ptr()
260  );
261 
262  nucleationSiteModel_.reset
263  (
265  (
266  dict.subDict("nucleationSiteModel")
267  ).ptr()
268  );
269 
270  departureDiameterModel_.reset
271  (
273  (
274  dict.subDict("departureDiameterModel")
275  ).ptr()
276  );
277 
278  departureFrequencyModel_.reset
279  (
281  (
282  dict.subDict("departureFrequencyModel")
283  ).ptr()
284  );
285 
286  tolerance_ =
287  dict.lookupOrDefault<scalar>("tolerance", units::unitless, rootSmall);
288 
289  liquidTemperatureWallFunction_ =
290  dict.lookupOrDefault<Switch>("useLiquidTemperatureWallFunction", true);
291 
292  Prt_ = dict.lookupOrDefault<scalar>("Prt", dimless, 0.85);
293 
294  bubbleWaitingTimeRatio_ =
295  dict.lookupOrDefault<scalar>("bubbleWaitingTimeRatio", dimless, 0.8);
296 }
297 
298 
300 Foam::fv::wallBoiling::getLiquidTemperaturePatchField
301 (
302  const laggedProperties& lagProps,
303  scalarField& isFixed,
304  scalarField& h,
305  scalarField& hTaPlusQa
306 ) const
307 {
308  isFixed.setSize(lagProps.patch().size());
309  h.setSize(lagProps.patch().size());
310  hTaPlusQa.setSize(lagProps.patch().size());
311 
312  const fvPatchScalarField& T =
313  liquid_.thermo().T().boundaryField()[lagProps.patchi];
314 
315  const fvPatchScalarField& alphat =
316  alphatLiquid_.boundaryField()[lagProps.patchi];
317 
318  if (isA<fixedValueFvPatchScalarField>(T))
319  {
320  isFixed = 1;
321  h = rootVGreat;
322  hTaPlusQa = rootVGreat*T;
323  }
324  else if (isA<zeroGradientFvPatchScalarField>(T))
325  {
326  isFixed = 0;
327  h = 0;
328  hTaPlusQa = 0;
329  }
330  else if (isA<fixedGradientFvPatchScalarField>(T))
331  {
332  const fixedGradientFvPatchScalarField& Tfg =
333  refCast<const fixedGradientFvPatchScalarField>(T);
334 
335  isFixed = 0;
336  h = 0;
337  hTaPlusQa = alphat*lagProps.CpLiquid*Tfg.gradient();
338  }
339  else if (isA<mixedFvPatchScalarField>(T))
340  {
341  const mixedFvPatchScalarField& Tm =
342  refCast<const mixedFvPatchScalarField>(T);
343 
344  isFixed = pos(Tm.valueFraction() - 1 + rootSmall);
345  h =
346  Tm.valueFraction()
347  /max(1 - Tm.valueFraction(), rootVSmall)
348  *alphat
349  *lagProps.CpLiquid
350  *lagProps.patch().deltaCoeffs();
351  hTaPlusQa =
352  h*Tm.refValue()
353  + alphat*lagProps.CpLiquid*Tm.refGrad();
354  }
355  else
356  {
358  << "Temperature boundary condition type not recognised"
359  << exit(FatalError);
360  }
361 
362  return T;
363 }
364 
365 
366 Foam::tmp<Foam::scalarField> Foam::fv::wallBoiling::calcBoiling
367 (
368  const laggedProperties& lagProps,
369  const scalarField& TLiquid,
370  const scalarField& wetFraction,
371  scalarField& dDeparture,
372  scalarField& fDeparture,
373  scalarField& nucleationSiteDensity,
374  scalarField& qQuenching,
375  scalarField& qEvaporative,
376  scalarField& mDot
377 ) const
378 {
380 
381  scalarField Tl;
382  if (!liquidTemperatureWallFunction_)
383  {
384  Tl = lagProps.TcLiquid;
385  }
386  else
387  {
388  // Liquid temperature at y+=250 is estimated from the logarithmic
389  // thermal wall function of Koncar, Krepper & Egorov (2005)
390  const scalarField TyPlus250
391  (
392  Prt_
393  *(
394  log(lagProps.nutLiquid.E()*250)
395  /lagProps.nutLiquid.kappa()
396  + lagProps.P
397  )
398  );
399 
400  const scalarField TyPlus
401  (
402  Prt_
403  *(
404  log
405  (
406  lagProps.nutLiquid.E()
407  *max(lagProps.yPlusLiquid, scalar(11))
408  )
409  /lagProps.nutLiquid.kappa()
410  + lagProps.P
411  )
412  );
413 
414  Tl = TLiquid - (TyPlus250/TyPlus)*(TLiquid - lagProps.TcLiquid);
415  }
416 
417  // Bubble departure diameter
418  dDeparture =
419  departureDiameterModel_->dDeparture
420  (
421  liquid_,
422  vapour_,
423  lagProps.patchi,
424  Tl,
425  lagProps.Tsat,
426  lagProps.L
427  );
428 
429  // Bubble departure frequency
430  fDeparture =
431  departureFrequencyModel_->fDeparture
432  (
433  liquid_,
434  vapour_,
435  lagProps.patchi,
436  Tl,
437  lagProps.Tsat,
438  lagProps.L,
439  dDeparture
440  );
441 
442  // Nucleation site density
443  nucleationSiteDensity =
444  nucleationSiteModel_->nucleationSiteDensity
445  (
446  liquid_,
447  vapour_,
448  lagProps.patchi,
449  Tl,
450  lagProps.Tsat,
451  lagProps.L,
452  dDeparture,
453  fDeparture
454  );
455 
456  // Del Valle & Kenning (1985)
457  const scalarField Ja
458  (
459  lagProps.rhoLiquid
460  *lagProps.CpLiquid
461  *max(lagProps.Tsat - Tl, scalar(0))
462  /(lagProps.rhoVapour*lagProps.L)
463  );
464 
465  const scalarField Al
466  (
467  wetFraction*4.8*exp(min(-Ja/80, log(vGreat)))
468  );
469 
470  scalarField A2
471  (
472  min(pi*sqr(dDeparture)*nucleationSiteDensity*Al/4, scalar(1))
473  );
474  const scalarField A1(max(1 - A2, scalar(1e-4)));
475  scalarField A2E
476  (
477  min(pi*sqr(dDeparture)*nucleationSiteDensity*Al/4, scalar(5))
478  );
479 
480  // Volumetric mass source in the near wall cell due to the
481  // wall boiling
482  mDot = (1.0/6.0)*A2E*dDeparture*lagProps.rhoVapour*fDeparture*lagProps.AbyV;
483 
484  // Quenching heat transfer coefficient
485  const scalarField hQ
486  (
487  2*lagProps.kappaByCpLiquid*lagProps.CpLiquid*fDeparture
488  *sqrt
489  (
490  bubbleWaitingTimeRatio_
491  /max(fDeparture, small)
492  /(pi*lagProps.kappaByCpLiquid/lagProps.rhoLiquid)
493  )
494  );
495 
496  // Quenching heat flux
497  qQuenching = A2*hQ*max(TLiquid - Tl, scalar(0));
498 
499  // Evaporation heat flux
500  qEvaporative = mDot*lagProps.L/lagProps.AbyV;
501 
502  // Return total sum of convective, quenching and evaporative heat fluxes
503  const scalarField gradT
504  (
505  lagProps.patch().deltaCoeffs()
506  *max(TLiquid - lagProps.TcLiquid, small*lagProps.TcLiquid)
507  );
508  return
509  A1*lagProps.alphatConvLiquid*lagProps.CpLiquid*gradT
510  + qQuenching
511  + qEvaporative;
512 }
513 
514 
515 Foam::tmp<Foam::scalarField> Foam::fv::wallBoiling::calcBoiling
516 (
517  const wallBoilingPhaseChangeRateFvPatchScalarField& mDot,
518  const laggedProperties& lagProps,
519  const scalarField& TLiquid
520 ) const
521 {
522  scalarField dDeparture(mDot.dDeparture_);
523  scalarField fDeparture(mDot.fDeparture_);
524  scalarField nucleationSiteDensity(mDot.nucleationSiteDensity_);
525  scalarField qQuenching(mDot.qQuenching_);
526  scalarField qEvaporative(mDot.qEvaporative_);
527  scalarField mDotCopy(mDot);
528 
529  return
530  calcBoiling
531  (
532  lagProps,
533  TLiquid,
534  mDot.wetFraction_,
535  dDeparture,
536  fDeparture,
537  nucleationSiteDensity,
538  qQuenching,
539  qEvaporative,
540  mDotCopy
541  );
542 }
543 
544 
545 Foam::tmp<Foam::scalarField> Foam::fv::wallBoiling::evaluateBoiling
546 (
547  wallBoilingPhaseChangeRateFvPatchScalarField& mDot,
548  const laggedProperties& lagProps,
549  const scalarField& TLiquid
550 ) const
551 {
552  return
553  calcBoiling
554  (
555  lagProps,
556  TLiquid,
557  mDot.wetFraction_,
558  mDot.dDeparture_,
559  mDot.fDeparture_,
560  mDot.nucleationSiteDensity_,
561  mDot.qQuenching_,
562  mDot.qEvaporative_,
563  mDot
564  );
565 }
566 
567 
568 void Foam::fv::wallBoiling::correctMDot() const
569 {
570  Info<< type() << ": " << name() << endl << incrIndent;
571 
572  //- Reset the phase-change rates in all the near-wall cells
573  forAll(mDot_.boundaryField(), patchi)
574  {
575  if (!isPatchActive(patchi)) continue;
576 
577  const labelUList& faceCells = mesh().boundary()[patchi].faceCells();
578  forAll(faceCells, i)
579  {
580  mDot_[faceCells[i]] = scalar(0);
581  }
582  }
583 
584  // Loop the boiling patches, evaluate the model, and sum the phase change
585  // rates into the adjacent cells
586  forAll(mDot_.boundaryField(), patchi)
587  {
588  if (!isPatchActive(patchi)) continue;
589 
590  // Access the wall-boiling phase-change patch field for this patch
591  wallBoilingPhaseChangeRateFvPatchScalarField& mDot = mDotPfRef(patchi);
592 
593  // Construct lagged properties
594  const laggedProperties lagProps(*this, patchi);
595 
596  // Evaluate the wetted fraction
597  mDot.wetFraction_ =
598  partitioningModel_->wetFraction(lagProps.alphaLiquid);
599 
600  // Set the vapour turbulent thermal diffusivity
601  mDot.alphatVapour_ =
602  (1 - mDot.wetFraction_)
603  /max(1 - lagProps.alphaLiquid, rootSmall)
604  *lagProps.alphatConvVapour;
605 
606  // Get the temperature boundary condition and extract its
607  // physical parameters
608  scalarField TLiquidIsFixed, TLiquidH, TLiquidHTaPlusQa;
609  const fvPatchScalarField& TLiquid =
610  getLiquidTemperaturePatchField
611  (
612  lagProps,
613  TLiquidIsFixed,
614  TLiquidH,
615  TLiquidHTaPlusQa
616  );
617 
618  // Define the residual. This should be monotonic in T.
619  auto R = [&](const scalarField& T)
620  {
621  return
622  calcBoiling(mDot, lagProps, T)
623  - TLiquidHTaPlusQa
624  + TLiquidH*T;
625  };
626 
627  // Solve using interval bisection. Boiling cannot occur below the
628  // saturation temperature, so that is taken to be the lower bound. The
629  // upper bound is harder to define. For now, take twice the current
630  // superheat as the maximum. The solution is likely to be below this
631  // value. If it is not, then the iteration will converge to this upper
632  // limit, creating a new superheat of twice the current value.
633  // Subsequent time-steps will then double this superheat again and
634  // again until it does eventually bound the solution.
635  mDot.boiling_ = neg(R(lagProps.Tsat));
636  scalarField T0(lagProps.Tsat);
637  scalarField T1
638  (
639  max
640  (
641  TLiquid + (TLiquid - lagProps.Tsat),
642  lagProps.Tsat*(1 + sqrt(tolerance_))
643  )
644  );
645  scalar e =
646  gMax((1 - TLiquidIsFixed)*mDot.boiling_*(T1 - T0)/(T0 + T1));
647  for (; e > tolerance_; e /= 2)
648  {
649  const scalarField Tm((T0 + T1)/2);
650  const scalarField rM(R(Tm));
651  T0 = pos(rM)*T0 + neg0(rM)*Tm;
652  T1 = pos(rM)*Tm + neg0(rM)*T1;
653  }
654  const scalarField T
655  (
656  TLiquidIsFixed*TLiquid + (1 - TLiquidIsFixed)*(T0 + T1)/2
657  );
658 
659  // Use solution to re-evaluate the boiling and set the thermal
660  // diffusivity to recover the calculated heat flux
661  const scalarField gradT
662  (
663  lagProps.patch().deltaCoeffs()
664  *max(T - lagProps.TcLiquid, small*lagProps.TcLiquid)
665  );
666 
667  const scalarField q(evaluateBoiling(mDot, lagProps, T));
668 
669  const scalarField alphatBoilingLiquid
670  (
671  q/lagProps.CpLiquid/gradT/max(lagProps.alphaLiquid, rootSmall)
672  );
673 
674  mDot.alphatLiquid_=
675  mDot.boiling_*alphatBoilingLiquid
676  + (1 - mDot.boiling_)*lagProps.alphatConvLiquid;
677  infoField
678  (
679  "mDot[" + mesh().boundary()[patchi].name() + "]",
681  mDot
682  );
683 
684  // Sum the phase change rate into the internal field
685  const labelUList& faceCells = mesh().boundary()[patchi].faceCells();
686  forAll(faceCells, i)
687  {
688  mDot_[faceCells[i]] += mDot[i];
689  }
690  }
691 
692  Info<< decrIndent;
693 }
694 
695 
696 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
697 
699 (
700  const word& name,
701  const word& modelType,
702  const fvMesh& mesh,
703  const dictionary& dict
704 )
705 :
707  (
708  name,
709  modelType,
710  mesh,
711  dict,
712  readSpecie(coeffs(modelType, dict), false)
713  ),
714  nucleation(),
715  liquid_(phases().first()),
716  vapour_(phases().second()),
717  alphatLiquid_(wallPhaseChange::alphats().first()),
718  alphatVapour_(wallPhaseChange::alphats().second()),
719  p_rgh_
720  (
721  mesh().lookupObject<solvers::multiphaseEuler>(solver::typeName).p_rgh
722  ),
723  tolerance_(NaN),
724  liquidTemperatureWallFunction_(true),
725  Prt_(NaN),
726  bubbleWaitingTimeRatio_(NaN),
727  saturationModelPtr_(nullptr),
728  partitioningModel_(nullptr),
729  nucleationSiteModel_(nullptr),
730  departureDiameterModel_(nullptr),
731  departureFrequencyModel_(nullptr),
732  pressureEquationIndex_(-1),
733  mDot_
734  (
735  IOobject
736  (
737  name + ":mDot",
738  mesh.time().name(),
739  mesh,
740  IOobject::READ_IF_PRESENT,
741  IOobject::AUTO_WRITE
742  ),
743  mesh,
745  mDotBoundaryTypes
746  (
748  )
749  )
750 {
751  readCoeffs(coeffs(dict));
752 }
753 
754 
755 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
756 
758 (
759  const label patchi
760 ) const
761 {
762  return mDotPfRef(patchi).boiling_;
763 }
764 
765 
767 (
768  const label patchi
769 ) const
770 {
771  return
773  (
774  mDotPfRef(patchi).alphatLiquid_,
775  mDotPfRef(patchi).alphatVapour_
776  );
777 }
778 
779 
782 {
783  // Put all the latent heat into the liquid
784  return
786  (
787  name() + ":Lfraction",
788  mesh(),
789  dimensionedScalar(dimless, scalar(0))
790  );
791 }
792 
793 
796 {
797  tmp<volScalarField> tdVapour = vapour_.d();
798  const volScalarField::Internal& dVapour = tdVapour();
799 
800  const volScalarField::Internal mask
801  (
802  neg(mag(mDot_) - dimensionedScalar(dimDensity/dimTime, rootVSmall))
803  );
804 
806  volScalarField::Internal::New(name() + ":d", mask*dVapour);
807  volScalarField::Internal& d = td.ref();
808 
809  forAll(mDot_.boundaryField(), patchi)
810  {
811  if (!isPatchActive(patchi)) continue;
812 
813  // Access the wall-boiling phase-change patch field for this patch
815  mDotPf(patchi);
816 
817  // Average the diameter into the internal field
818  const labelUList& faceCells = mesh().boundary()[patchi].faceCells();
819  forAll(faceCells, i)
820  {
821  if (mask[faceCells[i]]) continue;
822 
823  d[faceCells[i]] += mDot.dDeparture_[i]*mDot[i]/mDot_[faceCells[i]];
824  }
825  }
826 
827  return td;
828 }
829 
830 
833 {
836  (
837  name() + ":nDot",
838  mesh(),
839  dimensionedScalar(inv(dimTime), scalar(0))
840  );
841  volScalarField::Internal& nDot = tnDot.ref();
842 
843  forAll(mDot_.boundaryField(), patchi)
844  {
845  if (!isPatchActive(patchi)) continue;
846 
847  // Access the wall-boiling phase-change patch field for this patch
849  mDotPf(patchi);
850 
851  // Sum the frequency into the internal field
852  const labelUList& faceCells = mesh().boundary()[patchi].faceCells();
853  forAll(faceCells, i)
854  {
855  nDot[faceCells[i]] += mDot.fDeparture_[i];
856  }
857  }
858 
859  return tnDot;
860 }
861 
862 
865 {
867  return tmp<volScalarField::Internal>(nullptr);
868 }
869 
870 
873 {
874  return mDot_.internalField();
875 }
876 
877 
880 {
881  if (!isPatchActive(patchi))
882  {
884  << "Patch " << mesh().boundary()[patchi].name()
885  << " is not boiling" << exit(FatalError);
886  }
887 
888  return
889  refCast<const wallBoilingPhaseChangeRateFvPatchScalarField>
890  (
891  mDot_.boundaryField()[patchi]
892  );
893 }
894 
895 
898 {
899  if (!isPatchActive(patchi))
900  {
902  << "Patch " << mesh().boundary()[patchi].name()
903  << " is not boiling" << exit(FatalError);
904  }
905 
906  return
907  refCast<wallBoilingPhaseChangeRateFvPatchScalarField>
908  (
909  mDot_.boundaryFieldRef()[patchi]
910  );
911 }
912 
913 
915 (
916  const volScalarField& alpha,
917  const volScalarField& rho,
918  fvMatrix<scalar>& eqn
919 ) const
920 {
921  // Pressure equation (i.e., continuity, linearised in the pressure)
922  if
923  (
924  (&alpha == &liquid_ || &alpha == &vapour_)
925  && (&rho == &liquid_.rho() || &rho == &vapour_.rho())
926  && &eqn.psi() == &p_rgh_
927  )
928  {
929  // Ensure that the source is up-to date if this is the first call in
930  // the current phase loop
931  if (pressureEquationIndex_ % 2 == 0) correctMDot();
932  pressureEquationIndex_ ++;
933  }
934 
935  // Let the base class add the actual source
937 }
938 
939 
941 {
942  // Reset the p_rgh equation solution counter
943  pressureEquationIndex_ = 0;
944 
945  // Correct the total phase change rate
946  correctMDot();
947 }
948 
949 
951 {
952  if (phaseChange::read(dict))
953  {
954  readCoeffs(coeffs(dict));
955  return true;
956  }
957  else
958  {
959  return false;
960  }
961 }
962 
963 
964 // ************************************************************************* //
scalar Cp(const scalar p, const scalar T) const
Definition: EtoHthermo.H:2
label k
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:449
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static tmp< DimensionedField< Type, GeoMesh, PrimitiveField > > New(const word &name, const GeoMesh &mesh, const dimensionSet &, const PrimitiveField< Type > &)
Return a temporary field constructed from name, mesh,.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
void setSize(const label)
Reset size of List.
Definition: List.C:281
An ordered pair of two objects of type <Type> with first() and second() elements.
Definition: Pair.H:67
This boundary condition provides a thermal wall function for turbulent thermal diffusivity (usuallyal...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:56
Abstract base class for fluid thermophysical transport models RAS, LES and laminar.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:118
VolField< Type > & psi()
Definition: fvMatrix.H:289
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: fvMesh.C:932
Finite volume model abstract base class.
Definition: fvModel.H:60
static const dictionary & coeffs(const word &modelType, const dictionary &)
Return the coefficients sub-dictionary for a given model type.
Definition: fvModelI.H:31
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:69
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:57
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:90
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:58
tmp< volScalarField::Internal > rho(const label i) const
Return the density.
Definition: massTransfer.C:92
virtual void addSup(fvMatrix< scalar > &eqn) const
Add a source term to a field-less proxy equation.
Definition: massTransfer.C:223
Mix-in interface for nucleation models. Provides access to properties of the nucleation process,...
Definition: nucleation.H:53
void reReadSpecie(const dictionary &dict) const
Re-read the names of the transferring specie.
Definition: phaseChange.C:107
virtual bool read(const dictionary &dict)
Read source dictionary.
Definition: phaseChange.C:602
const volScalarField & p() const
Access the pressure field.
Definition: phaseChange.C:217
Model for nucleate wall boiling between two phases on the surface of a number of wall patches.
Definition: wallBoiling.H:158
virtual tmp< DimensionedField< scalar, fvMesh > > Lfraction() const
Return the fraction of the latent heat that is transferred into.
Definition: wallBoiling.C:781
virtual void correct()
Correct the fvModel.
Definition: wallBoiling.C:940
wallBoiling(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
Definition: wallBoiling.C:699
virtual tmp< DimensionedField< scalar, fvMesh > > mDot() const
Return the mass transfer rate.
Definition: wallBoiling.C:872
virtual const scalarField & active(const label) const
Return a mask indicating whether phase change is occurring.
Definition: wallBoiling.C:758
virtual bool read(const dictionary &dict)
Read source dictionary.
Definition: wallBoiling.C:950
const wallBoilingPhaseChangeRateFvPatchScalarField & mDotPf(const label patchi) const
Return the mass transfer rate for the given patch.
Definition: wallBoiling.C:879
void addSup(const volScalarField &alpha, const volScalarField &rho, const volScalarField &heOrYi, fvMatrix< scalar > &eqn) const
Use phaseChange's source functions.
Definition: phaseChange.C:529
virtual tmp< DimensionedField< scalar, fvMesh > > d() const
Return the diameter of nuclei.
Definition: wallBoiling.C:795
virtual tmp< DimensionedField< scalar, fvMesh > > tau() const
Return the nucleation time scale.
Definition: wallBoiling.C:864
wallBoilingPhaseChangeRateFvPatchScalarField & mDotPfRef(const label patchi) const
Return the mass transfer rate for the given patch.
Definition: wallBoiling.C:897
virtual tmp< DimensionedField< scalar, fvMesh > > nDot() const
Return the number rate at which nuclei are generated.
Definition: wallBoiling.C:832
Base class for fvModels that represent phase change at a wall.
const Pair< const volScalarField & > & alphats() const
Access the turbulent thermal diffusivities.
This boundary condition provides a turbulent kinematic viscosity condition when using wall functions,...
static autoPtr< saturationTemperatureModel > New(const word &name, const dictionary &dict)
Select with name within a dictionary.
Abstract base class for run-time selectable region solvers.
Definition: solver.H:56
A class for managing temporary objects.
Definition: tmp.H:55
T & ref() const
Return non-const reference or generate a fatal error.
Definition: tmpI.H:197
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
static autoPtr< departureDiameterModel > New(const dictionary &dict)
Select null constructed.
static autoPtr< departureFrequencyModel > New(const dictionary &dict)
Select null constructed.
static autoPtr< nucleationSiteModel > New(const dictionary &dict)
Select null constructed.
static autoPtr< partitioningModel > New(const dictionary &dict)
Select null constructed.
This boundary condition is used for the phase change rate field of the wall boiling fvModel....
A class for handling words, derived from string.
Definition: word.H:63
const scalar T0
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:381
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:334
label patchi
rho
Definition: pEqn.H:1
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
const dimensionedScalar h
Planck constant.
const dimensionSet time
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
const unitSet unitless
Namespace for OpenFOAM.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
dimensionedScalar pos(const dimensionedScalar &ds)
const doubleScalar e
Definition: doubleScalar.H:106
dimensionedScalar exp(const dimensionedScalar &ds)
const dimensionSet & dimless
Definition: dimensions.C:138
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
Definition: Ostream.H:272
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
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:288
void pow025(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
messageStream Info
labelList second(const UList< labelPair > &p)
Definition: patchToPatch.C:49
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Definition: Ostream.H:265
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar log(const dimensionedScalar &ds)
labelList first(const UList< labelPair > &p)
Definition: patchToPatch.C:39
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void inv(pointPatchField< tensor > &, const pointPatchField< tensor > &)
const dimensionSet & dimTime
Definition: dimensions.C:142
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
const dimensionSet & dimDensity
Definition: dimensions.C:158
static scalar R(const scalar a, const scalar x)
Definition: invIncGamma.C:102
dimensionedScalar neg(const dimensionedScalar &ds)
Type gMax(const UList< Type > &f, const label comm)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
error FatalError
dimensionedScalar neg0(const dimensionedScalar &ds)
void sqrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
UList< label > labelUList
Definition: UList.H:65
void T(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
fvPatchField< scalar > fvPatchScalarField
labelList fv(nPoints)
dictionary dict
fluidMulticomponentThermo & thermo
Definition: createFields.H:15
laggedProperties(const wallBoiling &model, const label patchi)
Constructor.
Definition: wallBoiling.C:127
compressible::alphatJayatillekeWallFunctionFvPatchScalarField alphatJayatillekeWallFunction
Typedef to shorten the name of the Jayatilleke wall function.
Definition: wallBoiling.C:54
const scalarField P
Smoothing function.
Definition: wallBoiling.C:108
const label patchi
Patch index.
Definition: wallBoiling.C:60
const scalarField alphatConvVapour
Phase convective turbulent thermal diffusivity.
Definition: wallBoiling.C:78
const nutWallFunctionFvPatchScalarField & nutLiquid
Liquid viscosity wall function.
Definition: wallBoiling.C:102
const scalarField yPlusLiquid
Dimensionless wall distance.
Definition: wallBoiling.C:105
const scalarField alphatConvLiquid
Liquid convective turbulent thermal diffusivity.
Definition: wallBoiling.C:75
const fluidThermophysicalTransportModel & ttmVapour
Vapour thermophysical transport model.
Definition: wallBoiling.C:72
const fluidThermophysicalTransportModel & ttmLiquid
Liquid thermophysical transport model.
Definition: wallBoiling.C:69
const scalarField & alphaVapour
Vapour volume fraction.
Definition: wallBoiling.C:66
const wallBoiling & model
Wall function field.
Definition: wallBoiling.C:57
const scalarField & alphaLiquid
Liquid volume fraction.
Definition: wallBoiling.C:63
const fvPatch & patch() const
Patch.
Definition: wallBoiling.C:120
const scalarField & CpLiquid
Liquid heat capacity.
Definition: wallBoiling.C:92
const scalarField Tsat
Saturation temperature.
Definition: wallBoiling.C:114
const scalarField TcLiquid
Cell temperature.
Definition: wallBoiling.C:111
const scalarField kappaByCpLiquid
Liquid laminar thermal diffusivity.
Definition: wallBoiling.C:99
const scalarField AbyV
Patch area by neighbouring cell volume ratio.
Definition: wallBoiling.C:81
const scalarField L
Latent heat.
Definition: wallBoiling.C:117