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) 2016-2018 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 #include "phaseCompressibleTurbulenceModel.H"
29 #include "fvmSup.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 namespace diameterModels
37 {
38 namespace IATEsources
39 {
40  defineTypeNameAndDebug(wallBoiling, 0);
41  addToRunTimeSelectionTable(IATEsource, wallBoiling, dictionary);
42 }
43 }
44 }
45 
46 
47 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48 
50 (
51  const IATE& iate,
52  const dictionary& dict
53 )
54 :
55  IATEsource(iate)
56 {}
57 
58 
59 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
60 
63 (
64  const volScalarField& alphai,
65  volScalarField& kappai
66 ) const
67 {
69  (
70  IOobject
71  (
72  "wallBoiling:R",
73  phase().time().timeName(),
74  phase().mesh()
75  ),
76  phase().mesh(),
78  );
79 
81  (
82  IOobject
83  (
84  "wallBoiling:Rdk",
85  phase().time().timeName(),
86  phase().mesh()
87  ),
88  phase().mesh(),
89  dimensionedScalar("Rdk", kappai.dimensions()/dimTime, 0)
90  );
91 
92  const phaseCompressibleTurbulenceModel& turbulence =
94  (
96  (
98  otherPhase().name()
99  )
100  );
101 
102  const tmp<volScalarField> talphat(turbulence.alphat());
103  const volScalarField::Boundary& alphatBf = talphat().boundaryField();
104 
105  const scalarField& rho = phase().rho();
106 
107  typedef compressible::alphatWallBoilingWallFunctionFvPatchScalarField
108  alphatWallBoilingWallFunction;
109 
110  forAll(alphatBf, patchi)
111  {
112  if
113  (
114  isA<alphatWallBoilingWallFunction>(alphatBf[patchi])
115  )
116  {
117  const alphatWallBoilingWallFunction& alphatw =
118  refCast<const alphatWallBoilingWallFunction>(alphatBf[patchi]);
119 
120  const scalarField& dmdt = alphatw.dmdt();
121  const scalarField& dDep = alphatw.dDeparture();
122 
123  const labelList& faceCells = alphatw.patch().faceCells();
124 
125  forAll(alphatw, facei)
126  {
127  if (dmdt[facei] > small)
128  {
129  const label faceCelli = faceCells[facei];
130  R[faceCelli] =
131  dmdt[facei]/(alphai[faceCelli]*rho[faceCelli]);
132  Rdk[faceCelli] = R[faceCelli]*(6.0/dDep[facei]);
133  }
134  }
135  }
136  }
137 
138  return Rdk - fvm::Sp(R, kappai);
139 }
140 
141 
142 // ************************************************************************* //
dictionary dict
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:428
ThermalDiffusivity< PhaseCompressibleTurbulenceModel< phaseModel > > phaseCompressibleTurbulenceModel
Typedef for phaseCompressibleTurbulenceModel.
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
Type & lookupObjectRef(const word &name) const
Lookup and return the object reference of the given Type.
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
wallBoiling(const IATE &iate, const dictionary &dict)
DimensionedField< scalar, volMesh > Internal
Type of the internal field from which this GeometricField is derived.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
dynamicFvMesh & mesh
static const word propertiesName
Default name of the turbulence properties dictionary.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static word groupName(Name name, const word &group)
word timeName
Definition: getTimeIndex.H:3
List< label > labelList
A List of labels.
Definition: labelList.H:56
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
label patchi
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
#define R(A, B, C, D, E, F, K, M)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
A class for managing temporary objects.
Definition: PtrList.H:53
const objectRegistry & db() const
Return the local objectRegistry.
Definition: IOobject.C:361
Calculate the matrix for implicit and explicit sources.
virtual tmp< volScalarField > R() const =0
Namespace for OpenFOAM.