Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
8e78a278
Commit
8e78a278
authored
5 years ago
by
Andrew Heather
Browse files
Options
Downloads
Patches
Plain Diff
BUG: pressure FO - resolved hydrostatic contribution for incompressible cases. See
#1544
parent
0bbf94fb
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/functionObjects/field/pressure/pressure.C
+6
-5
6 additions, 5 deletions
src/functionObjects/field/pressure/pressure.C
src/functionObjects/field/pressure/pressure.H
+17
-2
17 additions, 2 deletions
src/functionObjects/field/pressure/pressure.H
with
23 additions
and
7 deletions
src/functionObjects/field/pressure/pressure.C
+
6
−
5
View file @
8e78a278
...
...
@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation
Copyright (C) 2016-20
19
OpenCFD Ltd.
Copyright (C) 2016-20
20
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -175,7 +175,8 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressure::rhoScale
void
Foam
::
functionObjects
::
pressure
::
addHydrostaticContribution
(
volScalarField
&
p
const
volScalarField
&
p
,
volScalarField
&
prgh
)
const
{
// Add/subtract hydrostatic contribution
...
...
@@ -206,12 +207,12 @@ void Foam::functionObjects::pressure::addHydrostaticContribution
{
case
ADD
:
{
p
+=
rgh
;
p
rgh
+=
rgh
;
break
;
}
case
SUBTRACT
:
{
p
-=
rgh
;
p
rgh
-=
rgh
;
break
;
}
default:
...
...
@@ -243,7 +244,7 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressure::calcPressure
volScalarField
&
result
=
tresult
.
ref
();
addHydrostaticContribution
(
result
);
addHydrostaticContribution
(
p
,
result
);
if
(
mode_
&
STATIC
)
{
...
...
This diff is collapsed.
Click to expand it.
src/functionObjects/field/pressure/pressure.H
+
17
−
2
View file @
8e78a278
...
...
@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation
Copyright (C) 2016-20
19
OpenCFD Ltd.
Copyright (C) 2016-20
20
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -101,6 +101,8 @@ Usage
UInf | Freestream velocity for coefficient calculation | no |
rhoInf | Freestream density for coefficient calculation | no |
hydrostaticMode | Hydrostatic contributions (see below) | no | none
g | Gravity vector (see below) | no |
hRef | Reference height (see below) | no |
\endtable
The \c mode entry is used to select the type of pressure that is calculated.
...
...
@@ -117,6 +119,15 @@ Usage
- \c add : add the term, e.g. to convert from p_rgh to p
- \c subtract : subtract the term, e.g. to convert from p to p_rgh
If the \c hydrostaticMode is active, values are also required for
gravity, \c g, and reference height, \c hRef. By default these will be
retrieved from the database. When these values are not available
the user must provide them, e.g.
\verbatim
g (0 -9.81 0);
hRef 0;
\endverbatim
See also
Foam::functionObjects::fieldExpression
...
...
@@ -247,7 +258,11 @@ private:
)
const
;
//- Add the hydrostatic contribution
void
addHydrostaticContribution
(
volScalarField
&
p
)
const
;
void
addHydrostaticContribution
(
const
volScalarField
&
p
,
volScalarField
&
prgh
)
const
;
//- Calculate and return the pressure
tmp
<
volScalarField
>
calcPressure
...
...
This diff is collapsed.
Click to expand it.
Andrew Heather
@andy
mentioned in issue
#1544 (closed)
·
5 years ago
mentioned in issue
#1544 (closed)
mentioned in issue #1544
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment