energyJumpFvPatchScalarField.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) 2012 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 
28 #include "fixedJumpFvPatchFields.H"
29 #include "basicThermo.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
34 (
35  const fvPatch& p,
37 )
38 :
40 {}
41 
42 
44 (
46  const fvPatch& p,
48  const fvPatchFieldMapper& mapper
49 )
50 :
51  fixedJumpFvPatchField<scalar>(ptf, p, iF, mapper)
52 {}
53 
54 
56 (
57  const fvPatch& p,
59  const dictionary& dict
60 )
61 :
63 {
64  if (dict.found("value"))
65  {
66  fvPatchScalarField::operator=
67  (
68  scalarField("value", dict, p.size())
69  );
70  }
71  else
72  {
73  evaluate(Pstream::blocking);
74  }
75 }
76 
77 
79 (
81 )
82 :
84 {}
85 
86 
88 (
91 )
92 :
94 {}
95 
96 
97 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
98 
100 {
101  if (this->updated())
102  {
103  return;
104  }
105 
106  if (this->cyclicPatch().owner())
107  {
109  label patchID = patch().index();
110 
111  const scalarField& pp = thermo.p().boundaryField()[patchID];
112  const fixedJumpFvPatchScalarField& TbPatch =
113  refCast<const fixedJumpFvPatchScalarField>
114  (
115  thermo.T().boundaryField()[patchID]
116  );
117 
118  fixedJumpFvPatchScalarField& Tbp =
119  const_cast<fixedJumpFvPatchScalarField&>(TbPatch);
120 
121  // force update of jump
122  Tbp.updateCoeffs();
123 
124  const labelUList& faceCells = this->patch().faceCells();
125 
126  jump_ = thermo.he(pp, Tbp.jump(), faceCells);
127  }
128 
130 }
131 
132 
134 {
136  this->writeEntry("value", os);
137 }
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 namespace Foam
143 {
145  (
148  );
149 }
150 
151 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
basicThermo.H
Foam::energyJumpFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients.
Definition: energyJumpFvPatchScalarField.C:99
p
p
Definition: pEqn.H:62
Foam::basicThermo::lookupThermo
static Table::iterator lookupThermo(const dictionary &thermoDict, Table *tablePtr)
Generic lookup for each of the related thermodynamics packages.
Definition: basicThermoTemplates.C:32
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::basicThermo
Abstract base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:52
Foam::fvPatchField< scalar >::updated
bool updated() const
Return true if the boundary condition has already been updated.
Definition: fvPatchField.H:348
Foam::energyJumpFvPatchScalarField
This boundary condition provides an energy jump condition across a pair of coupled patches....
Definition: energyJumpFvPatchScalarField.H:57
energyJumpFvPatchScalarField.H
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::fixedJumpFvPatchField< scalar >
Foam::fixedJumpFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fixedJumpFvPatchField.C:155
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::cyclicFvPatchField< scalar >::cyclicPatch
const cyclicFvPatch & cyclicPatch() const
Return local reference cast into the cyclic patch.
Definition: cyclicFvPatchField.H:163
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::fvPatch::index
label index() const
Return the index of this patch in the fvBoundaryMesh.
Definition: fvPatch.H:179
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::makePatchTypeField
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
Foam::fvPatchField< Type >::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fvPatchField.C:296
Foam::energyJumpFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: energyJumpFvPatchScalarField.C:133
scalarField
volScalarField scalarField(fieldObject, mesh)
fixedJumpFvPatchFields.H
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
Foam::fvPatch::faceCells
virtual const labelUList & faceCells() const
Return faceCells.
Definition: fvPatch.C:93
Foam::energyJumpFvPatchScalarField::energyJumpFvPatchScalarField
energyJumpFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: energyJumpFvPatchScalarField.C:34
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::fvPatchField< scalar >::patch
const fvPatch & patch() const
Return patch.
Definition: fvPatchField.H:300
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::basicThermo::he
virtual volScalarField & he()=0
Enthalpy/Internal energy [J/kg].
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::fixedJumpFvPatchField< scalar >::jump_
Field< scalar > jump_
"jump" field
Definition: fixedJumpFvPatchField.H:107