submarinePressureFvPatchScalarField.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) 2016-2019 OpenFOAM Foundation
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8License
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
27#include "addToRunTimeSelectionTable.H"
28#include "fvPatchFieldMapper.H"
29#include "volFields.H"
30#include "surfaceFields.H"
31#include "uniformDimensionedFields.H"
32
33// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34
37(
38 const fvPatch& p,
39 const DimensionedField<scalar, volMesh>& iF
40)
41:
42 fixedValueFvPatchScalarField(p, iF),
43 rhoValue_(1013),
44 p_Atmospheric(0.1e6)
45{}
46
47
50(
51 const fvPatch& p,
52 const DimensionedField<scalar, volMesh>& iF,
53 const dictionary& dict
54)
55:
56 fixedValueFvPatchScalarField(p, iF, dict),
57 rhoValue_(dict.lookupOrDefault<scalar>("rhoValue",1013)),
58 // rhoValue_(readScalar(dict.lookup("rhoValue"))),
59 p_Atmospheric(0.1e6)
60{}
61
62
65(
67 const fvPatch& p,
68 const DimensionedField<scalar, volMesh>& iF,
69 const fvPatchFieldMapper& mapper
70)
71:
72 fixedValueFvPatchScalarField(ptf, p, iF, mapper),
73 rhoValue_(ptf.rhoValue_),
74 p_Atmospheric(0.1e6)
75{}
76
77
80(
82)
83:
84 fixedValueFvPatchScalarField(ptf),
85 rhoValue_(ptf.rhoValue_),
86 p_Atmospheric(0.1e6)
87{}
88
89
92(
94 const DimensionedField<scalar, volMesh>& iF
95)
96:
97 fixedValueFvPatchScalarField(ptf, iF),
98 rhoValue_(ptf.rhoValue_),
99 p_Atmospheric(0.1e6)
100{}
101
102
103// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
104
106{
107 if (updated())
108 {
109 return;
110 }
111 const uniformDimensionedVectorField& g = db().lookupObject<uniformDimensionedVectorField>("g");
112 // atmospheric pressure plus hydrostatic pressure of water
113 operator==
114 (
115 p_Atmospheric + rhoValue_ * (g.value() & patch().Cf())
116 );
117 fixedValueFvPatchScalarField::updateCoeffs();
118}
119
120
122(
123 Ostream& os
124) const
125{
126 fvPatchScalarField::write(os);
127 writeEntry(os, "rhoValue_", rhoValue_);
128 writeEntry(os, "value", *this);
129}
130
131
132// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133
134namespace Foam
135{
137 (
138 fvPatchScalarField,
140 );
141}
142
143// ************************************************************************* //
volScalarField & p
Definition: createFields.H:10
submarinePressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
makePatchTypeField(fvPatchScalarField, HydrothermalHeatFlux)