Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
OpenFOAM-plus
Commits
06f80912
Commit
06f80912
authored
Jun 24, 2019
by
Andrew Heather
Browse files
STYLE: pressure FO - provided feedback re: which calculation mode is applied
parent
9370053b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/functionObjects/field/pressure/pressure.C
View file @
06f80912
...
...
@@ -157,8 +157,10 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressure::calcPressure
}
case
ISENTROPIC
:
{
DebugVar
(
"getting thermo"
);
const
basicThermo
*
thermoPtr
=
p
.
mesh
().
lookupObjectPtr
<
basicThermo
>
(
basicThermo
::
dictName
);
DebugVar
(
"got thermo"
);
if
(
!
thermoPtr
)
{
...
...
@@ -167,14 +169,16 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressure::calcPressure
<<
"thermodynamics package"
<<
exit
(
FatalError
);
}
DebugVar
(
"calc gamma"
);
const
volScalarField
gamma
(
thermoPtr
->
gamma
());
DebugVar
(
gamma
);
const
volScalarField
Mb
(
mag
(
lookupObject
<
volVectorField
>
(
UName_
))
/
sqrt
(
gamma
*
tp
.
ref
()
/
thermoPtr
->
rho
())
);
DebugVar
(
Mb
);
return
tp
()
*
(
pow
(
1
+
(
gamma
-
1
)
/
2
*
sqr
(
Mb
),
gamma
/
(
gamma
-
1
)));
}
...
...
@@ -270,6 +274,8 @@ Foam::functionObjects::pressure::pressure
bool
Foam
::
functionObjects
::
pressure
::
read
(
const
dictionary
&
dict
)
{
Info
<<
type
()
<<
" "
<<
name
()
<<
":"
<<
nl
;
fieldExpression
::
read
(
dict
);
UName_
=
dict
.
lookupOrDefault
<
word
>
(
"U"
,
"U"
);
...
...
@@ -306,6 +312,8 @@ bool Foam::functionObjects::pressure::read(const dictionary& dict)
}
}
Info
<<
" operating mode: "
<<
modeNames
[
mode_
]
<<
nl
;
pRef_
=
dict
.
lookupOrDefault
<
scalar
>
(
"pRef"
,
0
);
if
(
mode_
&
COEFF
)
...
...
@@ -330,6 +338,8 @@ bool Foam::functionObjects::pressure::read(const dictionary& dict)
resultName_
=
dict
.
lookupOrDefault
<
word
>
(
"result"
,
resultName
());
Info
<<
endl
;
return
true
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment