Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
667b5c13
Commit
667b5c13
authored
Oct 26, 2010
by
Andrew Heather
Browse files
Merge branch 'master' of
ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
parents
4f8ea8d6
cfbc1fcb
Changes
57
Hide whitespace changes
Inline
Side-by-side
applications/solvers/multiphase/interFoam/Allwclean
View file @
667b5c13
...
...
@@ -6,5 +6,6 @@ wclean
wclean interDyMFoam
wclean MRFInterFoam
wclean porousInterFoam
wclean LTSInterFoam
# ----------------------------------------------------------------- end-of-file
applications/solvers/multiphase/interFoam/Allwmake
View file @
667b5c13
...
...
@@ -6,5 +6,6 @@ wmake
wmake interDyMFoam
wmake MRFInterFoam
wmake porousInterFoam
wmake LTSInterFoam
# ----------------------------------------------------------------- end-of-file
applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C
0 → 100644
View file @
667b5c13
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
interFoam
Description
Solver for 2 incompressible, isothermal immiscible fluids using a VOF
(volume of fluid) phase-fraction based interface capturing approach.
The momentum and other fluid properties are of the "mixture" and a single
momentum equation is solved.
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
For a two-fluid approach see twoPhaseEulerFoam.
\*---------------------------------------------------------------------------*/
#include
"fvCFD.H"
#include
"MULES.H"
#include
"subCycle.H"
#include
"interfaceProperties.H"
#include
"twoPhaseMixture.H"
#include
"turbulenceModel.H"
#include
"fvcSmooth.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
#include
"setRootCase.H"
#include
"createTime.H"
#include
"createMesh.H"
#include
"readPISOControls.H"
#include
"initContinuityErrs.H"
#include
"createFields.H"
#include
"correctPhi.H"
#include
"CourantNo.H"
#include
"setInitialrDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
runTime
.
run
())
{
#include
"readPISOControls.H"
runTime
++
;
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
#include
"setrDeltaT.H"
twoPhaseProperties
.
correct
();
#include
"alphaEqnSubCycle.H"
turbulence
->
correct
();
#include
"UEqn.H"
// --- PISO loop
for
(
int
corr
=
0
;
corr
<
nCorr
;
corr
++
)
{
#include
"pEqn.H"
}
runTime
.
write
();
Info
<<
"ExecutionTime = "
<<
runTime
.
elapsedCpuTime
()
<<
" s"
<<
" ClockTime = "
<<
runTime
.
elapsedClockTime
()
<<
" s"
<<
nl
<<
endl
;
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/multiphase/interFoam/LTSInterFoam/MULES.C
0 → 100644
View file @
667b5c13
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include
"MULES.H"
#include
"upwind.H"
#include
"uncorrectedSnGrad.H"
#include
"gaussConvectionScheme.H"
#include
"gaussLaplacianScheme.H"
#include
"uncorrectedSnGrad.H"
#include
"surfaceInterpolate.H"
#include
"fvcSurfaceIntegrate.H"
#include
"slicedSurfaceFields.H"
#include
"syncTools.H"
#include
"fvCFD.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void
Foam
::
MULES
::
explicitLTSSolve
(
volScalarField
&
psi
,
const
surfaceScalarField
&
phi
,
surfaceScalarField
&
phiPsi
,
const
scalar
psiMax
,
const
scalar
psiMin
)
{
explicitLTSSolve
(
geometricOneField
(),
psi
,
phi
,
phiPsi
,
zeroField
(),
zeroField
(),
psiMax
,
psiMin
);
}
void
Foam
::
MULES
::
implicitSolve
(
volScalarField
&
psi
,
const
surfaceScalarField
&
phi
,
surfaceScalarField
&
phiPsi
,
const
scalar
psiMax
,
const
scalar
psiMin
)
{
implicitSolve
(
geometricOneField
(),
psi
,
phi
,
phiPsi
,
zeroField
(),
zeroField
(),
psiMax
,
psiMin
);
}
// ************************************************************************* //
applications/solvers/multiphase/interFoam/LTSInterFoam/MULES.H
0 → 100644
View file @
667b5c13
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Global
MULES
Description
MULES: Multidimensional universal limiter with explicit solution.
Solve a convective-only transport equation using an explicit universal
multi-dimensional limiter.
Parameters are the variable to solve, the normal convective flux and the
actual explicit flux of the variable which is also used to return limited
flux used in the bounded-solution.
SourceFiles
MULES.C
\*---------------------------------------------------------------------------*/
#ifndef MULES_H
#define MULES_H
#include
"volFields.H"
#include
"surfaceFieldsFwd.H"
#include
"primitiveFieldsFwd.H"
#include
"zeroField.H"
#include
"geometricOneField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
MULES
{
template
<
class
RhoType
,
class
SpType
,
class
SuType
>
void
explicitLTSSolve
(
const
RhoType
&
rho
,
volScalarField
&
psi
,
const
surfaceScalarField
&
phiBD
,
surfaceScalarField
&
phiPsi
,
const
SpType
&
Sp
,
const
SuType
&
Su
,
const
scalar
psiMax
,
const
scalar
psiMin
);
void
explicitLTSSolve
(
volScalarField
&
psi
,
const
surfaceScalarField
&
phiBD
,
surfaceScalarField
&
phiPsi
,
const
scalar
psiMax
,
const
scalar
psiMin
);
template
<
class
RhoType
,
class
SpType
,
class
SuType
>
void
implicitSolve
(
const
RhoType
&
rho
,
volScalarField
&
gamma
,
const
surfaceScalarField
&
phi
,
surfaceScalarField
&
phiCorr
,
const
SpType
&
Sp
,
const
SuType
&
Su
,
const
scalar
psiMax
,
const
scalar
psiMin
);
void
implicitSolve
(
volScalarField
&
gamma
,
const
surfaceScalarField
&
phi
,
surfaceScalarField
&
phiCorr
,
const
scalar
psiMax
,
const
scalar
psiMin
);
template
<
class
RhoType
,
class
SpType
,
class
SuType
>
void
limiter
(
scalarField
&
allLambda
,
const
RhoType
&
rho
,
const
volScalarField
&
psi
,
const
surfaceScalarField
&
phiBD
,
const
surfaceScalarField
&
phiCorr
,
const
SpType
&
Sp
,
const
SuType
&
Su
,
const
scalar
psiMax
,
const
scalar
psiMin
,
const
label
nLimiterIter
);
}
// End namespace MULES
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "MULESTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
applications/solvers/multiphase/interFoam/LTSInterFoam/MULESTemplates.C
0 → 100644
View file @
667b5c13
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include
"MULES.H"
#include
"upwind.H"
#include
"uncorrectedSnGrad.H"
#include
"gaussConvectionScheme.H"
#include
"gaussLaplacianScheme.H"
#include
"uncorrectedSnGrad.H"
#include
"surfaceInterpolate.H"
#include
"fvcSurfaceIntegrate.H"
#include
"slicedSurfaceFields.H"
#include
"syncTools.H"
#include
"fvCFD.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template
<
class
RhoType
,
class
SpType
,
class
SuType
>
void
Foam
::
MULES
::
explicitLTSSolve
(
const
RhoType
&
rho
,
volScalarField
&
psi
,
const
surfaceScalarField
&
phi
,
surfaceScalarField
&
phiPsi
,
const
SpType
&
Sp
,
const
SuType
&
Su
,
const
scalar
psiMax
,
const
scalar
psiMin
)
{
Info
<<
"MULES: Solving for "
<<
psi
.
name
()
<<
endl
;
const
fvMesh
&
mesh
=
psi
.
mesh
();
psi
.
correctBoundaryConditions
();
surfaceScalarField
phiBD
=
upwind
<
scalar
>
(
psi
.
mesh
(),
phi
).
flux
(
psi
);
surfaceScalarField
&
phiCorr
=
phiPsi
;
phiCorr
-=
phiBD
;
scalarField
allLambda
(
mesh
.
nFaces
(),
1
.
0
);
slicedSurfaceScalarField
lambda
(
IOobject
(
"lambda"
,
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
,
false
),
mesh
,
dimless
,
allLambda
,
false
// Use slices for the couples
);
limiter
(
allLambda
,
rho
,
psi
,
phiBD
,
phiCorr
,
Sp
.
field
(),
Su
.
field
(),
psiMax
,
psiMin
,
3
);
phiPsi
=
phiBD
+
lambda
*
phiCorr
;
scalarField
&
psiIf
=
psi
;
const
scalarField
&
psi0
=
psi
.
oldTime
();
const
volScalarField
&
rDeltaT
=
mesh
.
objectRegistry
::
lookupObject
<
volScalarField
>
(
"rSubDeltaT"
);
psiIf
=
0
.
0
;
fvc
::
surfaceIntegrate
(
psiIf
,
phiPsi
);
if
(
mesh
.
moving
())
{
psiIf
=
(
mesh
.
Vsc0
()
*
rho
.
oldTime
()
*
psi0
*
rDeltaT
/
mesh
.
Vsc
()
+
Su
.
field
()
-
psiIf
)
/
(
rho
*
rDeltaT
-
Sp
.
field
());
}
else
{
psiIf
=
(
rho
.
oldTime
()
*
psi0
*
rDeltaT
+
Su
.
field
()
-
psiIf
)
/
(
rho
*
rDeltaT
-
Sp
.
field
());
}
psi
.
correctBoundaryConditions
();
}
template
<
class
RhoType
,
class
SpType
,
class
SuType
>
void
Foam
::
MULES
::
implicitSolve
(
const
RhoType
&
rho
,
volScalarField
&
psi
,
const
surfaceScalarField
&
phi
,
surfaceScalarField
&
phiPsi
,
const
SpType
&
Sp
,
const
SuType
&
Su
,
const
scalar
psiMax
,
const
scalar
psiMin
)
{
const
fvMesh
&
mesh
=
psi
.
mesh
();
const
dictionary
&
MULEScontrols
=
mesh
.
solverDict
(
psi
.
name
());
label
maxIter
(
readLabel
(
MULEScontrols
.
lookup
(
"maxIter"
))
);
label
nLimiterIter
(
readLabel
(
MULEScontrols
.
lookup
(
"nLimiterIter"
))
);
scalar
maxUnboundedness
(
readScalar
(
MULEScontrols
.
lookup
(
"maxUnboundedness"
))
);
scalar
CoCoeff
(
readScalar
(
MULEScontrols
.
lookup
(
"CoCoeff"
))
);
scalarField
allCoLambda
(
mesh
.
nFaces
());
{
surfaceScalarField
Cof
=
mesh
.
time
().
deltaT
()
*
mesh
.
surfaceInterpolation
::
deltaCoeffs
()
*
mag
(
phi
)
/
mesh
.
magSf
();
slicedSurfaceScalarField
CoLambda
(
IOobject
(
"CoLambda"
,
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
,
false
),
mesh
,
dimless
,
allCoLambda
,
false
// Use slices for the couples
);
CoLambda
==
1
.
0
/
max
(
CoCoeff
*
Cof
,
scalar
(
1
));
}
scalarField
allLambda
(
allCoLambda
);
//scalarField allLambda(mesh.nFaces(), 1.0);
slicedSurfaceScalarField
lambda
(
IOobject
(
"lambda"
,
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
,
false
),
mesh
,
dimless
,
allLambda
,
false
// Use slices for the couples
);
linear
<
scalar
>
CDs
(
mesh
);
upwind
<
scalar
>
UDs
(
mesh
,
phi
);
//fv::uncorrectedSnGrad<scalar> snGrads(mesh);
fvScalarMatrix
psiConvectionDiffusion
(
fvm
::
ddt
(
rho
,
psi
)
+
fv
::
gaussConvectionScheme
<
scalar
>
(
mesh
,
phi
,
UDs
).
fvmDiv
(
phi
,
psi
)
//- fv::gaussLaplacianScheme<scalar, scalar>(mesh, CDs, snGrads)
//.fvmLaplacian(Dpsif, psi)
-
fvm
::
Sp
(
Sp
,
psi
)
-
Su
);
surfaceScalarField
phiBD
=
psiConvectionDiffusion
.
flux
();
surfaceScalarField
&
phiCorr
=
phiPsi
;
phiCorr
-=
phiBD
;
for
(
label
i
=
0
;
i
<
maxIter
;
i
++
)
{
if
(
i
!=
0
&&
i
<
4
)
{
allLambda
=
allCoLambda
;
}
limiter
(
allLambda
,
rho
,
psi
,
phiBD
,
phiCorr
,
Sp
.
field
(),
Su
.
field
(),
psiMax
,
psiMin
,
nLimiterIter
);
solve
(
psiConvectionDiffusion
+
fvc
::
div
(
lambda
*
phiCorr
),
MULEScontrols
);
scalar
maxPsiM1
=
gMax
(
psi
.
internalField
())
-
1
.
0
;
scalar
minPsi
=
gMin
(
psi
.
internalField
());