HydrothermalMassFluxPressureFvPatchScalarField.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 | Copyright (C) 2011-2016 OpenFOAM Foundation
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8License
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
27#include "addToRunTimeSelectionTable.H"
28#include "linear.H"
29
30// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31
33(
34 const fvPatch& p,
35 const DimensionedField<scalar, volMesh>& iF
36)
37 :
38 fixedGradientFvPatchScalarField(p, iF),
39 rhorAUfName_("rhorAUf"),
40 phigName_("phig"),
41 q_(p.size(), 0.0)
42{}
43
45(
47 const fvPatch& p,
48 const DimensionedField<scalar, volMesh>& iF,
49 const fvPatchFieldMapper& mapper
50)
51 :
52 fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
53 rhorAUfName_(ptf.rhorAUfName_),
54 phigName_(ptf.phigName_),
55 q_(ptf.q_)
56{}
57
59(
60 const fvPatch& p,
61 const DimensionedField<scalar, volMesh>& iF,
62 const dictionary& dict
63)
64 :
65 fixedGradientFvPatchScalarField(p, iF),
66 rhorAUfName_(dict.lookupOrDefault<word>("rhorAUf", "rhorAUf")),
67 phigName_(dict.lookupOrDefault<word>("phig", "phig")),
68 q_("q", dict, p.size())
69{
70 fvPatchField<scalar>::operator=(patchInternalField());
71 gradient() = 0.0;
72}
73
75(
77)
78 :
79 fixedGradientFvPatchScalarField(ptf),
80 rhorAUfName_(ptf.rhorAUfName_),
81 phigName_(ptf.phigName_),
82 q_(ptf.q_)
83{}
84
86(
88 const DimensionedField<scalar, volMesh>& iF
89)
90 :
91 fixedGradientFvPatchScalarField(ptf, iF),
92 rhorAUfName_(ptf.rhorAUfName_),
93 phigName_(ptf.phigName_),
94 q_(ptf.q_)
95{}
96
97// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
98
100{
101 if (updated())
102 {
103 return;
104 }
105
106 const fvsPatchField<scalar>& rhorAUf=
107 patch().lookupPatchField<surfaceScalarField, scalar>(rhorAUfName_);
108
109 const fvsPatchField<scalar>& phig=
110 patch().lookupPatchField<surfaceScalarField, scalar>(phigName_);
111
112 gradient()=(phig - q_)/rhorAUf/(patch().magSf());
113
114 fixedGradientFvPatchScalarField::updateCoeffs();
115}
116
118{
119 fixedGradientFvPatchScalarField::write(os);
120 // writeEntryIfDifferent<word>(os, "rhorAUf","rhorAUf",rhorAUfName_);
121 writeEntry(os, "q", q_);
122 // writeEntry(os, "value", *this);
123}
124
125// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126
127namespace Foam
128{
130(
131 fvPatchScalarField,
133);
134}
135
136// ************************************************************************* //
volScalarField & p
Definition: createFields.H:10
surfaceScalarField phig("phig",(fvc::interpolate(rho) *rhorAUf *g) &mesh.Sf())
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
HydrothermalMassFluxPressure(const fvPatch &, const DimensionedField< scalar, volMesh > &)
makePatchTypeField(fvPatchScalarField, HydrothermalHeatFlux)