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
60d7a71e
Commit
60d7a71e
authored
8 years ago
by
Andrew Heather
Browse files
Options
Downloads
Patches
Plain Diff
STYLE: forceCoeffs - minor code updates
parent
aa78b030
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/functionObjects/forces/forceCoeffs/forceCoeffs.C
+20
-18
20 additions, 18 deletions
src/functionObjects/forces/forceCoeffs/forceCoeffs.C
with
20 additions
and
18 deletions
src/functionObjects/forces/forceCoeffs/forceCoeffs.C
+
20
−
18
View file @
60d7a71e
...
@@ -156,25 +156,27 @@ void Foam::functionObjects::forceCoeffs::writeIntegratedData
...
@@ -156,25 +156,27 @@ void Foam::functionObjects::forceCoeffs::writeIntegratedData
const
List
<
Field
<
scalar
>>&
coeff
const
List
<
Field
<
scalar
>>&
coeff
)
const
)
const
{
{
if
(
!
log
)
{
return
;
}
scalar
pressure
=
sum
(
coeff
[
0
]);
scalar
pressure
=
sum
(
coeff
[
0
]);
scalar
viscous
=
sum
(
coeff
[
1
]);
scalar
viscous
=
sum
(
coeff
[
1
]);
scalar
porous
=
sum
(
coeff
[
2
]);
scalar
porous
=
sum
(
coeff
[
2
]);
scalar
total
=
pressure
+
viscous
+
porous
;
scalar
total
=
pressure
+
viscous
+
porous
;
if
(
log
)
Info
<<
" "
<<
title
<<
" : "
<<
total
<<
token
::
TAB
{
<<
"("
Info
<<
" "
<<
title
<<
" : "
<<
total
<<
token
::
TAB
<<
"pressure: "
<<
pressure
<<
token
::
TAB
<<
"("
<<
"viscous: "
<<
viscous
;
<<
"pressure: "
<<
pressure
<<
token
::
TAB
<<
"viscous: "
<<
viscous
;
if
(
porosity_
)
{
Info
<<
token
::
TAB
<<
"porous: "
<<
porous
;
}
Info
<<
")"
<<
endl
;
if
(
porosity_
)
{
Info
<<
token
::
TAB
<<
"porous: "
<<
porous
;
}
}
Info
<<
")"
<<
endl
;
}
}
...
@@ -388,21 +390,21 @@ bool Foam::functionObjects::forceCoeffs::execute()
...
@@ -388,21 +390,21 @@ bool Foam::functionObjects::forceCoeffs::execute()
if
(
writeFields_
)
if
(
writeFields_
)
{
{
const
volVectorField
&
force
=
const
volVectorField
&
force
=
obr_
.
lookupObject
<
volVectorField
>
(
fieldName
(
"force"
));
lookupObject
<
volVectorField
>
(
fieldName
(
"force"
));
const
volVectorField
&
moment
=
const
volVectorField
&
moment
=
obr_
.
lookupObject
<
volVectorField
>
(
fieldName
(
"moment"
));
lookupObject
<
volVectorField
>
(
fieldName
(
"moment"
));
volVectorField
&
forceCoeff
=
volVectorField
&
forceCoeff
=
const_cast
<
volVectorField
&>
const_cast
<
volVectorField
&>
(
(
obr_
.
lookupObject
<
volVectorField
>
(
fieldName
(
"forceCoeff"
))
lookupObject
<
volVectorField
>
(
fieldName
(
"forceCoeff"
))
);
);
volVectorField
&
momentCoeff
=
volVectorField
&
momentCoeff
=
const_cast
<
volVectorField
&>
const_cast
<
volVectorField
&>
(
(
obr_
.
lookupObject
<
volVectorField
>
(
fieldName
(
"momentCoeff"
))
lookupObject
<
volVectorField
>
(
fieldName
(
"momentCoeff"
))
);
);
dimensionedScalar
f0
(
"f0"
,
dimForce
,
Aref_
*
pDyn
);
dimensionedScalar
f0
(
"f0"
,
dimForce
,
Aref_
*
pDyn
);
...
@@ -421,10 +423,10 @@ bool Foam::functionObjects::forceCoeffs::write()
...
@@ -421,10 +423,10 @@ bool Foam::functionObjects::forceCoeffs::write()
if
(
writeFields_
)
if
(
writeFields_
)
{
{
const
volVectorField
&
forceCoeff
=
const
volVectorField
&
forceCoeff
=
obr_
.
lookupObject
<
volVectorField
>
(
fieldName
(
"forceCoeff"
));
lookupObject
<
volVectorField
>
(
fieldName
(
"forceCoeff"
));
const
volVectorField
&
momentCoeff
=
const
volVectorField
&
momentCoeff
=
obr_
.
lookupObject
<
volVectorField
>
(
fieldName
(
"momentCoeff"
));
lookupObject
<
volVectorField
>
(
fieldName
(
"momentCoeff"
));
forceCoeff
.
write
();
forceCoeff
.
write
();
momentCoeff
.
write
();
momentCoeff
.
write
();
...
...
This diff is collapsed.
Click to expand it.
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