Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenFOAM-plus
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
339
Issues
339
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Development
OpenFOAM-plus
Commits
39aa3dc1
Commit
39aa3dc1
authored
Jan 31, 2019
by
mattijs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: checkMesh: write correct faceWeights. Fixes
#1099
.
parent
97f273b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
18 deletions
+64
-18
applications/utilities/mesh/manipulation/checkMesh/writeFields.C
...tions/utilities/mesh/manipulation/checkMesh/writeFields.C
+64
-18
No files found.
applications/utilities/mesh/manipulation/checkMesh/writeFields.C
View file @
39aa3dc1
#include "writeFields.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "polyMeshTools.H"
#include "zeroGradientFvPatchFields.H"
#include "syncTools.H"
...
...
@@ -68,6 +69,52 @@ void minFaceToCell
}
void
minFaceToCell
(
const
surfaceScalarField
&
faceData
,
volScalarField
&
cellData
,
const
bool
correctBoundaryConditions
)
{
scalarField
&
cellFld
=
cellData
.
ref
();
cellFld
=
GREAT
;
const
labelUList
&
own
=
cellData
.
mesh
().
owner
();
const
labelUList
&
nei
=
cellData
.
mesh
().
neighbour
();
// Internal faces
forAll
(
own
,
facei
)
{
cellFld
[
own
[
facei
]]
=
min
(
cellFld
[
own
[
facei
]],
faceData
[
facei
]);
cellFld
[
nei
[
facei
]]
=
min
(
cellFld
[
nei
[
facei
]],
faceData
[
facei
]);
}
// Patch faces
forAll
(
faceData
.
boundaryField
(),
patchi
)
{
const
fvsPatchScalarField
&
fvp
=
faceData
.
boundaryField
()[
patchi
];
const
labelUList
&
fc
=
fvp
.
patch
().
faceCells
();
forAll
(
fc
,
i
)
{
cellFld
[
fc
[
i
]]
=
min
(
cellFld
[
fc
[
i
]],
fvp
[
i
]);
}
}
volScalarField
::
Boundary
&
bfld
=
cellData
.
boundaryFieldRef
();
forAll
(
bfld
,
patchi
)
{
bfld
[
patchi
]
=
faceData
.
boundaryField
()[
patchi
];
}
if
(
correctBoundaryConditions
)
{
cellData
.
correctBoundaryConditions
();
}
}
void
Foam
::
writeFields
(
const
fvMesh
&
mesh
,
...
...
@@ -112,7 +159,8 @@ void Foam::writeFields
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
IOobject
::
AUTO_WRITE
,
false
),
mesh
,
dimensionedScalar
(
dimless
,
Zero
),
...
...
@@ -127,17 +175,6 @@ void Foam::writeFields
if
(
selectedFields
.
found
(
"faceWeight"
))
{
const
scalarField
faceWeights
(
polyMeshTools
::
faceWeights
(
mesh
,
mesh
.
faceCentres
(),
mesh
.
faceAreas
(),
mesh
.
cellCentres
()
)
);
volScalarField
cellWeights
(
IOobject
...
...
@@ -146,14 +183,20 @@ void Foam::writeFields
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
IOobject
::
AUTO_WRITE
,
false
),
mesh
,
dimensionedScalar
(
dimless
,
Zero
),
calculatedFvPatchScalarField
::
typeName
wordList
// wanted bc types
(
mesh
.
boundary
().
size
(),
calculatedFvPatchScalarField
::
typeName
),
mesh
.
weights
().
boundaryField
().
types
()
// current bc types
);
//- Take min
minFaceToCell
(
faceWeights
,
cellWeights
);
minFaceToCell
(
mesh
.
weights
(),
cellWeights
,
false
);
Info
<<
" Writing face interpolation weights (0..0.5) to "
<<
cellWeights
.
name
()
<<
endl
;
cellWeights
.
write
();
...
...
@@ -187,7 +230,8 @@ void Foam::writeFields
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
IOobject
::
AUTO_WRITE
,
false
),
mesh
,
dimensionedScalar
(
dimless
,
Zero
),
...
...
@@ -346,7 +390,8 @@ void Foam::writeFields
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
IOobject
::
AUTO_WRITE
,
false
),
mesh
,
dimensionedScalar
(
dimless
,
Zero
),
...
...
@@ -435,7 +480,8 @@ void Foam::writeFields
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
AUTO_WRITE
IOobject
::
AUTO_WRITE
,
false
),
mesh
,
dimensionedScalar
(
dimless
,
Zero
),
...
...
Write
Preview
Markdown
is supported
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