alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.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 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 
27 #include "fvPatchFieldMapper.H"
29 
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace compressible
35 {
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
41 (
42  const fvPatch& p,
43  const DimensionedField<scalar, volMesh>& iF
44 )
45 :
46  alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF),
47  relax_(1.0),
48  fixedDmdt_(0.0),
49  L_(0.0)
50 {
51  checkType();
52 }
53 
54 
55 alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
56 alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
57 (
58  const fvPatch& p,
59  const DimensionedField<scalar, volMesh>& iF,
60  const dictionary& dict
61 )
62 :
63  alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF, dict),
64  relax_(dict.lookupOrDefault<scalar>("relax", 1.0)),
65  fixedDmdt_(dict.lookupOrDefault<scalar>("fixedDmdt", 0.0)),
66  L_(dict.lookupOrDefault<scalar>("L", 0.0))
67 {}
68 
69 
70 alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
71 alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
72 (
73  const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& psf,
74  const fvPatch& p,
75  const DimensionedField<scalar, volMesh>& iF,
76  const fvPatchFieldMapper& mapper
77 )
78 :
79  alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField
80  (
81  psf,
82  p,
83  iF,
84  mapper
85  ),
86  fixedDmdt_(psf.fixedDmdt_),
87  L_(psf.L_)
88 {}
89 
90 
91 alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
92 alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
93 (
94  const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& psf
95 )
96 :
97  alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf),
98  relax_(psf.relax_),
99  fixedDmdt_(psf.fixedDmdt_),
100  L_(psf.L_)
101 {}
102 
103 alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
104 alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
105 (
106  const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& psf,
107  const DimensionedField<scalar, volMesh>& iF
108 )
109 :
110  alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf, iF),
111  relax_(psf.relax_),
112  fixedDmdt_(psf.fixedDmdt_),
113  L_(psf.L_)
114 {}
115 
116 
117 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
118 
119 void alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
120 {
121  if (updated())
122  {
123  return;
124  }
125 
126  dmdt_ = (1 - relax_)*dmdt_ + relax_*fixedDmdt_;
127  mDotL_ = dmdt_*L_;
128 
129  operator==(calcAlphat(*this));
130 
131  fixedValueFvPatchScalarField::updateCoeffs();
132 }
133 
134 
136 (
137  Ostream& os
138 ) const
139 {
141  os.writeKeyword("relax") << relax_ << token::END_STATEMENT << nl;
142  os.writeKeyword("fixedDmdt") << fixedDmdt_ << token::END_STATEMENT << nl;
143  os.writeKeyword("L") << L_ << token::END_STATEMENT << nl;
144  dmdt_.writeEntry("dmdt", os);
145  writeEntry("value", os);
146 }
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
152 (
154  alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
155 );
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace compressible
161 } // End namespace Foam
162 
163 // ************************************************************************* //
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
Definition: fvPatchField.H:655
dictionary dict
Macros for easy insertion into run-time selection tables.
fvPatchField< scalar > fvPatchScalarField
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
static const char nl
Definition: Ostream.H:262
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
volScalarField & p
runTime write()
Namespace for OpenFOAM.
bool compressible
Definition: pEqn.H:30