fixedRhoFvPatchScalarField.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) 2011-2012 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
31 #include "fvPatchFieldMapper.H"
32 #include "volFields.H"
33 
34 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35 
37 (
38  const fvPatch& p,
39  const DimensionedField<scalar, volMesh>& iF
40 )
41 :
42  fixedValueFvPatchScalarField(p, iF),
43  pName_("p"),
44  psiName_("thermo:psi")
45 {}
46 
47 
49 (
50  const fixedRhoFvPatchScalarField& ptf,
51  const fvPatch& p,
52  const DimensionedField<scalar, volMesh>& iF,
53  const fvPatchFieldMapper& mapper
54 )
55 :
56  fixedValueFvPatchScalarField(ptf, p, iF, mapper),
57  pName_(ptf.pName_),
58  psiName_(ptf.psiName_)
59 {}
60 
61 
63 (
64  const fvPatch& p,
65  const DimensionedField<scalar, volMesh>& iF,
66  const dictionary& dict
67 )
68 :
69  fixedValueFvPatchScalarField(p, iF, dict),
70  pName_(dict.getOrDefault<word>("p", "p")),
71  psiName_(dict.getOrDefault<word>("psi", "thermo:psi"))
72 {}
73 
74 
76 (
77  const fixedRhoFvPatchScalarField& frpsf
78 )
79 :
80  fixedValueFvPatchScalarField(frpsf),
81  pName_(frpsf.pName_),
82  psiName_(frpsf.psiName_)
83 {}
84 
85 
87 (
88  const fixedRhoFvPatchScalarField& frpsf,
89  const DimensionedField<scalar, volMesh>& iF
90 )
91 :
92  fixedValueFvPatchScalarField(frpsf, iF),
93  pName_(frpsf.pName_),
94  psiName_(frpsf.psiName_)
95 {}
96 
97 
98 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
99 
101 {
102  if (updated())
103  {
104  return;
105  }
106 
107  const fvPatchField<scalar>& psip =
108  patch().lookupPatchField<volScalarField, scalar>(psiName_);
109 
110  const fvPatchField<scalar>& pp =
111  patch().lookupPatchField<volScalarField, scalar>(pName_);
112 
113  operator==(psip*pp);
114 
115  fixedValueFvPatchScalarField::updateCoeffs();
116 }
117 
118 
119 void Foam::fixedRhoFvPatchScalarField::write(Ostream& os) const
120 {
122 
123  os.writeEntryIfDifferent<word>("p", "p", pName_);
124  os.writeEntryIfDifferent<word>("psi", "thermo:psi", psiName_);
125  writeEntry("value", os);
126 }
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 namespace Foam
131 {
133  (
135  fixedRhoFvPatchScalarField
136  );
137 }
138 
139 // ************************************************************************* //
Foam::fvPatchScalarField
fvPatchField< scalar > fvPatchScalarField
Definition: fvPatchFieldsFwd.H:33
volFields.H
Foam::fvPatchField::write
virtual void write(Ostream &) const
Definition: fvPatchField.C:377
Foam::Ostream::writeEntryIfDifferent
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Definition: Ostream.H:244
p
volScalarField & p
Definition: createFieldRefs.H:8
fvPatchFieldMapper.H
Foam::fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField
fixedRhoFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Foam::operator==
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:53
dict
dictionary dict
Definition: searchingEngine.H:14
fixedRhoFvPatchScalarField.H
os
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Definition: atmBoundaryLayer.C:26
Foam::fixedRhoFvPatchScalarField::write
virtual void write(Ostream &) const
Foam::fixedRhoFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Foam::foamVersion::patch
const std::string patch
Foam::makePatchTypeField
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)