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
1513a049
Commit
1513a049
authored
7 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
BUG: swirl: decide based on global properties. Fixes
#824
.
parent
56231b5b
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/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C
+43
-38
43 additions, 38 deletions
...etVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C
with
43 additions
and
38 deletions
src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C
+
43
−
38
View file @
1513a049
...
@@ -75,7 +75,7 @@ swirlFlowRateInletVelocityFvPatchVectorField
...
@@ -75,7 +75,7 @@ swirlFlowRateInletVelocityFvPatchVectorField
dict
.
lookupOrDefault
dict
.
lookupOrDefault
(
(
"axis"
,
"axis"
,
patch
().
size
()
returnReduce
(
patch
().
size
()
,
maxOp
<
label
>
())
?
-
gSum
(
patch
().
Sf
())
/
gSum
(
patch
().
magSf
())
?
-
gSum
(
patch
().
Sf
())
/
gSum
(
patch
().
magSf
())
:
Zero
:
Zero
)
)
...
@@ -145,48 +145,53 @@ void Foam::swirlFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
...
@@ -145,48 +145,53 @@ void Foam::swirlFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
{
{
return
;
return
;
}
}
const
scalar
t
=
this
->
db
().
time
().
timeOutputValue
();
const
scalar
flowRate
=
flowRate_
->
value
(
t
);
const
scalar
rpm
=
rpm_
->
value
(
t
);
const
scalar
totArea
=
gSum
(
patch
().
magSf
());
const
scalar
totArea
=
gSum
(
patch
().
magSf
());
const
scalar
avgU
=
-
flowRate
/
totArea
;
const
vector
axisHat
=
axis_
/
mag
(
axis_
);
// Update angular velocity - convert [rpm] to [rad/s]
if
(
totArea
>
ROOTVSMALL
&&
axis_
!=
vector
(
Zero
))
tmp
<
vectorField
>
tangentialVelocity
{
(
const
scalar
t
=
this
->
db
().
time
().
timeOutputValue
();
axisHat
^
(
rpm
*
constant
::
mathematical
::
pi
/
30
.
0
)
*
(
patch
().
Cf
()
-
origin_
)
const
scalar
flowRate
=
flowRate_
->
value
(
t
);
);
const
scalar
rpm
=
rpm_
->
value
(
t
);
tmp
<
vectorField
>
n
=
patch
().
nf
()
;
const
scalar
avgU
=
-
flowRate
/
totArea
;
const
surfaceScalarField
&
phi
=
const
vector
axisHat
=
axis_
/
mag
(
axis_
);
db
().
lookupObject
<
surfaceScalarField
>
(
phiName_
);
if
(
phi
.
dimensions
()
==
dimVelocity
*
dimArea
)
// Update angular velocity - convert [rpm] to [rad/s]
{
tmp
<
vectorField
>
tangentialVelocity
// volumetric flow-rate
(
operator
==
(
tangentialVelocity
+
n
*
avgU
);
axisHat
}
^
(
rpm
*
constant
::
mathematical
::
pi
/
30
.
0
)
else
if
(
phi
.
dimensions
()
==
dimDensity
*
dimVelocity
*
dimArea
)
*
(
patch
().
Cf
()
-
origin_
)
{
);
const
fvPatchField
<
scalar
>&
rhop
=
patch
().
lookupPatchField
<
volScalarField
,
scalar
>
(
rhoName_
);
tmp
<
vectorField
>
n
=
patch
().
nf
();
// mass flow-rate
const
surfaceScalarField
&
phi
=
operator
==
(
tangentialVelocity
+
n
*
avgU
/
rhop
);
db
().
lookupObject
<
surfaceScalarField
>
(
phiName_
);
}
else
if
(
phi
.
dimensions
()
==
dimVelocity
*
dimArea
)
{
{
FatalErrorInFunction
// volumetric flow-rate
<<
"dimensions of "
<<
phiName_
<<
" are incorrect"
<<
nl
operator
==
(
tangentialVelocity
+
n
*
avgU
);
<<
" on patch "
<<
this
->
patch
().
name
()
}
<<
" of field "
<<
this
->
internalField
().
name
()
else
if
(
phi
.
dimensions
()
==
dimDensity
*
dimVelocity
*
dimArea
)
<<
" in file "
<<
this
->
internalField
().
objectPath
()
{
<<
nl
<<
exit
(
FatalError
);
const
fvPatchField
<
scalar
>&
rhop
=
patch
().
lookupPatchField
<
volScalarField
,
scalar
>
(
rhoName_
);
// mass flow-rate
operator
==
(
tangentialVelocity
+
n
*
avgU
/
rhop
);
}
else
{
FatalErrorInFunction
<<
"dimensions of "
<<
phiName_
<<
" are incorrect"
<<
nl
<<
" on patch "
<<
this
->
patch
().
name
()
<<
" of field "
<<
this
->
internalField
().
name
()
<<
" in file "
<<
this
->
internalField
().
objectPath
()
<<
nl
<<
exit
(
FatalError
);
}
}
}
fixedValueFvPatchField
<
vector
>::
updateCoeffs
();
fixedValueFvPatchField
<
vector
>::
updateCoeffs
();
...
...
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