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
5981540f
Commit
5981540f
authored
12 years ago
by
andy
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Updated MRFZone constructor
parent
a192c366
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/finiteVolume/cfdTools/general/MRF/MRFZone.C
+56
-13
56 additions, 13 deletions
src/finiteVolume/cfdTools/general/MRF/MRFZone.C
src/finiteVolume/cfdTools/general/MRF/MRFZone.H
+16
-3
16 additions, 3 deletions
src/finiteVolume/cfdTools/general/MRF/MRFZone.H
with
72 additions
and
16 deletions
src/finiteVolume/cfdTools/general/MRF/MRFZone.C
+
56
−
13
View file @
5981540f
...
...
@@ -230,15 +230,16 @@ Foam::MRFZone::MRFZone
(
const
word
&
name
,
const
fvMesh
&
mesh
,
const
dictionary
&
dict
const
dictionary
&
dict
,
const
word
&
cellZoneName
)
:
mesh_
(
mesh
),
name_
(
name
),
coeffs_
(
dict
),
active_
(
readBool
(
coeffs_
.
lookup
(
"active"
))),
cellZoneName_
(
coeffs_
.
lookup
(
"
cellZone
"
)
),
cellZoneID_
(
mesh_
.
cellZones
().
findZoneID
(
cellZoneName_
)
),
cellZoneName_
(
cellZone
Name
),
cellZoneID_
(),
excludedPatchNames_
(
coeffs_
.
lookupOrDefault
(
"nonRotatingPatches"
,
wordList
(
0
))
...
...
@@ -253,6 +254,13 @@ Foam::MRFZone::MRFZone
}
else
{
if
(
cellZoneName
==
word
::
null
)
{
coeffs_
.
lookup
(
"cellZone"
)
>>
cellZoneName_
;
}
cellZoneID_
=
mesh_
.
cellZones
().
findZoneID
(
cellZoneName_
);
const
polyBoundaryMesh
&
patches
=
mesh_
.
boundaryMesh
();
axis_
=
axis_
/
mag
(
axis_
);
...
...
@@ -268,7 +276,13 @@ Foam::MRFZone::MRFZone
{
FatalErrorIn
(
"MRFZone(const word&, const fvMesh&, const dictionary&)"
"MRFZone"
"("
"const word&, "
"const fvMesh&, "
"const dictionary&, "
"const word&"
")"
)
<<
"cannot find MRF patch "
<<
excludedPatchNames_
[
i
]
<<
exit
(
FatalError
);
...
...
@@ -283,7 +297,13 @@ Foam::MRFZone::MRFZone
{
FatalErrorIn
(
"MRFZone(const word&, const fvMesh&, const dictionary&)"
"MRFZone"
"("
"const word&, "
"const fvMesh&, "
"const dictionary&, "
"const word&"
")"
)
<<
"cannot find MRF cellZone "
<<
cellZoneName_
<<
exit
(
FatalError
);
...
...
@@ -328,7 +348,7 @@ void Foam::MRFZone::addCoriolis
}
void
Foam
::
MRFZone
::
addCoriolis
(
fvVectorMatrix
&
UEqn
)
const
void
Foam
::
MRFZone
::
addCoriolis
(
fvVectorMatrix
&
UEqn
,
const
bool
rhs
)
const
{
if
(
cellZoneID_
==
-
1
)
{
...
...
@@ -342,10 +362,21 @@ void Foam::MRFZone::addCoriolis(fvVectorMatrix& UEqn) const
const
vector
Omega
=
this
->
Omega
();
forAll
(
cells
,
i
)
if
(
rhs
)
{
label
celli
=
cells
[
i
];
Usource
[
celli
]
-=
V
[
celli
]
*
(
Omega
^
U
[
celli
]);
forAll
(
cells
,
i
)
{
label
celli
=
cells
[
i
];
Usource
[
celli
]
+=
V
[
celli
]
*
(
Omega
^
U
[
celli
]);
}
}
else
{
forAll
(
cells
,
i
)
{
label
celli
=
cells
[
i
];
Usource
[
celli
]
-=
V
[
celli
]
*
(
Omega
^
U
[
celli
]);
}
}
}
...
...
@@ -353,7 +384,8 @@ void Foam::MRFZone::addCoriolis(fvVectorMatrix& UEqn) const
void
Foam
::
MRFZone
::
addCoriolis
(
const
volScalarField
&
rho
,
fvVectorMatrix
&
UEqn
fvVectorMatrix
&
UEqn
,
const
bool
rhs
)
const
{
if
(
cellZoneID_
==
-
1
)
...
...
@@ -368,10 +400,21 @@ void Foam::MRFZone::addCoriolis
const
vector
Omega
=
this
->
Omega
();
forAll
(
cells
,
i
)
if
(
rhs
)
{
label
celli
=
cells
[
i
];
Usource
[
celli
]
-=
V
[
celli
]
*
rho
[
celli
]
*
(
Omega
^
U
[
celli
]);
forAll
(
cells
,
i
)
{
label
celli
=
cells
[
i
];
Usource
[
celli
]
+=
V
[
celli
]
*
rho
[
celli
]
*
(
Omega
^
U
[
celli
]);
}
}
else
{
forAll
(
cells
,
i
)
{
label
celli
=
cells
[
i
];
Usource
[
celli
]
-=
V
[
celli
]
*
rho
[
celli
]
*
(
Omega
^
U
[
celli
]);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/finiteVolume/cfdTools/general/MRF/MRFZone.H
+
16
−
3
View file @
5981540f
...
...
@@ -144,7 +144,13 @@ public:
// Constructors
//- Construct from fvMesh
MRFZone
(
const
word
&
name
,
const
fvMesh
&
mesh
,
const
dictionary
&
dict
);
MRFZone
(
const
word
&
name
,
const
fvMesh
&
mesh
,
const
dictionary
&
dict
,
const
word
&
cellZoneName
=
word
::
null
);
//- Return clone
autoPtr
<
MRFZone
>
clone
()
const
...
...
@@ -185,13 +191,20 @@ public:
)
const
;
//- Add the Coriolis force contribution to the momentum equation
void
addCoriolis
(
fvVectorMatrix
&
UEqn
)
const
;
// Adds to the lhs of the equation; optionally add to rhs
void
addCoriolis
(
fvVectorMatrix
&
UEqn
,
const
bool
rhs
=
false
)
const
;
//- Add the Coriolis force contribution to the momentum equation
// Adds to the lhs of the equation; optionally add to rhs
void
addCoriolis
(
const
volScalarField
&
rho
,
fvVectorMatrix
&
UEqn
fvVectorMatrix
&
UEqn
,
const
bool
rhs
=
false
)
const
;
//- Make the given absolute velocity relative within the MRF region
...
...
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