Loading...
Searching...
No Matches
JohnsonJacksonParticleSlipFvPatchVectorField.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2014-2019 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
30#include "twoPhaseSystem.H"
31
32// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33
34namespace Foam
35{
37 (
40 );
41}
42
43
44// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45
48(
49 const fvPatch& p,
52:
53 partialSlipFvPatchVectorField(p, iF),
54 specularityCoefficient_("specularityCoefficient", dimless, Zero)
55{}
56
57
60(
62 const fvPatch& p,
64 const fvPatchFieldMapper& mapper
66:
67 partialSlipFvPatchVectorField(ptf, p, iF, mapper),
68 specularityCoefficient_(ptf.specularityCoefficient_)
69{}
70
71
74(
75 const fvPatch& p,
77 const dictionary& dict
78)
79:
80 partialSlipFvPatchVectorField(p, iF),
81 specularityCoefficient_("specularityCoefficient", dimless, dict)
82{
83 if
84 (
85 (specularityCoefficient_.value() < 0)
86 || (specularityCoefficient_.value() > 1)
87 )
88 {
89 FatalErrorInFunction
90 << "The specularity coefficient has to be between 0 and 1"
100(
103:
104 partialSlipFvPatchVectorField(ptf),
105 specularityCoefficient_(ptf.specularityCoefficient_)
106{}
107
108
111(
114)
115:
116 partialSlipFvPatchVectorField(ptf, iF),
117 specularityCoefficient_(ptf.specularityCoefficient_)
118{}
119
120
121// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
122
124(
126)
127{
128 partialSlipFvPatchVectorField::autoMap(m);
129}
130
131
133(
134 const fvPatchVectorField& ptf,
135 const labelList& addr
136)
137{
138 partialSlipFvPatchVectorField::rmap(ptf, addr);
139}
140
141
143{
144 if (updated())
145 {
146 return;
147 }
148
149 // lookup the fluid model and the phase
150 const twoPhaseSystem& fluid = db().lookupObject<twoPhaseSystem>
151 (
152 "phaseProperties"
153 );
154
155 const phaseModel& phased
156 (
157 fluid.phase1().name() == internalField().group()
158 ? fluid.phase1()
159 : fluid.phase2()
160 );
161
162 // lookup all the fields on this patch
164 (
165 patch().lookupPatchField<volScalarField>
166 (
167 phased.volScalarField::name()
168 )
169 );
170
171 const fvPatchScalarField& gs0
172 (
173 patch().lookupPatchField<volScalarField>
174 (
175 IOobject::groupName("gs0", phased.name())
176 )
177 );
178
179 const scalarField nu
180 (
181 patch().lookupPatchField<volScalarField>
182 (
183 IOobject::groupName("nut", phased.name())
184 )
185 );
186
187 const scalarField nuFric
188 (
189 patch().lookupPatchField<volScalarField>
190 (
191 IOobject::groupName("nuFric", phased.name())
192 )
193 );
194
195 word ThetaName(IOobject::groupName("Theta", phased.name()));
196
197 const fvPatchScalarField& Theta
198 (
199 db().foundObject<volScalarField>(ThetaName)
200 ? patch().lookupPatchField<volScalarField>(ThetaName)
201 : alpha
202 );
203
204 // lookup the packed volume fraction
206 (
207 "alphaMax",
208 dimless,
209 db()
210 .lookupObject<IOdictionary>
211 (
212 IOobject::groupName("turbulenceProperties", phased.name())
213 )
214 .subDict("RAS")
215 .subDict("kineticTheoryCoeffs")
216 );
217
218 // calculate the slip value fraction
220 (
222 *alpha
223 *gs0
224 *specularityCoefficient_.value()
225 *sqrt(3*Theta)
226 /max(6*(nu - nuFric)*alphaMax.value(), SMALL)
227 );
229 this->valueFraction() = c/(c + patch().deltaCoeffs());
230
231 partialSlipFvPatchVectorField::updateCoeffs();
232}
233
234
236(
237 Ostream& os
238) const
239{
241 os.writeEntry("specularityCoefficient", specularityCoefficient_);
243}
244
245
246// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
twoPhaseSystem & fluid
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
@ MUST_READ
Reading required.
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
Partial slip boundary condition for the particulate velocity.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
JohnsonJacksonParticleSlipFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const Type & value() const noexcept
Return const reference to value.
A FieldMapper for finite-volume patch fields.
virtual void write(Ostream &) const
Write.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition phaseModel.H:56
Class which solves the volume fraction equations for two phases.
A class for handling words, derived from Foam::string.
Definition word.H:66
volScalarField & p
OBJstream os(runTime.globalPath()/outputName)
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
Define a concrete fvPatchField type and add to run-time tables Example, (fvPatchScalarField,...
constexpr scalar pi(M_PI)
Namespace for OpenFOAM.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition hashSets.C:40
const dimensionSet dimless
Dimensionless.
List< label > labelList
A List of labels.
Definition List.H:62
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar sqrt(const dimensionedScalar &ds)
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
fvPatchField< vector > fvPatchVectorField
fvPatchField< scalar > fvPatchScalarField
volScalarField & nu
volScalarField & alpha
dictionary dict
dimensionedScalar alphaMax("alphaMax", dimless/dimTime, laminarTransport)