Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
14f5239e
Commit
14f5239e
authored
Jul 27, 2016
by
sergio
Browse files
ENH: Adding optional uniform jump switch to fan BC
parent
2d695acf
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C
View file @
14f5239e
...
...
@@ -48,7 +48,8 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
:
uniformJumpFvPatchField
<
Type
>
(
p
,
iF
),
phiName_
(
"phi"
),
rhoName_
(
"rho"
)
rhoName_
(
"rho"
),
uniformJump_
(
false
)
{}
...
...
@@ -62,7 +63,8 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
:
uniformJumpFvPatchField
<
Type
>
(
p
,
iF
,
dict
),
phiName_
(
dict
.
lookupOrDefault
<
word
>
(
"phi"
,
"phi"
)),
rhoName_
(
dict
.
lookupOrDefault
<
word
>
(
"rho"
,
"rho"
))
rhoName_
(
dict
.
lookupOrDefault
<
word
>
(
"rho"
,
"rho"
)),
uniformJump_
(
dict
.
lookupOrDefault
<
bool
>
(
"uniformJump"
,
"false"
))
{}
...
...
@@ -77,7 +79,8 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
:
uniformJumpFvPatchField
<
Type
>
(
ptf
,
p
,
iF
,
mapper
),
phiName_
(
ptf
.
phiName_
),
rhoName_
(
ptf
.
rhoName_
)
rhoName_
(
ptf
.
rhoName_
),
uniformJump_
(
ptf
.
uniformJump_
)
{}
...
...
@@ -89,7 +92,8 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
:
uniformJumpFvPatchField
<
Type
>
(
ptf
),
phiName_
(
ptf
.
phiName_
),
rhoName_
(
ptf
.
rhoName_
)
rhoName_
(
ptf
.
rhoName_
),
uniformJump_
(
ptf
.
uniformJump_
)
{}
...
...
@@ -102,7 +106,8 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
:
uniformJumpFvPatchField
<
Type
>
(
ptf
,
iF
),
phiName_
(
ptf
.
phiName_
),
rhoName_
(
ptf
.
rhoName_
)
rhoName_
(
ptf
.
rhoName_
),
uniformJump_
(
ptf
.
uniformJump_
)
{}
...
...
@@ -129,6 +134,10 @@ void Foam::fanFvPatchField<Type>::write(Ostream& os) const
uniformJumpFvPatchField
<
Type
>::
write
(
os
);
this
->
template
writeEntryIfDifferent
<
word
>
(
os
,
"phi"
,
"phi"
,
phiName_
);
this
->
template
writeEntryIfDifferent
<
word
>
(
os
,
"rho"
,
"rho"
,
rhoName_
);
this
->
template
writeEntryIfDifferent
<
bool
>
(
os
,
"uniformJump"
,
false
,
uniformJump_
);
}
...
...
src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H
View file @
14f5239e
...
...
@@ -42,6 +42,8 @@ Description
jumpTable | jump data, e.g. \c csvFile | yes |
phi | flux field name | no | phi
rho | density field name | no | none
uniformJump | applies a uniform pressure based on the averaged
velocity | no | false
\endtable
Example of the boundary condition specification:
...
...
@@ -109,6 +111,9 @@ class fanFvPatchField
// if neccessary
word
rhoName_
;
//- Uniform pressure drop
bool
uniformJump_
;
// Private Member Functions
...
...
src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C
View file @
14f5239e
...
...
@@ -44,6 +44,10 @@ void Foam::fanFvPatchField<Foam::scalar>::calcFanJump()
patch
().
patchField
<
surfaceScalarField
,
scalar
>
(
phi
);
scalarField
Un
(
max
(
phip
/
patch
().
magSf
(),
scalar
(
0
)));
if
(
uniformJump_
)
{
Un
=
gAverage
(
Un
);
}
if
(
phi
.
dimensions
()
==
dimDensity
*
dimVelocity
*
dimArea
)
{
...
...
@@ -67,7 +71,8 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField
:
uniformJumpFvPatchField
<
scalar
>
(
p
,
iF
),
phiName_
(
dict
.
lookupOrDefault
<
word
>
(
"phi"
,
"phi"
)),
rhoName_
(
dict
.
lookupOrDefault
<
word
>
(
"rho"
,
"rho"
))
rhoName_
(
dict
.
lookupOrDefault
<
word
>
(
"rho"
,
"rho"
)),
uniformJump_
(
dict
.
lookupOrDefault
<
bool
>
(
"uniformJump"
,
false
))
{
if
(
this
->
cyclicPatch
().
owner
())
{
...
...
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