energyJumpAMIFvPatchScalarField.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) 2012-2017 OpenFOAM Foundation
9  Copyright (C) 2022 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 
32 #include "basicThermo.H"
33 
34 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35 
37 (
38  const fvPatch& p,
40 )
41 :
42  fixedJumpAMIFvPatchField<scalar>(p, iF)
43 {}
44 
45 
47 (
49  const fvPatch& p,
51  const fvPatchFieldMapper& mapper
52 )
53 :
54  fixedJumpAMIFvPatchField<scalar>(ptf, p, iF, mapper)
55 {}
56 
57 
59 (
60  const fvPatch& p,
62  const dictionary& dict
63 )
64 :
65  fixedJumpAMIFvPatchField<scalar>(p, iF)
66 {
67  if (dict.found("value"))
68  {
70  (
71  scalarField("value", dict, p.size())
72  );
73  }
74  else
75  {
77  }
78 }
79 
80 
82 (
83  const energyJumpAMIFvPatchScalarField& ptf
84 )
85 :
86  fixedJumpAMIFvPatchField<scalar>(ptf)
87 {}
88 
89 
91 (
94 )
95 :
96  fixedJumpAMIFvPatchField<scalar>(ptf, iF)
97 {}
98 
99 
100 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101 
103 {
104  if (this->updated())
105  {
106  return;
107  }
108 
109  if (this->cyclicAMIPatch().owner())
110  {
111  const basicThermo& thermo = basicThermo::lookupThermo(*this);
112  label patchID = patch().index();
113 
114  const scalarField& pp = thermo.p().boundaryField()[patchID];
115  const fixedJumpAMIFvPatchScalarField& TbPatch =
116  refCast<const fixedJumpAMIFvPatchScalarField>
117  (
119  );
120 
121  fixedJumpAMIFvPatchScalarField& Tbp =
122  const_cast<fixedJumpAMIFvPatchScalarField&>(TbPatch);
123 
124  // force update of jump
126 
127  const labelUList& faceCells = this->patch().faceCells();
128 
129  jump_ =
130  thermo.he(pp, Tbp+Tbp.jump(), faceCells)
131  - thermo.he(pp, Tbp, faceCells);
132  }
133 
135 }
136 
137 
139 {
141  this->writeEntry("value", os);
142 }
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 namespace Foam
148 {
150  (
152  energyJumpAMIFvPatchScalarField
153  );
154 }
155 
156 // ************************************************************************* //
virtual void updateCoeffs()
Update the coefficients.
dictionary dict
"blocking" : (MPI_Bsend, MPI_Recv)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:120
friend Ostream & operator(Ostream &, const fvPatchField< scalar > &)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:68
virtual const volScalarField & T() const
Temperature [K].
Definition: basicThermo.C:615
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:52
Macros for easy insertion into run-time selection tables.
UList< label > labelUList
A UList of labels.
Definition: UList.H:80
virtual volScalarField & he()=0
Enthalpy/Internal energy [J/kg].
virtual volScalarField & p()
Pressure [Pa].
Definition: basicThermo.C:603
psiReactionThermo & thermo
Definition: createFields.H:28
void evaluate()
Evaluate boundary conditions.
fvPatchField< scalar > fvPatchScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A FieldMapper for finite-volume patch fields.
virtual void evaluate(const Pstream::commsTypes commsType)
Evaluate the patch field.
This boundary condition provides an energy jump condition across a pair of coupled patches with an ar...
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
This boundary condition provides a jump condition, across non-conformal cyclic path-pairs, employing an arbitraryMeshInterface (AMI).
OBJstream os(runTime.globalPath()/outputName)
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fvPatchField.C:270
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
const std::string patch
OpenFOAM patch number as a std::string.
energyJumpAMIFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
static const basicThermo & lookupThermo(const fvPatchScalarField &pf)
Definition: basicThermo.C:447
volScalarField & p
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
virtual void write(Ostream &) const
Write.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
virtual void write(Ostream &) const
Write.
Namespace for OpenFOAM.