wallBoiling.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) 2016-2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
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 
28 #include "wallBoiling.H"
29 #include "phaseCompressibleTurbulenceModel.H"
31 #include "fvmSup.H"
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 namespace diameterModels
39 {
40 namespace IATEsources
41 {
42  defineTypeNameAndDebug(wallBoiling, 0);
43  addToRunTimeSelectionTable(IATEsource, wallBoiling, dictionary);
44 }
45 }
46 }
47 
48 
49 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
50 
52 (
53  const IATE& iate,
54  const dictionary& dict
55 )
56 :
57  IATEsource(iate)
58 {}
59 
60 
61 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
62 
65 (
66  const volScalarField& alphai,
67  volScalarField& kappai
68 ) const
69 {
71  (
72  IOobject
73  (
74  "wallBoiling:R",
75  phase().time().timeName(),
76  phase().mesh()
77  ),
78  phase().mesh(),
80  );
81 
83  (
84  IOobject
85  (
86  "wallBoiling:Rdk",
87  phase().time().timeName(),
88  phase().mesh()
89  ),
90  phase().mesh(),
91  dimensionedScalar(kappai.dimensions()/dimTime)
92  );
93 
95  phase().db().lookupObjectRef<phaseCompressibleTurbulenceModel>
96  (
97  IOobject::groupName
98  (
99  turbulenceModel::propertiesName,
100  otherPhase().name()
101  )
102  );
103 
104  const tmp<volScalarField> talphat(turbulence.alphat());
105  const volScalarField::Boundary& alphatBf = talphat().boundaryField();
106 
107  const scalarField& rho = phase().rho();
108 
110  alphatWallBoilingWallFunction;
111 
112  forAll(alphatBf, patchi)
113  {
114  if
115  (
116  isA<alphatWallBoilingWallFunction>(alphatBf[patchi])
117  )
118  {
119  const alphatWallBoilingWallFunction& alphatw =
120  refCast<const alphatWallBoilingWallFunction>(alphatBf[patchi]);
121 
122  const scalarField& dmdt = alphatw.dmdt();
123  const scalarField& dDep = alphatw.dDeparture();
124 
125  const labelList& faceCells = alphatw.patch().faceCells();
126 
127  forAll(alphatw, facei)
128  {
129  if (dmdt[facei] > SMALL)
130  {
131  const label faceCelli = faceCells[facei];
132  R[faceCelli] =
133  dmdt[facei]/(alphai[faceCelli]*rho[faceCelli]);
134  Rdk[faceCelli] = R[faceCelli]*(6.0/dDep[facei]);
135  }
136  }
137  }
138  }
139 
140  return Rdk - fvm::Sp(R, kappai);
141 }
142 
143 
144 // ************************************************************************* //
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::diameterModels::IATEsources::defineTypeNameAndDebug
defineTypeNameAndDebug(dummy, 0)
turbulence
Info<< "Reading field U\n"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\n"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
Foam::phase
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phase.H:54
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
alphatWallBoilingWallFunctionFvPatchScalarField.H
Foam::diameterModels::IATE
IATE (Interfacial Area Transport Equation) bubble diameter model.
Definition: IATE.H:68
Sp
zeroField Sp
Definition: alphaSuSp.H:2
Foam::diameterModels::IATEsource::R
virtual tmp< volScalarField > R() const =0
rho
rho
Definition: readInitialConditions.H:88
Foam::compressible::alphatWallBoilingWallFunctionFvPatchScalarField
A thermal wall function for simulation of boiling wall.
Definition: alphatWallBoilingWallFunctionFvPatchScalarField.H:438
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:53
R
#define R(A, B, C, D, E, F, K, M)
Foam::diameterModels::IATEsources::addToRunTimeSelectionTable
addToRunTimeSelectionTable(IATEsource, dummy, word)
Foam::Field< scalar >
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
timeName
word timeName
Definition: getTimeIndex.H:3
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::diameterModels::IATEsource
IATE (Interfacial Area Transport Equation) bubble diameter model run-time selectable sources.
Definition: IATEsource.H:56
wallBoiling.H
fvmSup.H
Calculate the matrix for implicit and explicit sources.
Foam::ThermalDiffusivity
Templated wrapper class to provide compressible turbulence models thermal diffusivity based thermal t...
Definition: phaseCompressibleTurbulenceModelFwd.H:47
Foam::List< label >
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::faceCells
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:56
Foam::diameterModels::IATEsources::wallBoiling::wallBoiling
wallBoiling(const IATE &iate, const dictionary &dict)
Definition: wallBoiling.C:52
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::dimless
const dimensionSet dimless
Dimensionless.
Definition: dimensionSets.C:189
Foam::phase::rho
const dimensionedScalar & rho() const
Return const-access to phase1 density.
Definition: phase.H:140