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
304af9fc
Commit
304af9fc
authored
Dec 04, 2016
by
Henry Weller
Browse files
reactingTwoPhaseEulerFoam: Added LTS support to the face-momentum algorithm
parent
2b551d87
Changes
16
Hide whitespace changes
Inline
Side-by-side
applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H
View file @
304af9fc
...
...
@@ -29,37 +29,25 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
}
{
tmp
<
fvScalarMatrix
>
E2
e
qn
(
phase2
.
heEqn
());
tmp
<
fvScalarMatrix
>
E2
E
qn
(
phase2
.
heEqn
());
if
(
E2
e
qn
.
valid
())
if
(
E2
E
qn
.
valid
())
{
E2
e
qn
=
E2
E
qn
=
(
E2
e
qn
E2
E
qn
==
*
heatTransfer
[
phase2
.
name
()]
+
alpha2
*
rho2
*
(
U2
&
g
)
+
fvOptions
(
alpha2
,
rho2
,
phase2
.
thermo
().
he
())
);
E2
e
qn
->
relax
();
fvOptions
.
constrain
(
E2
e
qn
.
ref
());
E2
e
qn
->
solve
();
E2
E
qn
->
relax
();
fvOptions
.
constrain
(
E2
E
qn
.
ref
());
E2
E
qn
->
solve
();
}
}
fluid
.
correctThermo
();
fluid
.
correct
();
}
Info
<<
phase1
.
name
()
<<
" min/max T "
<<
min
(
phase1
.
thermo
().
T
()).
value
()
<<
" - "
<<
max
(
phase1
.
thermo
().
T
()).
value
()
<<
endl
;
Info
<<
phase2
.
name
()
<<
" min/max T "
<<
min
(
phase2
.
thermo
().
T
()).
value
()
<<
" - "
<<
max
(
phase2
.
thermo
().
T
()).
value
()
<<
endl
;
applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createRDeltaTf.H
0 → 100644
View file @
304af9fc
tmp
<
surfaceScalarField
>
trDeltaTf
;
if
(
LTS
&&
faceMomentum
)
{
trDeltaTf
=
tmp
<
surfaceScalarField
>
(
new
surfaceScalarField
(
IOobject
(
fv
::
localEulerDdt
::
rDeltaTfName
,
runTime
.
timeName
(),
mesh
,
IOobject
::
READ_IF_PRESENT
,
IOobject
::
AUTO_WRITE
),
mesh
,
dimensionedScalar
(
"one"
,
dimless
/
dimTime
,
1
)
)
);
}
applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/DDtU.H
View file @
304af9fc
ddtPhi1
=
(
(
phi1
-
phi1
.
oldTime
())
/
runTime
.
deltaT
()
);
ddtPhi2
=
(
(
phi2
-
phi2
.
oldTime
())
/
runTime
.
deltaT
()
);
ddtPhi1
=
fvc
::
ddt
(
phi1
);
ddtPhi2
=
fvc
::
ddt
(
phi2
);
applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/createDDtU.H
View file @
304af9fc
surfaceScalarField
ddtPhi1
(
(
phi1
-
phi1
.
oldTime
())
/
runTime
.
deltaT
()
);
surfaceScalarField
ddtPhi2
(
(
phi2
-
phi2
.
oldTime
())
/
runTime
.
deltaT
()
);
surfaceScalarField
ddtPhi1
(
fvc
::
ddt
(
phi1
));
surfaceScalarField
ddtPhi2
(
fvc
::
ddt
(
phi2
));
applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H
View file @
304af9fc
...
...
@@ -27,15 +27,17 @@ surfaceScalarField Kdf("Kdf", fluid.Kdf());
// Virtual-mass coefficient
surfaceScalarField
Vmf
(
"Vmf"
,
fluid
.
Vmf
());
const
surfaceScalarField
&
rDeltaTf
=
fv
::
localEulerDdt
::
localRDeltaTf
(
mesh
);
surfaceScalarField
rAUf1
(
IOobject
::
groupName
(
"rAUf"
,
phase1
.
name
()),
1
.
0
/
(
(
alphaRhof10
+
Vmf
)
/
runTime
.
deltaT
()
rDeltaTf
*
(
alphaRhof10
+
Vmf
)
+
fvc
::
interpolate
(
U1Eqn
.
A
())
+
Kdf
)
)
);
surfaceScalarField
rAUf2
...
...
@@ -43,10 +45,10 @@ surfaceScalarField rAUf2
IOobject
::
groupName
(
"rAUf"
,
phase2
.
name
()),
1
.
0
/
(
(
alphaRhof20
+
Vmf
)
/
runTime
.
deltaT
()
rDeltaTf
*
(
alphaRhof20
+
Vmf
)
+
fvc
::
interpolate
(
U2Eqn
.
A
())
+
Kdf
)
)
);
...
...
@@ -157,7 +159,7 @@ while (pimple.correct())
rAUf1
*
(
(
alphaRhof10
+
Vmf
)
*
MRF
.
absolute
(
phi1
.
oldTime
())
/
runTime
.
deltaT
()
*
rDeltaTf
*
MRF
.
absolute
(
phi1
.
oldTime
())
+
fvc
::
flux
(
U1Eqn
.
H
())
+
Vmf
*
ddtPhi2
+
Kdf
*
MRF
.
absolute
(
phi2
)
...
...
@@ -175,7 +177,7 @@ while (pimple.correct())
rAUf2
*
(
(
alphaRhof20
+
Vmf
)
*
MRF
.
absolute
(
phi2
.
oldTime
())
/
runTime
.
deltaT
()
*
rDeltaTf
*
MRF
.
absolute
(
phi2
.
oldTime
())
+
fvc
::
flux
(
U2Eqn
.
H
())
+
Vmf
*
ddtPhi1
+
Kdf
*
MRF
.
absolute
(
phi1
)
...
...
applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C
View file @
304af9fc
...
...
@@ -73,6 +73,7 @@ int main(int argc, char *argv[])
)
);
#include "createRDeltaTf.H"
#include "pUf/createDDtU.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -91,6 +92,10 @@ int main(int argc, char *argv[])
if
(
LTS
)
{
#include "setRDeltaT.H"
if
(
faceMomentum
)
{
#include "setRDeltaTf.H"
}
}
else
{
...
...
applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/setRDeltaTf.H
0 → 100644
View file @
304af9fc
trDeltaTf
.
ref
()
=
fvc
::
interpolate
(
fv
::
localEulerDdt
::
localRDeltaT
(
mesh
));
src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C
View file @
304af9fc
...
...
@@ -317,6 +317,33 @@ EulerDdtScheme<Type>::fvcDdt
}
template
<
class
Type
>
tmp
<
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>>
EulerDdtScheme
<
Type
>::
fvcDdt
(
const
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>&
sf
)
{
dimensionedScalar
rDeltaT
=
1
.
0
/
mesh
().
time
().
deltaT
();
IOobject
ddtIOobject
(
"ddt("
+
sf
.
name
()
+
')'
,
mesh
().
time
().
timeName
(),
mesh
()
);
return
tmp
<
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>>
(
new
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>
(
ddtIOobject
,
rDeltaT
*
(
sf
-
sf
.
oldTime
())
)
);
}
template
<
class
Type
>
tmp
<
fvMatrix
<
Type
>>
EulerDdtScheme
<
Type
>::
fvmDdt
...
...
src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.H
View file @
304af9fc
...
...
@@ -124,6 +124,11 @@ public:
const
GeometricField
<
Type
,
fvPatchField
,
volMesh
>&
psi
);
tmp
<
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>>
fvcDdt
(
const
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>&
);
tmp
<
fvMatrix
<
Type
>>
fvmDdt
(
const
GeometricField
<
Type
,
fvPatchField
,
volMesh
>&
...
...
src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C
View file @
304af9fc
...
...
@@ -132,6 +132,22 @@ tmp<fvMatrix<Type>> ddtScheme<Type>::fvmDdt
}
template
<
class
Type
>
tmp
<
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>>
ddtScheme
<
Type
>::
fvcDdt
(
const
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>&
sf
)
{
NotImplemented
;
return
tmp
<
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>>
(
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>::
null
()
);
}
template
<
class
Type
>
tmp
<
surfaceScalarField
>
ddtScheme
<
Type
>::
fvcDdtPhiCoeff
(
...
...
src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.H
View file @
304af9fc
...
...
@@ -167,6 +167,11 @@ public:
const
GeometricField
<
Type
,
fvPatchField
,
volMesh
>&
)
=
0
;
virtual
tmp
<
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>>
fvcDdt
(
const
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>&
);
virtual
tmp
<
fvMatrix
<
Type
>>
fvmDdt
(
const
GeometricField
<
Type
,
fvPatchField
,
volMesh
>&
...
...
src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdt.C
View file @
304af9fc
...
...
@@ -29,6 +29,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
Foam
::
word
Foam
::
fv
::
localEulerDdt
::
rDeltaTName
(
"rDeltaT"
);
Foam
::
word
Foam
::
fv
::
localEulerDdt
::
rDeltaTfName
(
"rDeltaTf"
);
Foam
::
word
Foam
::
fv
::
localEulerDdt
::
rSubDeltaTName
(
"rSubDeltaT"
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -53,6 +54,18 @@ const Foam::volScalarField& Foam::fv::localEulerDdt::localRDeltaT
}
const
Foam
::
surfaceScalarField
&
Foam
::
fv
::
localEulerDdt
::
localRDeltaTf
(
const
fvMesh
&
mesh
)
{
return
mesh
.
objectRegistry
::
lookupObject
<
surfaceScalarField
>
(
rDeltaTfName
);
}
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
fv
::
localEulerDdt
::
localRSubDeltaT
(
const
fvMesh
&
mesh
,
...
...
src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C
View file @
304af9fc
...
...
@@ -46,6 +46,13 @@ const volScalarField& localEulerDdtScheme<Type>::localRDeltaT() const
}
template
<
class
Type
>
const
surfaceScalarField
&
localEulerDdtScheme
<
Type
>::
localRDeltaTf
()
const
{
return
localEulerDdt
::
localRDeltaTf
(
mesh
());
}
template
<
class
Type
>
tmp
<
GeometricField
<
Type
,
fvPatchField
,
volMesh
>>
localEulerDdtScheme
<
Type
>::
fvcDdt
...
...
@@ -333,6 +340,33 @@ localEulerDdtScheme<Type>::fvcDdt
}
template
<
class
Type
>
tmp
<
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>>
localEulerDdtScheme
<
Type
>::
fvcDdt
(
const
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>&
sf
)
{
const
surfaceScalarField
&
rDeltaT
=
localRDeltaTf
();
IOobject
ddtIOobject
(
"ddt("
+
sf
.
name
()
+
')'
,
mesh
().
time
().
timeName
(),
mesh
()
);
return
tmp
<
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>>
(
new
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>
(
ddtIOobject
,
rDeltaT
*
(
sf
-
sf
.
oldTime
())
)
);
}
template
<
class
Type
>
tmp
<
fvMatrix
<
Type
>>
localEulerDdtScheme
<
Type
>::
fvmDdt
...
...
src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.H
View file @
304af9fc
...
...
@@ -69,6 +69,9 @@ public:
//- Name of the reciprocal local time-step field
static
word
rDeltaTName
;
//- Name of the reciprocal local face time-step field
static
word
rDeltaTfName
;
//- Name of the reciprocal local sub-cycling time-step field
static
word
rSubDeltaTName
;
...
...
@@ -88,6 +91,10 @@ public:
// looked-up from the objectRegistry
static
const
volScalarField
&
localRDeltaT
(
const
fvMesh
&
mesh
);
//- Return the reciprocal of the local face time-step
// looked-up from the objectRegistry
static
const
surfaceScalarField
&
localRDeltaTf
(
const
fvMesh
&
mesh
);
//- Calculate and return the reciprocal of the local sub-cycling
// time-step
static
tmp
<
volScalarField
>
localRSubDeltaT
...
...
@@ -119,6 +126,9 @@ class localEulerDdtScheme
//- Return the reciprocal of the local time-step
const
volScalarField
&
localRDeltaT
()
const
;
//- Return the reciprocal of the local face time-step
const
surfaceScalarField
&
localRDeltaTf
()
const
;
public:
...
...
@@ -178,6 +188,11 @@ public:
const
GeometricField
<
Type
,
fvPatchField
,
volMesh
>&
psi
);
tmp
<
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>>
fvcDdt
(
const
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>&
);
tmp
<
fvMatrix
<
Type
>>
fvmDdt
(
const
GeometricField
<
Type
,
fvPatchField
,
volMesh
>&
...
...
src/finiteVolume/finiteVolume/fvc/fvcDdt.C
View file @
304af9fc
...
...
@@ -125,6 +125,21 @@ ddt
}
template
<
class
Type
>
tmp
<
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>>
ddt
(
const
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>&
sf
)
{
return
fv
::
ddtScheme
<
Type
>::
New
(
sf
.
mesh
(),
sf
.
mesh
().
ddtScheme
(
"ddt("
+
sf
.
name
()
+
')'
)
).
ref
().
fvcDdt
(
sf
);
}
template
<
class
Type
>
tmp
<
GeometricField
<
Type
,
fvPatchField
,
volMesh
>>
ddt
...
...
src/finiteVolume/finiteVolume/fvc/fvcDdt.H
View file @
304af9fc
...
...
@@ -88,6 +88,12 @@ namespace fvc
const
GeometricField
<
Type
,
fvPatchField
,
volMesh
>&
);
template
<
class
Type
>
tmp
<
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>>
ddt
(
const
GeometricField
<
Type
,
fvsPatchField
,
surfaceMesh
>&
);
template
<
class
Type
>
tmp
<
GeometricField
<
Type
,
fvPatchField
,
volMesh
>>
ddt
(
...
...
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