fanFvPatchField.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) 2011-2018 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 "fanFvPatchField.H"
27 
28 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
29 
30 template<class Type>
32 {
33  if (this->cyclicPatch().owner())
34  {
35  this->jump_ = this->jumpTable_->value(this->db().time().value());
36  }
37 }
38 
39 
40 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
41 
42 template<class Type>
44 (
45  const fvPatch& p,
47 )
48 :
50  phiName_("phi"),
51  rhoName_("rho")
52 {}
53 
54 
55 template<class Type>
57 (
58  const fvPatch& p,
60  const dictionary& dict
61 )
62 :
64  phiName_(dict.lookupOrDefault<word>("phi", "phi")),
65  rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
66 {}
67 
68 
69 template<class Type>
71 (
72  const fanFvPatchField<Type>& ptf,
73  const fvPatch& p,
75  const fvPatchFieldMapper& mapper
76 )
77 :
78  uniformJumpFvPatchField<Type>(ptf, p, iF, mapper),
79  phiName_(ptf.phiName_),
80  rhoName_(ptf.rhoName_)
81 {}
82 
83 
84 template<class Type>
86 (
87  const fanFvPatchField<Type>& ptf
88 )
89 :
91  phiName_(ptf.phiName_),
92  rhoName_(ptf.rhoName_)
93 {}
94 
95 
96 template<class Type>
98 (
99  const fanFvPatchField<Type>& ptf,
101 )
102 :
104  phiName_(ptf.phiName_),
105  rhoName_(ptf.rhoName_)
106 {}
107 
108 
109 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
110 
111 template<class Type>
113 {
114  if (this->updated())
115  {
116  return;
117  }
118 
119  calcFanJump();
120 
121  // Call fixedJump variant - uniformJump will overwrite the jump value
123 }
124 
125 
126 template<class Type>
128 {
130  this->template writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
131  this->template writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
132 }
133 
134 
135 // ************************************************************************* //
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
This boundary condition provides a jump condition, using the cyclic condition as a base...
void write(Ostream &, const label, const dictionary &)
Write with dictionary lookup.
A class for handling words, derived from string.
Definition: word.H:59
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
This boundary condition provides a jump condition, using the cyclic condition as a base...
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
fanFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
volScalarField & p
This boundary condition provides a jump condition, using the cyclic condition as a base...
virtual void write(Ostream &) const
Write.