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
5ec46af7
Commit
5ec46af7
authored
Jan 22, 2013
by
andy
Browse files
ENH: Solver updates for fvOptions usage
parent
65624412
Changes
10
Hide whitespace changes
Inline
Side-by-side
applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/UEqn.H
View file @
5ec46af7
...
@@ -4,12 +4,12 @@
...
@@ -4,12 +4,12 @@
(
(
fvm
::
div
(
phi
,
U
)
fvm
::
div
(
phi
,
U
)
+
turbulence
->
divDevRhoReff
(
U
)
+
turbulence
->
divDevRhoReff
(
U
)
==
fvOptions
(
rho
,
U
)
);
);
UEqn
().
relax
();
UEqn
().
relax
();
mrfZones
.
addCoriolis
(
rho
,
UEqn
());
// Include the porous media resistance and solve the momentum equation
// Include the porous media resistance and solve the momentum equation
// either implicit in the tensorial resistance or transport using by
// either implicit in the tensorial resistance or transport using by
// including the spherical part of the resistance in the momentum diagonal
// including the spherical part of the resistance in the momentum diagonal
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
for
(
int
UCorr
=
0
;
UCorr
<
nUCorr
;
UCorr
++
)
for
(
int
UCorr
=
0
;
UCorr
<
nUCorr
;
UCorr
++
)
{
{
U
=
trTU
()
&
(
(
UEqn
()
==
fvOptions
(
rho
,
U
))()
.
H
()
-
gradp
);
U
=
trTU
()
&
(
UEqn
().
H
()
-
gradp
);
}
}
U
.
correctBoundaryConditions
();
U
.
correctBoundaryConditions
();
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
fvOptions
.
constrain
(
UEqn
());
fvOptions
.
constrain
(
UEqn
());
solve
(
UEqn
()
==
-
fvc
::
grad
(
p
)
+
fvOptions
(
rho
,
U
)
);
solve
(
UEqn
()
==
-
fvc
::
grad
(
p
));
fvOptions
.
correct
(
U
);
fvOptions
.
correct
(
U
);
...
...
applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/createZones.H
View file @
5ec46af7
IOMRFZoneList
mrfZones
(
mesh
);
mrfZones
.
correctBoundaryVelocity
(
U
);
IOporosityModelList
pZones
(
mesh
);
IOporosityModelList
pZones
(
mesh
);
Switch
pressureImplicitPorosity
(
false
);
Switch
pressureImplicitPorosity
(
false
);
...
...
applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/pEqn.H
View file @
5ec46af7
...
@@ -10,11 +10,11 @@
...
@@ -10,11 +10,11 @@
if
(
pressureImplicitPorosity
)
if
(
pressureImplicitPorosity
)
{
{
HbyA
=
trTU
()
&
(
UEqn
()
==
fvOptions
(
rho
,
U
))()
.
H
();
HbyA
=
trTU
()
&
UEqn
().
H
();
}
}
else
else
{
{
HbyA
=
trAU
()
*
(
UEqn
()
==
fvOptions
(
rho
,
U
))()
.
H
();
HbyA
=
trAU
()
*
UEqn
().
H
();
}
}
UEqn
.
clear
();
UEqn
.
clear
();
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
fvc
::
interpolate
(
rho
*
HbyA
)
&
mesh
.
Sf
()
fvc
::
interpolate
(
rho
*
HbyA
)
&
mesh
.
Sf
()
);
);
mrfZ
on
e
s
.
relativeFlux
(
fvc
::
interpolate
(
rho
),
phiHbyA
);
fvOpti
ons
.
relativeFlux
(
fvc
::
interpolate
(
rho
),
phiHbyA
);
closedVolume
=
adjustPhi
(
phiHbyA
,
U
,
p
);
closedVolume
=
adjustPhi
(
phiHbyA
,
U
,
p
);
...
...
applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C
View file @
5ec46af7
...
@@ -27,14 +27,13 @@ Application
...
@@ -27,14 +27,13 @@ Application
Description
Description
Steady-state solver for turbulent flow of compressible fluids with
Steady-state solver for turbulent flow of compressible fluids with
RANS turbulence modelling, implicit or explicit porosity treatment
RANS turbulence modelling, implicit or explicit porosity treatment
and
MRF for HVAC and similar application
s.
and
run-time selectable finite volume source
s.
\*---------------------------------------------------------------------------*/
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "fvCFD.H"
#include "rhoThermo.H"
#include "rhoThermo.H"
#include "RASModel.H"
#include "RASModel.H"
#include "IOMRFZoneList.H"
#include "fvIOoptionList.H"
#include "fvIOoptionList.H"
#include "IOporosityModelList.H"
#include "IOporosityModelList.H"
#include "simpleControl.H"
#include "simpleControl.H"
...
...
applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/pEqn.H
View file @
5ec46af7
...
@@ -7,7 +7,7 @@ volScalarField rAU(1.0/UEqn().A());
...
@@ -7,7 +7,7 @@ volScalarField rAU(1.0/UEqn().A());
volScalarField
rAtU
(
1
.
0
/
(
1
.
0
/
rAU
-
UEqn
().
H1
()));
volScalarField
rAtU
(
1
.
0
/
(
1
.
0
/
rAU
-
UEqn
().
H1
()));
volVectorField
HbyA
(
"HbyA"
,
U
);
volVectorField
HbyA
(
"HbyA"
,
U
);
HbyA
=
rAU
*
(
UEqn
()
==
fvOptions
(
rho
,
U
))()
.
H
();
HbyA
=
rAU
*
UEqn
().
H
();
UEqn
.
clear
();
UEqn
.
clear
();
...
...
applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/UrelEqn.H
View file @
5ec46af7
...
@@ -5,12 +5,14 @@
...
@@ -5,12 +5,14 @@
+
fvm
::
div
(
phi
,
Urel
)
+
fvm
::
div
(
phi
,
Urel
)
+
turbulence
->
divDevReff
(
Urel
)
+
turbulence
->
divDevReff
(
Urel
)
+
SRF
->
Su
()
+
SRF
->
Su
()
==
fvOptions
(
Urel
)
);
);
UrelEqn
().
relax
();
UrelEqn
().
relax
();
fvOptions
.
constrain
(
UrelEqn
());
fvOptions
.
constrain
(
UrelEqn
());
solve
(
UrelEqn
()
==
-
fvc
::
grad
(
p
)
+
fvOptions
(
Urel
)
);
solve
(
UrelEqn
()
==
-
fvc
::
grad
(
p
));
fvOptions
.
correct
(
Urel
);
fvOptions
.
correct
(
Urel
);
applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H
View file @
5ec46af7
volScalarField
rAUrel
(
1
.
0
/
UrelEqn
().
A
());
volScalarField
rAUrel
(
1
.
0
/
UrelEqn
().
A
());
volVectorField
HbyA
(
"HbyA"
,
Urel
);
volVectorField
HbyA
(
"HbyA"
,
Urel
);
HbyA
=
rAUrel
*
(
UrelEqn
()
==
fvOptions
(
Urel
))()
.
H
();
HbyA
=
rAUrel
*
UrelEqn
().
H
();
if
(
pimple
.
nCorrPISO
()
<=
1
)
if
(
pimple
.
nCorrPISO
()
<=
1
)
{
{
...
...
applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H
View file @
5ec46af7
volVectorField
HbyA
(
"HbyA"
,
U
);
volVectorField
HbyA
(
"HbyA"
,
U
);
HbyA
=
rAU
*
(
UEqn
()
==
fvOptions
(
U
))()
.
H
();
HbyA
=
rAU
*
UEqn
().
H
();
if
(
pimple
.
nCorrPISO
()
<=
1
)
if
(
pimple
.
nCorrPISO
()
<=
1
)
{
{
...
...
applications/solvers/incompressible/potentialFreeSurfaceFoam/UEqn.H
View file @
5ec46af7
...
@@ -3,6 +3,8 @@ tmp<fvVectorMatrix> UEqn
...
@@ -3,6 +3,8 @@ tmp<fvVectorMatrix> UEqn
fvm
::
ddt
(
U
)
fvm
::
ddt
(
U
)
+
fvm
::
div
(
phi
,
U
)
+
fvm
::
div
(
phi
,
U
)
+
turbulence
->
divDevReff
(
U
)
+
turbulence
->
divDevReff
(
U
)
==
fvOptions
(
U
)
);
);
...
@@ -12,7 +14,7 @@ fvOptions.constrain(UEqn());
...
@@ -12,7 +14,7 @@ fvOptions.constrain(UEqn());
if
(
pimple
.
momentumPredictor
())
if
(
pimple
.
momentumPredictor
())
{
{
solve
(
UEqn
()
==
-
fvc
::
grad
(
p_gh
)
+
fvOptions
(
U
)
);
solve
(
UEqn
()
==
-
fvc
::
grad
(
p_gh
));
fvOptions
.
correct
(
U
);
fvOptions
.
correct
(
U
);
}
}
applications/solvers/incompressible/potentialFreeSurfaceFoam/pEqn.H
View file @
5ec46af7
...
@@ -2,7 +2,7 @@ volScalarField rAU(1.0/UEqn().A());
...
@@ -2,7 +2,7 @@ volScalarField rAU(1.0/UEqn().A());
surfaceScalarField
rAUf
(
"Dp"
,
fvc
::
interpolate
(
rAU
));
surfaceScalarField
rAUf
(
"Dp"
,
fvc
::
interpolate
(
rAU
));
volVectorField
HbyA
(
"HbyA"
,
U
);
volVectorField
HbyA
(
"HbyA"
,
U
);
HbyA
=
rAU
*
(
UEqn
()
==
fvOptions
(
U
))()
.
H
();
HbyA
=
rAU
*
UEqn
().
H
();
if
(
pimple
.
nCorrPISO
()
<=
1
)
if
(
pimple
.
nCorrPISO
()
<=
1
)
{
{
...
@@ -18,6 +18,7 @@ surfaceScalarField phiHbyA
...
@@ -18,6 +18,7 @@ surfaceScalarField phiHbyA
adjustPhi
(
phiHbyA
,
U
,
p_gh
);
adjustPhi
(
phiHbyA
,
U
,
p_gh
);
fvOptions
.
relativeFlux
(
phiHbyA
);
// Non-orthogonal pressure corrector loop
// Non-orthogonal pressure corrector loop
while
(
pimple
.
correctNonOrthogonal
())
while
(
pimple
.
correctNonOrthogonal
())
...
...
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