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
Commits
58471a33
Commit
58471a33
authored
Feb 20, 2019
by
Andrew Heather
Browse files
ENH: Forces function object - more feedback at run-time for user field selections
parent
17260280
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/functionObjects/forces/forces/forces.C
View file @
58471a33
...
...
@@ -722,11 +722,11 @@ Foam::functionObjects::forces::forces
forceBinFilePtr_
(),
momentBinFilePtr_
(),
patchSet_
(),
pName_
(
word
::
null
),
UName_
(
word
::
null
),
rhoName_
(
word
::
null
),
pName_
(
"p"
),
UName_
(
"U"
),
rhoName_
(
"rho"
),
directForceDensity_
(
false
),
fDName_
(
""
),
fDName_
(
"
fD
"
),
rhoRef_
(
VGREAT
),
pRef_
(
0
),
coordSys_
(),
...
...
@@ -767,11 +767,11 @@ Foam::functionObjects::forces::forces
forceBinFilePtr_
(),
momentBinFilePtr_
(),
patchSet_
(),
pName_
(
word
::
null
),
UName_
(
word
::
null
),
rhoName_
(
word
::
null
),
pName_
(
"p"
),
UName_
(
"U"
),
rhoName_
(
"rho"
),
directForceDensity_
(
false
),
fDName_
(
""
),
fDName_
(
"
fD
"
),
rhoRef_
(
VGREAT
),
pRef_
(
0
),
coordSys_
(),
...
...
@@ -826,14 +826,26 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
if
(
directForceDensity_
)
{
// Optional entry for fDName
fDName_
=
dict
.
lookupOrDefault
<
word
>
(
"fD"
,
"fD"
);
if
(
dict
.
readIfPresent
<
word
>
(
"fD"
,
fDName_
))
{
Info
<<
" fD: "
<<
fDName_
<<
endl
;
}
}
else
{
// Optional entries U and p
pName_
=
dict
.
lookupOrDefault
<
word
>
(
"p"
,
"p"
);
UName_
=
dict
.
lookupOrDefault
<
word
>
(
"U"
,
"U"
);
rhoName_
=
dict
.
lookupOrDefault
<
word
>
(
"rho"
,
"rho"
);
// Optional field name entries
if
(
dict
.
readIfPresent
<
word
>
(
"p"
,
pName_
))
{
Info
<<
" p: "
<<
pName_
<<
endl
;
}
if
(
dict
.
readIfPresent
<
word
>
(
"U"
,
UName_
))
{
Info
<<
" U: "
<<
UName_
<<
endl
;
}
if
(
dict
.
readIfPresent
<
word
>
(
"rho"
,
rhoName_
))
{
Info
<<
" rho: "
<<
rhoName_
<<
endl
;
}
// Reference density needed for incompressible calculations
if
(
rhoName_
==
"rhoInf"
)
...
...
@@ -843,11 +855,12 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
}
// Reference pressure, 0 by default
pRef_
=
dict
.
lookupOrDefault
<
scalar
>
(
"pRef"
,
0
);
Info
<<
" Reference pressure (pRef) set to "
<<
pRef_
<<
endl
;
if
(
dict
.
readIfPresent
<
scalar
>
(
"pRef"
,
pRef_
))
{
Info
<<
" Reference pressure (pRef) set to "
<<
pRef_
<<
endl
;
}
}
dict
.
readIfPresent
(
"porosity"
,
porosity_
);
if
(
porosity_
)
{
...
...
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