Skip to content
GitLab
Menu
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
4455ed2c
Commit
4455ed2c
authored
Aug 07, 2008
by
henry
Browse files
Added the creation and writing of cell-centred Co.
parent
731d257f
Changes
1
Hide whitespace changes
Inline
Side-by-side
applications/utilities/postProcessing/velocityField/Co/Co.C
View file @
4455ed2c
...
@@ -38,6 +38,52 @@ Description
...
@@ -38,6 +38,52 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
tmp
<
volScalarField
>
Co
(
const
surfaceScalarField
&
Cof
)
{
const
fvMesh
&
mesh
=
Cof
.
mesh
();
tmp
<
volScalarField
>
tCo
(
new
volScalarField
(
IOobject
(
"Co"
,
mesh
.
time
().
timeName
(),
mesh
),
mesh
,
dimensionedScalar
(
"0"
,
Cof
.
dimensions
(),
0
)
)
);
volScalarField
&
Co
=
tCo
();
// Set local references to mesh data
const
unallocLabelList
&
owner
=
mesh
.
owner
();
const
unallocLabelList
&
neighbour
=
mesh
.
neighbour
();
forAll
(
owner
,
facei
)
{
label
own
=
owner
[
facei
];
label
nei
=
neighbour
[
facei
];
Co
[
own
]
=
max
(
Co
[
own
],
Cof
[
facei
]);
Co
[
nei
]
=
max
(
Co
[
nei
],
Cof
[
facei
]);
}
forAll
(
Co
.
boundaryField
(),
patchi
)
{
Co
.
boundaryField
()[
patchi
]
=
Cof
.
boundaryField
()[
patchi
];
}
return
tCo
;
}
}
void
Foam
::
calc
(
const
argList
&
args
,
const
Time
&
runTime
,
const
fvMesh
&
mesh
)
void
Foam
::
calc
(
const
argList
&
args
,
const
Time
&
runTime
,
const
fvMesh
&
mesh
)
{
{
bool
writeResults
=
!
args
.
options
().
found
(
"noWrite"
);
bool
writeResults
=
!
args
.
options
().
found
(
"noWrite"
);
...
@@ -79,7 +125,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
...
@@ -79,7 +125,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
(
(
IOobject
IOobject
(
(
"Co"
,
"Co
f
"
,
runTime
.
timeName
(),
runTime
.
timeName
(),
mesh
,
mesh
,
IOobject
::
NO_READ
IOobject
::
NO_READ
...
@@ -101,7 +147,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
...
@@ -101,7 +147,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
(
(
IOobject
IOobject
(
(
"Co"
,
"Co
f
"
,
runTime
.
timeName
(),
runTime
.
timeName
(),
mesh
,
mesh
,
IOobject
::
NO_READ
IOobject
::
NO_READ
...
@@ -126,6 +172,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
...
@@ -126,6 +172,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
if
(
writeResults
)
if
(
writeResults
)
{
{
CoPtr
().
write
();
CoPtr
().
write
();
Co
(
CoPtr
())().
write
();
}
}
}
}
else
else
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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