submarinePressureFvPatchScalarField.H
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
24Class
25 Foam::submarinePressureFvPatchScalarField
26
27Description
28 This boundary condition provides hydrostatic pressure condition on the top or seafloor,
29 calculated as:
30
31 \f[
32 p=\rho \cdot g \cdot h
33 \f]
34
35 where
36 \vartable
37 rho | Density of seawater, default value is 1013 [\f[kg/m^3\f]]
38 g | Acceleration due to gravity [\f[ m/s^2\f]]
39 h | Depth below sea level [m]
40 \endtable
41
42Usage
43 \table
44 Property | Description | Required | Default value
45 rhoValue | Density value | no | 1013
46 \endtable
47
48 Example of the boundary condition specification:
49 \verbatim
50 <patchName>
51 {
52 type submarinePressure;
53 rhoValue uniform 1013;
54 }
55 \endverbatim
56
57See also
58 Foam::fixedValueFvPatchScalarField
59 Foam::prghTotalPressureFvPatchScalarField
60
61SourceFiles
62 submarinePressureFvPatchScalarField.C
63
64\*---------------------------------------------------------------------------*/
65
66#ifndef submarinePressureFvPatchScalarField_H
67#define submarinePressureFvPatchScalarField_H
68
69#include "fixedValueFvPatchFields.H"
70
71// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72
73namespace Foam
74{
75
76/*---------------------------------------------------------------------------*\
77 Class submarinePressureFvPatchScalarField Declaration
78\*---------------------------------------------------------------------------*/
79
81:
82 public fixedValueFvPatchScalarField
83{
84 // Hydrostatic pressure at seafloor is calculated by equation: rhoValue*g*h
85 scalar rhoValue_;
86 scalar p_Atmospheric; //atmospheric pressure
87
88public:
89
90 //- Runtime type information
91 TypeName("submarinePressure");
92
93
94 // Constructors
95
96 //- Construct from patch and internal field
98 (
99 const fvPatch&,
100 const DimensionedField<scalar, volMesh>&
101 );
102
103 //- Construct from patch, internal field and dictionary
105 (
106 const fvPatch&,
107 const DimensionedField<scalar, volMesh>&,
108 const dictionary&
109 );
110
111 //- Construct by mapping given
112 // submarinePressureFvPatchScalarField onto a new patch
114 (
116 const fvPatch&,
117 const DimensionedField<scalar, volMesh>&,
118 const fvPatchFieldMapper&
119 );
120
121 //- Copy constructor
123 (
125 );
126
127 //- Construct and return a clone
128 virtual tmp<fvPatchScalarField> clone() const
129 {
130 return tmp<fvPatchScalarField >
131 (
133 );
134 }
135
136 //- Copy constructor setting internal field reference
138 (
140 const DimensionedField<scalar, volMesh>&
141 );
142
143 //- Construct and return a clone setting internal field reference
144 virtual tmp<fvPatchScalarField> clone
145 (
146 const DimensionedField<scalar, volMesh>& iF
147 ) const
148 {
149 return tmp<fvPatchScalarField>
150 (
152 );
153 }
154
155
156 // Member Functions
157
158 // Evaluation functions
159
160 //- Update the coefficients associated with the patch field
161 virtual void updateCoeffs();
162
163
164 //- Write
165 virtual void write(Ostream&) const;
166};
167
168
169// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171} // End namespace Foam
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175#endif
176
177// ************************************************************************* //
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
submarinePressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)