Adding cfMesh-v1.0 into the repository
[foam-extend-3.2.git] / src / solidModels / thermalModel / thermalLaws / constantThermal / constantThermal.C
blobe9fc054d8884a5fd7dbc2aa1ffe27840f2346288
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     C_(dict.lookup("C")),
51     k_(dict.lookup("k")),
52     alpha_(dict.lookup("alpha")),
53     T0_(dict.lookup("T0"))
57 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
59 Foam::constantThermal::~constantThermal()
63 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
65 Foam::tmp<Foam::volScalarField> Foam::constantThermal::C() const
67     tmp<volScalarField> tresult
68     (
69         new volScalarField
70         (
71             IOobject
72             (
73                 "C",
74                 mesh().time().timeName(),
75                 mesh(),
76                 IOobject::NO_READ,
77                 IOobject::NO_WRITE
78             ),
79             mesh(),
80             C_,
81             zeroGradientFvPatchScalarField::typeName
82         )
83     );
85     tresult().correctBoundaryConditions();
87     return tresult;
91 Foam::tmp<Foam::volScalarField> Foam::constantThermal::k() const
93     tmp<volScalarField> tresult
94     (
95         new volScalarField
96         (
97             IOobject
98             (
99                 "k",
100                 mesh().time().timeName(),
101                 mesh(),
102                 IOobject::NO_READ,
103                 IOobject::NO_WRITE
104             ),
105             mesh(),
106             k_,
107             zeroGradientFvPatchScalarField::typeName
108         )
109     );
111     tresult().correctBoundaryConditions();
113     return tresult;
117 Foam::tmp<Foam::volScalarField> Foam::constantThermal::alpha() const
119     tmp<volScalarField> tresult
120     (
121         new volScalarField
122         (
123             IOobject
124             (
125                 "alpha",
126                 mesh().time().timeName(),
127                 mesh(),
128                 IOobject::NO_READ,
129                 IOobject::NO_WRITE
130             ),
131             mesh(),
132             alpha_,
133             zeroGradientFvPatchScalarField::typeName
134         )
135     );
137     tresult().correctBoundaryConditions();
139     return tresult;
143 Foam::tmp<Foam::volScalarField> Foam::constantThermal::T0() const
145     tmp<volScalarField> tresult
146     (
147         new volScalarField
148         (
149             IOobject
150             (
151                 "T0",
152                 mesh().time().timeName(),
153                 mesh(),
154                 IOobject::NO_READ,
155                 IOobject::NO_WRITE
156             ),
157             mesh(),
158             T0_,
159             zeroGradientFvPatchScalarField::typeName
160         )
161     );
163     tresult().correctBoundaryConditions();
165     return tresult;
169 // ************************************************************************* //