Avoid race condition with single processor compilation of conjugateHeatFoam
[foam-extend-3.0.git] / applications / solvers / coupled / conjugateHeatTransfer / thermalModel / thermalLaws / constantThermal / constantThermal.C
blobc25ab3d9cc114bd577a9abafdda8a65240254258
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     |
5     \\  /    A nd           | For copyright notice see file Copyright
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation, either version 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "constantThermal.H"
27 #include "addToRunTimeSelectionTable.H"
28 #include "zeroGradientFvPatchFields.H"
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 namespace Foam
34     defineTypeNameAndDebug(constantThermal, 0);
35     addToRunTimeSelectionTable(thermalLaw, constantThermal, dictionary);
39 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
41 // Construct from dictionary
42 Foam::constantThermal::constantThermal
44     const word& name,
45     const volScalarField& T,
46     const dictionary& dict
49     thermalLaw(name, T, dict),
50     rho_(dict.lookup("rho")),
51     C_(dict.lookup("C")),
52     k_(dict.lookup("k"))
56 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
58 Foam::constantThermal::~constantThermal()
62 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
64 Foam::tmp<Foam::volScalarField> Foam::constantThermal::rho() const
66     tmp<volScalarField> tresult
67     (
68         new volScalarField
69         (
70             IOobject
71             (
72                 "rho",
73                 mesh().time().timeName(),
74                 mesh(),
75                 IOobject::NO_READ,
76                 IOobject::NO_WRITE
77             ),
78             mesh(),
79             rho_,
80             zeroGradientFvPatchScalarField::typeName
81         )
82     );
84     tresult().correctBoundaryConditions();
86     return tresult;
89 Foam::tmp<Foam::volScalarField> Foam::constantThermal::C() const
91     tmp<volScalarField> tresult
92     (
93         new volScalarField
94         (
95             IOobject
96             (
97                 "C",
98                 mesh().time().timeName(),
99                 mesh(),
100                 IOobject::NO_READ,
101                 IOobject::NO_WRITE
102             ),
103             mesh(),
104             C_,
105             zeroGradientFvPatchScalarField::typeName
106         )
107     );
109     tresult().correctBoundaryConditions();
111     return tresult;
115 Foam::tmp<Foam::volScalarField> Foam::constantThermal::k() const
117     tmp<volScalarField> tresult
118     (
119         new volScalarField
120         (
121             IOobject
122             (
123                 "kTmp",
124                 mesh().time().timeName(),
125                 mesh(),
126                 IOobject::NO_READ,
127                 IOobject::NO_WRITE
128             ),
129             mesh(),
130             k_,
131             zeroGradientFvPatchScalarField::typeName
132         )
133     );
135     tresult().correctBoundaryConditions();
137     return tresult;
141 // ************************************************************************* //