wallBoilingProperties.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) 2022-2023 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 "wallBoilingProperties.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace functionObjects
35 {
37 
39  (
43  );
44 }
45 }
46 
47 
48 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 
51 (
52  const word& name,
53  const Time& runTime,
54  const dictionary& dict
55 )
56 :
57  fvMeshFunctionObject(name, runTime, dict),
58  phase_
59  (
60  mesh_.lookupObject<phaseModel>
61  (
62  IOobject::groupName("alpha", dict.lookup("phase"))
63  )
64  ),
65  fluid_(mesh_.lookupObject<phaseSystem>("phaseProperties"))
66 {
67  read(dict);
68 }
69 
70 
71 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
72 
74 {}
75 
76 
77 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
78 
80 {
82 
83  return true;
84 }
85 
86 
88 {
89  return true;
90 }
91 
92 
94 {
95  volScalarField dDeparture
96  (
98  (
99  IOobject::groupName("dDeparture", phase_.name()),
100  mesh_,
102  )
103  );
104  volScalarField fDeparture
105  (
107  (
108  IOobject::groupName("fDeparture", phase_.name()),
109  mesh_,
111  )
112  );
113  volScalarField nucleationSiteDensity
114  (
116  (
117  IOobject::groupName("nucleationSiteDensity", phase_.name()),
118  mesh_,
120  )
121  );
122  volScalarField wetFraction
123  (
125  (
126  IOobject::groupName("wetFraction", phase_.name()),
127  mesh_,
129  )
130  );
131  volScalarField qQuenching
132  (
134  (
135  IOobject::groupName("qQuenching", phase_.name()),
136  mesh_,
138  )
139  );
140  volScalarField qEvaporative
141  (
143  (
144  IOobject::groupName("qEvaporative", phase_.name()),
145  mesh_,
147  )
148  );
149 
151  alphatWallBoilingWallFunction;
152 
153  const word alphatName =
154  IOobject::groupName("alphat", phase_.name());
155 
156  if (phase_.mesh().foundObject<volScalarField>(alphatName))
157  {
158  const volScalarField& alphat =
159  phase_.mesh().lookupObject<volScalarField>(alphatName);
160 
161  const volScalarField::Boundary& alphatBf = alphat.boundaryField();
162 
163  forAll(alphatBf, patchi)
164  {
165  if (isA<alphatWallBoilingWallFunction>(alphatBf[patchi]))
166  {
167  const alphatWallBoilingWallFunction& alphatw =
168  refCast<const alphatWallBoilingWallFunction>
169  (alphatBf[patchi]);
170 
171  dDeparture.boundaryFieldRef()[patchi] =
172  alphatw.dDeparture();
173  fDeparture.boundaryFieldRef()[patchi] =
174  alphatw.fDeparture();
175  nucleationSiteDensity.boundaryFieldRef()[patchi] =
176  alphatw.nucleationSiteDensity();
177  wetFraction.boundaryFieldRef()[patchi] =
178  alphatw.wetFraction();
179  qQuenching.boundaryFieldRef()[patchi] =
180  alphatw.qQuenching();
181  qEvaporative.boundaryFieldRef()[patchi] =
182  alphatw.qEvaporative();
183  }
184  }
185  }
186 
187  dDeparture.write();
188  fDeparture.write();
189  nucleationSiteDensity.write();
190  wetFraction.write();
191  qQuenching.write();
192  qEvaporative.write();
193 
194  return true;
195 }
196 
197 
198 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
Macros for easy insertion into run-time selection tables.
const Mesh & mesh() const
Return mesh.
Generic GeometricBoundaryField class.
Generic GeometricField class.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &)
Return a temporary field constructed from name,.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
static word groupName(Name name, const word &group)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
A thermal wall function for simulation of subcooled nucleate wall boiling with runtime selectable sub...
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Abstract base-class for Time/database functionObjects.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
virtual bool read(const dictionary &)
Read optional controls.
This function looks up wall boiling wall functions and collects and writes out out the following data...
wallBoilingProperties(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual bool execute()
Calculate the wallBoilingProperties field.
virtual bool write()
Write the wallBoilingProperties field.
virtual bool read(const dictionary &)
Read the wallBoilingProperties data.
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:73
virtual bool write(const bool write=true) const
Write using setting from DB.
A class for handling words, derived from string.
Definition: word.H:62
label patchi
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, dictionary)
Namespace for OpenFOAM.
const dimensionSet dimEnergy
const dimensionSet dimless
const dimensionSet dimLength
const dimensionSet dimTime
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
const dimensionSet dimArea
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
dictionary dict