constantRadiation.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) 2012-2020 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 "constantRadiation.H"
28 
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace regionModels
34 {
35 namespace surfaceFilmModels
36 {
37 
38 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
39 
40 defineTypeNameAndDebug(constantRadiation, 0);
41 
43 (
44  radiationModel,
45  constantRadiation,
46  dictionary
47 );
48 
49 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
50 
52 (
54  const dictionary& dict
55 )
56 :
57  radiationModel(typeName, film, dict),
58  qrConst_
59  (
60  IOobject
61  (
62  IOobject::modelName("qrConst", typeName),
63  film.time().timeName(),
64  film.regionMesh(),
67  ),
68  film.regionMesh()
69  ),
70  mask_
71  (
72  IOobject
73  (
74  IOobject::modelName("mask", typeName),
75  film.time().timeName(),
76  film.regionMesh(),
79  ),
80  film.regionMesh(),
82  ),
83  absorptivity_(coeffDict_.lookup<scalar>("absorptivity")),
84  timeStart_(coeffDict_.lookup<scalar>("timeStart")),
85  duration_(coeffDict_.lookup<scalar>("duration"))
86 {
87  mask_ = pos0(mask_);
88 }
89 
90 
91 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
92 
94 {}
95 
96 
97 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
98 
100 {}
101 
102 
104 {
105  const scalar time = film().time().value();
106 
107  if ((time >= timeStart_) && (time <= timeStart_ + duration_))
108  {
110  (
111  IOobject::modelName("Shs", typeName),
112  mask_*qrConst_*filmModel_.coverage()*absorptivity_
113  );
114  }
115  else
116  {
118  (
119  IOobject::modelName("Shs", typeName),
120  film().regionMesh(),
122  );
123  }
124 }
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 } // End namespace surfaceFilmModels
130 } // End namespace regionModels
131 } // End namespace Foam
132 
133 // ************************************************************************* //
static tmp< DimensionedField< Type, GeoMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &)
Return a temporary field constructed from name, mesh.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Definition: Time.C:636
const dimensionSet dimless
const Time & time() const
Return the reference to the time database.
Definition: regionModelI.H:37
virtual tmp< volScalarField::Internal > Shs()
Return the radiation sensible enthalpy source.
Macros for easy insertion into run-time selection tables.
const surfaceFilmRegionModel & film() const
Return const access to the film surface film model.
const dimensionSet dimTime
const Type & value() const
Return const reference to value.
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:55
dimensionedScalar pos0(const dimensionedScalar &ds)
const dimensionSet dimMass
dimensionedScalar pow3(const dimensionedScalar &ds)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
surfaceFilmRegionModel & filmModel_
Reference to the film surface film model.
virtual const volScalarField & coverage() const =0
Return the film coverage, 1 = covered, 0 = uncovered / [].
static word modelName(Name name, const word &model)
Return the name of the object within the given model.
A class for managing temporary objects.
Definition: PtrList.H:53
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
defineTypeNameAndDebug(kinematicSingleLayer, 0)
constantRadiation(surfaceFilmRegionModel &film, const dictionary &dict)
Construct from surface film model and dictionary.
addToRunTimeSelectionTable(surfaceFilmModel, noFilm, mesh)
Namespace for OpenFOAM.