Loading...
Searching...
No Matches
freeSurfacePressureFvPatchScalarField.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) 2019 Zeljko Tukovic, FSB Zagreb.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
30#include "fvPatchFieldMapper.H"
31#include "volFields.H"
36
37// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38
41(
42 const fvPatch& p,
45:
46 fixedValueFvPatchScalarField(p, iF),
47 pa_(p.size(), Zero)
48{}
49
50
53(
54 const fvPatch& p,
56 const dictionary& dict
57)
58:
59 fixedValueFvPatchScalarField(p, iF, dict, IOobjectOption::NO_READ),
60 pa_("pa", dict, p.size())
61{
75 const fvPatchFieldMapper& mapper
77:
78 fixedValueFvPatchScalarField(ptf, p, iF, mapper),
79 pa_(ptf.pa_, mapper)
80{}
81
82
85(
88:
89 fixedValueFvPatchScalarField(ptf),
90 pa_(ptf.pa_)
91{}
92
93
96(
99)
100:
101 fixedValueFvPatchScalarField(ptf, iF),
102 pa_(ptf.pa_)
103{}
104
105
106// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
107
109(
110 const fvPatchFieldMapper& m
112{
113 fixedValueFvPatchScalarField::autoMap(m);
114 pa_.autoMap(m);
115}
116
117
119(
120 const fvPatchScalarField& ptf,
121 const labelList& addr
122)
123{
124 fixedValueFvPatchScalarField::rmap(ptf, addr);
125
128
129 pa_.rmap(tiptf.pa_, addr);
130}
131
132
134{
135 if (updated())
136 {
137 return;
138 }
139
140 // refCast<interfaceTrackingFvMesh>
141 auto* itm =
143 (
144 patch().boundaryMesh().mesh()
145 );
146
147 if (itm)
148 {
149 operator==
150 (
151 pa_ + itm->freeSurfacePressureJump()
152 );
153 }
154 else
155 {
156 // FatalError
157 }
158
159 fixedValueFvPatchScalarField::updateCoeffs();
160}
161
162
164{
166 pa_.writeEntry("pa", os);
169
170
171// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172
173namespace Foam
174{
176 (
179 );
180}
181
182// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
This boundary condition provides static pressure condition for p_rgh, calculated as:
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
freeSurfacePressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A FieldMapper for finite-volume patch fields.
virtual void write(Ostream &) const
Write.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
virtual void operator=(const UList< Type > &)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
volScalarField & p
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
Define a concrete fvPatchField type and add to run-time tables Example, (fvPatchScalarField,...
Namespace for OpenFOAM.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
Definition typeInfo.H:172
List< label > labelList
A List of labels.
Definition List.H:62
Type * isA_constCast(const U &obj)
Attempt dynamic_cast to Type followed by a const_cast of the result.
Definition typeInfo.H:101
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
fvPatchField< scalar > fvPatchScalarField
dictionary dict