mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge remote-tracking branch 'origin/develop' into feature-shortestPathSet
This commit is contained in:
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[submodule "cfmesh"]
|
||||||
|
path = modules/cfmesh
|
||||||
|
url = https://develop.openfoam.com/Community/integration-cfmesh.git
|
||||||
|
[submodule "avalanche"]
|
||||||
|
path = modules/avalanche
|
||||||
|
url = https://develop.openfoam.com/Community/avalanche.git
|
||||||
9
Allwmake
9
Allwmake
@ -43,6 +43,15 @@ echo "Compile OpenFOAM applications"
|
|||||||
echo
|
echo
|
||||||
applications/Allwmake $targetType $*
|
applications/Allwmake $targetType $*
|
||||||
|
|
||||||
|
# Additional components/modules
|
||||||
|
if [ -d "$WM_PROJECT_DIR/modules" ]
|
||||||
|
then
|
||||||
|
echo "========================================"
|
||||||
|
echo "Compile OpenFOAM modules"
|
||||||
|
echo
|
||||||
|
(cd $WM_PROJECT_DIR/modules 2>/dev/null && wmake -all)
|
||||||
|
fi
|
||||||
|
|
||||||
# Some summary information
|
# Some summary information
|
||||||
echo
|
echo
|
||||||
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
|
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
OpenFOAM-1706
|
OpenFOAM-1712
|
||||||
==================
|
==================
|
||||||
Known Build Issues
|
Known Build Issues
|
||||||
==================
|
==================
|
||||||
@ -75,6 +75,33 @@ If your system compiler is too old to build the minimum required gcc or
|
|||||||
clang/llvm, it is just simply too old.
|
clang/llvm, it is just simply too old.
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------
|
||||||
|
ThirdParty clang without gmp/mpfr
|
||||||
|
---------------------------------
|
||||||
|
|
||||||
|
If using ThirdParty clang without gmp/mpfr, the ThirdParty makeCGAL
|
||||||
|
script will need to be run manually and specify that there is no
|
||||||
|
gmp/mpfr. Eg,
|
||||||
|
|
||||||
|
cd $WM_THIRD_PARTY_DIR
|
||||||
|
./makeCGAL gmp-none mpfr-none
|
||||||
|
|
||||||
|
Subequent compilation with Allwmake will now run largely without any
|
||||||
|
problems, except that the components linking against CGAL
|
||||||
|
(foamyMesh and surfaceBooleanFeatures) will also try to link against
|
||||||
|
a nonexistent mpfr library. As a workaround, the link-dependency can
|
||||||
|
be removed in wmake/rules/General/CGAL :
|
||||||
|
|
||||||
|
CGAL_LIBS = \
|
||||||
|
-L$(BOOST_ARCH_PATH)/lib \
|
||||||
|
-L$(BOOST_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
|
||||||
|
-L$(CGAL_ARCH_PATH)/lib \
|
||||||
|
-L$(CGAL_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
|
||||||
|
-lCGAL
|
||||||
|
|
||||||
|
This is a temporary inconvenience until a more robust solution is found.
|
||||||
|
|
||||||
|
|
||||||
-------------------------
|
-------------------------
|
||||||
Building with spack
|
Building with spack
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
# About OpenFOAM
|
# About OpenFOAM
|
||||||
OpenFOAM is a free, open source CFD software [released and developed primarily by OpenCFD Ltd](http://www.openfoam.com) since 2004. It has a large user base across most areas of engineering and science, from both commercial and academic organisations. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to acoustics, solid mechanics and electromagnetics. [More...](http://www.openfoam.com/documentation)
|
OpenFOAM is a free, open source CFD software [released and developed primarily by OpenCFD Ltd](http://www.openfoam.com) since 2004. It has a large user base across most areas of engineering and science, from both commercial and academic organisations. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to acoustics, solid mechanics and electromagnetics. [More...](http://www.openfoam.com/documentation)
|
||||||
|
|
||||||
OpenFOAM+ is professionally released every six months to include customer sponsored developments and contributions from the community, including the OpenFOAM Foundation. Releases designated OpenFOAM+ contain several man years of client-sponsored developments of which much has been transferred to, but not released in the OpenFOAM Foundation branch.
|
|
||||||
|
OpenFOAM is professionally released every six months to include customer sponsored developments and contributions from the community - individual and group contributors, fork re-integrations including from FOAM-extend and OpenFOAM Foundation Ltd - in this Official Release sanctioned by the OpenFOAM Worldwide Trademark Owner aiming towards one OpenFOAM.
|
||||||
|
|
||||||
|
|
||||||
# Copyright
|
# Copyright
|
||||||
@ -9,7 +10,7 @@ OpenFOAM is free software: you can redistribute it and/or modify it under the te
|
|||||||
|
|
||||||
|
|
||||||
# OpenFOAM Trademark
|
# OpenFOAM Trademark
|
||||||
OpenCFD Ltd grants use of the OpenFOAM trademark by Third Parties on a licence basis. ESI Group and the OpenFOAM Foundation Ltd are currently permitted to use the Name and agreed Domain Name. For information on trademark use, please refer to the [trademark policy guidelines](http://www.openfoam.com/legal/trademark-policy.php).
|
OpenCFD Ltd grants use of its OpenFOAM trademark by Third Parties on a licence basis. ESI Group and OpenFOAM Foundation Ltd are currently permitted to use the Name and agreed Domain Name. For information on trademark use, please refer to the [trademark policy guidelines](http://www.openfoam.com/legal/trademark-policy.php).
|
||||||
|
|
||||||
Please [contact OpenCFD](http://www.openfoam.com/contact) if you have any questions on the use of the OpenFOAM trademark.
|
Please [contact OpenCFD](http://www.openfoam.com/contact) if you have any questions on the use of the OpenFOAM trademark.
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@ surfaceScalarField phi
|
|||||||
fvc::flux(U)
|
fvc::flux(U)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (args.optionFound("initialiseUBCs"))
|
if (args.found("initialiseUBCs"))
|
||||||
{
|
{
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
phi = fvc::flux(U);
|
phi = fvc::flux(U);
|
||||||
@ -41,7 +41,7 @@ if (args.optionFound("initialiseUBCs"))
|
|||||||
word pName("p");
|
word pName("p");
|
||||||
|
|
||||||
// Update name of the pressure field from the command-line option
|
// Update name of the pressure field from the command-line option
|
||||||
args.optionReadIfPresent("pName", pName);
|
args.readIfPresent("pName", pName);
|
||||||
|
|
||||||
// Infer the pressure BCs from the velocity
|
// Infer the pressure BCs from the velocity
|
||||||
wordList pBCTypes
|
wordList pBCTypes
|
||||||
|
|||||||
@ -0,0 +1,3 @@
|
|||||||
|
potentialFoam.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_APPBIN)/overPotentialFoam
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||||
|
-I$(LIB_SRC)/overset/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
|
-I$(LIB_SRC)/sampling/lnInclude
|
||||||
|
|
||||||
|
EXE_LIBS = \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-lmeshTools \
|
||||||
|
-lsampling \
|
||||||
|
-loverset
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
const dictionary& potentialFlow
|
||||||
|
(
|
||||||
|
mesh.solutionDict().subDict("potentialFlow")
|
||||||
|
);
|
||||||
|
|
||||||
|
const int nNonOrthCorr
|
||||||
|
(
|
||||||
|
potentialFlow.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0)
|
||||||
|
);
|
||||||
@ -0,0 +1,146 @@
|
|||||||
|
Info<< "Reading velocity field U\n" << endl;
|
||||||
|
volVectorField U
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"U",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
// Initialise the velocity internal field to zero
|
||||||
|
U = dimensionedVector("0", U.dimensions(), Zero);
|
||||||
|
|
||||||
|
surfaceScalarField phi
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"phi",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
fvc::flux(U)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (args.found("initialiseUBCs"))
|
||||||
|
{
|
||||||
|
U.correctBoundaryConditions();
|
||||||
|
phi = fvc::flux(U);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Construct a pressure field
|
||||||
|
// If it is available read it otherwise construct from the velocity BCs
|
||||||
|
// converting fixed-value BCs to zero-gradient and vice versa.
|
||||||
|
word pName("p");
|
||||||
|
|
||||||
|
// Update name of the pressure field from the command-line option
|
||||||
|
args.readIfPresent("pName", pName);
|
||||||
|
|
||||||
|
// Infer the pressure BCs from the velocity
|
||||||
|
wordList pBCTypes
|
||||||
|
(
|
||||||
|
U.boundaryField().size(),
|
||||||
|
fixedValueFvPatchScalarField::typeName
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(U.boundaryField(), patchi)
|
||||||
|
{
|
||||||
|
if (U.boundaryField()[patchi].fixesValue())
|
||||||
|
{
|
||||||
|
pBCTypes[patchi] = zeroGradientFvPatchScalarField::typeName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Note that registerObject is false for the pressure field. The pressure
|
||||||
|
// field in this solver doesn't have a physical value during the solution.
|
||||||
|
// It shouldn't be looked up and used by sub models or boundary conditions.
|
||||||
|
Info<< "Constructing pressure field " << pName << nl << endl;
|
||||||
|
volScalarField p
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
pName,
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar(pName, sqr(dimVelocity), 0),
|
||||||
|
pBCTypes
|
||||||
|
);
|
||||||
|
|
||||||
|
// Infer the velocity potential BCs from the pressure
|
||||||
|
wordList PhiBCTypes
|
||||||
|
(
|
||||||
|
p.boundaryField().size(),
|
||||||
|
zeroGradientFvPatchScalarField::typeName
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(p.boundaryField(), patchi)
|
||||||
|
{
|
||||||
|
if (p.boundaryField()[patchi].fixesValue())
|
||||||
|
{
|
||||||
|
PhiBCTypes[patchi] = fixedValueFvPatchScalarField::typeName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Constructing velocity potential field Phi\n" << endl;
|
||||||
|
volScalarField Phi
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Phi",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar("Phi", dimLength*dimVelocity, 0),
|
||||||
|
PhiBCTypes
|
||||||
|
);
|
||||||
|
|
||||||
|
label PhiRefCell = 0;
|
||||||
|
scalar PhiRefValue = 0;
|
||||||
|
setRefCell
|
||||||
|
(
|
||||||
|
Phi,
|
||||||
|
potentialFlow.dict(),
|
||||||
|
PhiRefCell,
|
||||||
|
PhiRefValue
|
||||||
|
);
|
||||||
|
mesh.setFluxRequired(Phi.name());
|
||||||
|
|
||||||
|
#include "createMRF.H"
|
||||||
|
|
||||||
|
// Add overset specific interpolations
|
||||||
|
{
|
||||||
|
dictionary oversetDict;
|
||||||
|
oversetDict.add("Phi", true);
|
||||||
|
oversetDict.add("U", true);
|
||||||
|
|
||||||
|
const_cast<dictionary&>
|
||||||
|
(
|
||||||
|
mesh.schemesDict()
|
||||||
|
).add
|
||||||
|
(
|
||||||
|
"oversetInterpolationRequired",
|
||||||
|
oversetDict,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mask field for zeroing out contributions on hole cells
|
||||||
|
#include "createCellMask.H"
|
||||||
|
|
||||||
|
// Create bool field with interpolated cells
|
||||||
|
#include "createInterpolatedCells.H"
|
||||||
@ -0,0 +1,260 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2017 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
|
||||||
|
potentialFoam
|
||||||
|
|
||||||
|
Group
|
||||||
|
grpBasicSolvers
|
||||||
|
|
||||||
|
Description
|
||||||
|
Potential flow solver which solves for the velocity potential, to
|
||||||
|
calculate the flux-field, from which the velocity field is obtained by
|
||||||
|
reconstructing the flux.
|
||||||
|
|
||||||
|
\heading Solver details
|
||||||
|
The potential flow solution is typically employed to generate initial fields
|
||||||
|
for full Navier-Stokes codes. The flow is evolved using the equation:
|
||||||
|
|
||||||
|
\f[
|
||||||
|
\laplacian \Phi = \div(\vec{U})
|
||||||
|
\f]
|
||||||
|
|
||||||
|
Where:
|
||||||
|
\vartable
|
||||||
|
\Phi | Velocity potential [m2/s]
|
||||||
|
\vec{U} | Velocity [m/s]
|
||||||
|
\endvartable
|
||||||
|
|
||||||
|
The corresponding pressure field could be calculated from the divergence
|
||||||
|
of the Euler equation:
|
||||||
|
|
||||||
|
\f[
|
||||||
|
\laplacian p + \div(\div(\vec{U}\otimes\vec{U})) = 0
|
||||||
|
\f]
|
||||||
|
|
||||||
|
but this generates excessive pressure variation in regions of large
|
||||||
|
velocity gradient normal to the flow direction. A better option is to
|
||||||
|
calculate the pressure field corresponding to velocity variation along the
|
||||||
|
stream-lines:
|
||||||
|
|
||||||
|
\f[
|
||||||
|
\laplacian p + \div(\vec{F}\cdot\div(\vec{U}\otimes\vec{U})) = 0
|
||||||
|
\f]
|
||||||
|
where the flow direction tensor \f$\vec{F}\f$ is obtained from
|
||||||
|
\f[
|
||||||
|
\vec{F} = \hat{\vec{U}}\otimes\hat{\vec{U}}
|
||||||
|
\f]
|
||||||
|
|
||||||
|
\heading Required fields
|
||||||
|
\plaintable
|
||||||
|
U | Velocity [m/s]
|
||||||
|
\endplaintable
|
||||||
|
|
||||||
|
\heading Optional fields
|
||||||
|
\plaintable
|
||||||
|
p | Kinematic pressure [m2/s2]
|
||||||
|
Phi | Velocity potential [m2/s]
|
||||||
|
| Generated from p (if present) or U if not present
|
||||||
|
\endplaintable
|
||||||
|
|
||||||
|
\heading Options
|
||||||
|
\plaintable
|
||||||
|
-writep | write the Euler pressure
|
||||||
|
-writePhi | Write the final velocity potential
|
||||||
|
-initialiseUBCs | Update the velocity boundaries before solving for Phi
|
||||||
|
\endplaintable
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "fvCFD.H"
|
||||||
|
#include "pisoControl.H"
|
||||||
|
#include "dynamicFvMesh.H"
|
||||||
|
#include "cellCellStencilObject.H"
|
||||||
|
#include "localMin.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
argList::addOption
|
||||||
|
(
|
||||||
|
"pName",
|
||||||
|
"pName",
|
||||||
|
"Name of the pressure field"
|
||||||
|
);
|
||||||
|
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"initialiseUBCs",
|
||||||
|
"Initialise U boundary conditions"
|
||||||
|
);
|
||||||
|
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"writePhi",
|
||||||
|
"Write the final velocity potential field"
|
||||||
|
);
|
||||||
|
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"writep",
|
||||||
|
"Calculate and write the Euler pressure field"
|
||||||
|
);
|
||||||
|
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"withFunctionObjects",
|
||||||
|
"execute functionObjects"
|
||||||
|
);
|
||||||
|
|
||||||
|
#include "setRootCase.H"
|
||||||
|
#include "createTime.H"
|
||||||
|
#include "createNamedDynamicFvMesh.H"
|
||||||
|
|
||||||
|
pisoControl potentialFlow(mesh, "potentialFlow");
|
||||||
|
|
||||||
|
#include "createFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Info<< nl << "Calculating potential flow" << endl;
|
||||||
|
|
||||||
|
mesh.update();
|
||||||
|
|
||||||
|
surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
|
||||||
|
|
||||||
|
// Since solver contains no time loop it would never execute
|
||||||
|
// function objects so do it ourselves
|
||||||
|
runTime.functionObjects().start();
|
||||||
|
|
||||||
|
MRF.makeRelative(phi);
|
||||||
|
adjustPhi(phi, U, p);
|
||||||
|
|
||||||
|
// Non-orthogonal velocity potential corrector loop
|
||||||
|
while (potentialFlow.correct())
|
||||||
|
{
|
||||||
|
phi = fvc::flux(U);
|
||||||
|
|
||||||
|
while (potentialFlow.correctNonOrthogonal())
|
||||||
|
{
|
||||||
|
fvScalarMatrix PhiEqn
|
||||||
|
(
|
||||||
|
fvm::laplacian(faceMask, Phi)
|
||||||
|
==
|
||||||
|
fvc::div(phi)
|
||||||
|
);
|
||||||
|
|
||||||
|
PhiEqn.setReference(PhiRefCell, PhiRefValue);
|
||||||
|
PhiEqn.solve();
|
||||||
|
|
||||||
|
if (potentialFlow.finalNonOrthogonalIter())
|
||||||
|
{
|
||||||
|
phi -= PhiEqn.flux();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MRF.makeAbsolute(phi);
|
||||||
|
|
||||||
|
Info<< "Continuity error = "
|
||||||
|
<< mag(fvc::div(phi))().weightedAverage(mesh.V()).value()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
U = fvc::reconstruct(phi);
|
||||||
|
U.correctBoundaryConditions();
|
||||||
|
|
||||||
|
Info<< "Interpolated velocity error = "
|
||||||
|
<< (sqrt(sum(sqr(fvc::flux(U) - phi)))/sum(mesh.magSf())).value()
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write U and phi
|
||||||
|
U.write();
|
||||||
|
phi.write();
|
||||||
|
|
||||||
|
// Optionally write Phi
|
||||||
|
if (args.found("writePhi"))
|
||||||
|
{
|
||||||
|
Phi.write();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate the pressure field from the Euler equation
|
||||||
|
if (args.found("writep"))
|
||||||
|
{
|
||||||
|
Info<< nl << "Calculating approximate pressure field" << endl;
|
||||||
|
|
||||||
|
label pRefCell = 0;
|
||||||
|
scalar pRefValue = 0.0;
|
||||||
|
setRefCell
|
||||||
|
(
|
||||||
|
p,
|
||||||
|
potentialFlow.dict(),
|
||||||
|
pRefCell,
|
||||||
|
pRefValue
|
||||||
|
);
|
||||||
|
|
||||||
|
// Calculate the flow-direction filter tensor
|
||||||
|
volScalarField magSqrU(magSqr(U));
|
||||||
|
volSymmTensorField F(sqr(U)/(magSqrU + SMALL*average(magSqrU)));
|
||||||
|
|
||||||
|
// Calculate the divergence of the flow-direction filtered div(U*U)
|
||||||
|
// Filtering with the flow-direction generates a more reasonable
|
||||||
|
// pressure distribution in regions of high velocity gradient in the
|
||||||
|
// direction of the flow
|
||||||
|
volScalarField divDivUU
|
||||||
|
(
|
||||||
|
fvc::div
|
||||||
|
(
|
||||||
|
F & fvc::div(phi, U),
|
||||||
|
"div(div(phi,U))"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Solve a Poisson equation for the approximate pressure
|
||||||
|
while (potentialFlow.correctNonOrthogonal())
|
||||||
|
{
|
||||||
|
fvScalarMatrix pEqn
|
||||||
|
(
|
||||||
|
fvm::laplacian(p) + divDivUU
|
||||||
|
);
|
||||||
|
|
||||||
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
|
pEqn.solve();
|
||||||
|
}
|
||||||
|
|
||||||
|
p.write();
|
||||||
|
}
|
||||||
|
|
||||||
|
runTime.functionObjects().end();
|
||||||
|
|
||||||
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
|
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||||
|
<< nl << endl;
|
||||||
|
|
||||||
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -181,13 +181,13 @@ int main(int argc, char *argv[])
|
|||||||
phi.write();
|
phi.write();
|
||||||
|
|
||||||
// Optionally write Phi
|
// Optionally write Phi
|
||||||
if (args.optionFound("writePhi"))
|
if (args.found("writePhi"))
|
||||||
{
|
{
|
||||||
Phi.write();
|
Phi.write();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate the pressure field from the Euler equation
|
// Calculate the pressure field from the Euler equation
|
||||||
if (args.optionFound("writep"))
|
if (args.found("writep"))
|
||||||
{
|
{
|
||||||
Info<< nl << "Calculating approximate pressure field" << endl;
|
Info<< nl << "Calculating approximate pressure field" << endl;
|
||||||
|
|
||||||
|
|||||||
@ -165,7 +165,7 @@ IOdictionary PDRProperties
|
|||||||
autoPtr<PDRDragModel> drag = PDRDragModel::New
|
autoPtr<PDRDragModel> drag = PDRDragModel::New
|
||||||
(
|
(
|
||||||
PDRProperties,
|
PDRProperties,
|
||||||
turbulence,
|
*turbulence,
|
||||||
rho,
|
rho,
|
||||||
U,
|
U,
|
||||||
phi
|
phi
|
||||||
@ -176,7 +176,7 @@ autoPtr<XiModel> flameWrinkling = XiModel::New
|
|||||||
(
|
(
|
||||||
PDRProperties,
|
PDRProperties,
|
||||||
thermo,
|
thermo,
|
||||||
turbulence,
|
*turbulence,
|
||||||
Su,
|
Su,
|
||||||
rho,
|
rho,
|
||||||
b,
|
b,
|
||||||
|
|||||||
@ -42,7 +42,7 @@ Description
|
|||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include "thermoPhysicsTypes.H"
|
#include "thermoPhysicsTypes.H"
|
||||||
#include "basicMultiComponentMixture.H"
|
#include "basicMultiComponentMixture.H"
|
||||||
#include "cellModeller.H"
|
#include "cellModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,5 @@
|
|||||||
Info<< "Constructing single cell mesh" << nl << endl;
|
Info<< "Constructing single cell mesh" << nl << endl;
|
||||||
|
|
||||||
labelList owner(6, label(0));
|
|
||||||
labelList neighbour(0);
|
|
||||||
|
|
||||||
pointField points(8);
|
pointField points(8);
|
||||||
points[0] = vector(0, 0, 0);
|
points[0] = vector(0, 0, 0);
|
||||||
points[1] = vector(1, 0, 0);
|
points[1] = vector(1, 0, 0);
|
||||||
@ -13,8 +10,7 @@ points[5] = vector(1, 0, 1);
|
|||||||
points[6] = vector(1, 1, 1);
|
points[6] = vector(1, 1, 1);
|
||||||
points[7] = vector(0, 1, 1);
|
points[7] = vector(0, 1, 1);
|
||||||
|
|
||||||
const cellModel& hexa = *(cellModeller::lookup("hex"));
|
faceList faces = cellModel::ref(cellModel::HEX).modelFaces();
|
||||||
faceList faces = hexa.modelFaces();
|
|
||||||
|
|
||||||
fvMesh mesh
|
fvMesh mesh
|
||||||
(
|
(
|
||||||
@ -25,10 +21,10 @@ fvMesh mesh
|
|||||||
runTime,
|
runTime,
|
||||||
IOobject::READ_IF_PRESENT
|
IOobject::READ_IF_PRESENT
|
||||||
),
|
),
|
||||||
xferMove<Field<vector>>(points),
|
std::move(points),
|
||||||
faces.xfer(),
|
std::move(faces),
|
||||||
owner.xfer(),
|
labelList(6, Zero), // owner
|
||||||
neighbour.xfer()
|
labelList() // neighbour
|
||||||
);
|
);
|
||||||
|
|
||||||
List<polyPatch*> patches(1);
|
List<polyPatch*> patches(1);
|
||||||
|
|||||||
@ -209,16 +209,14 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
|
|||||||
{
|
{
|
||||||
fvPatchScalarField::write(os);
|
fvPatchScalarField::write(os);
|
||||||
|
|
||||||
writeEntryIfDifferent<word>(os, "U", "U", UName_);
|
os.writeEntryIfDifferent<word>("U", "U", UName_);
|
||||||
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
|
||||||
writeEntryIfDifferent<word>(os, "psi", "thermo:psi", psiName_);
|
os.writeEntryIfDifferent<word>("psi", "thermo:psi", psiName_);
|
||||||
writeEntryIfDifferent<word>(os, "mu", "thermo:mu", muName_);
|
os.writeEntryIfDifferent<word>("mu", "thermo:mu", muName_);
|
||||||
|
|
||||||
os.writeKeyword("accommodationCoeff")
|
os.writeEntry("accommodationCoeff", accommodationCoeff_);
|
||||||
<< accommodationCoeff_ << token::END_STATEMENT << nl;
|
|
||||||
Twall_.writeEntry("Twall", os);
|
Twall_.writeEntry("Twall", os);
|
||||||
os.writeKeyword("gamma")
|
os.writeEntry("gamma", gamma_);
|
||||||
<< gamma_ << token::END_STATEMENT << nl;
|
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,8 +32,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef smoluchowskiJumpTFvPatchScalarFields_H
|
#ifndef smoluchowskiJumpTFvPatchScalarField_H
|
||||||
#define smoluchowskiJumpTFvPatchScalarFields_H
|
#define smoluchowskiJumpTFvPatchScalarField_H
|
||||||
|
|
||||||
#include "mixedFvPatchFields.H"
|
#include "mixedFvPatchFields.H"
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class smoluchowskiJumpTFvPatch Declaration
|
Class smoluchowskiJumpTFvPatchScalarField Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class smoluchowskiJumpTFvPatchScalarField
|
class smoluchowskiJumpTFvPatchScalarField
|
||||||
@ -74,6 +74,7 @@ class smoluchowskiJumpTFvPatchScalarField
|
|||||||
//- Heat capacity ratio (default 1.4)
|
//- Heat capacity ratio (default 1.4)
|
||||||
scalar gamma_;
|
scalar gamma_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
|
|||||||
@ -200,18 +200,16 @@ void Foam::maxwellSlipUFvPatchVectorField::updateCoeffs()
|
|||||||
void Foam::maxwellSlipUFvPatchVectorField::write(Ostream& os) const
|
void Foam::maxwellSlipUFvPatchVectorField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchVectorField::write(os);
|
fvPatchVectorField::write(os);
|
||||||
writeEntryIfDifferent<word>(os, "T", "T", TName_);
|
os.writeEntryIfDifferent<word>("T", "T", TName_);
|
||||||
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
|
||||||
writeEntryIfDifferent<word>(os, "psi", "thermo:psi", psiName_);
|
os.writeEntryIfDifferent<word>("psi", "thermo:psi", psiName_);
|
||||||
writeEntryIfDifferent<word>(os, "mu", "thermo:mu", muName_);
|
os.writeEntryIfDifferent<word>("mu", "thermo:mu", muName_);
|
||||||
writeEntryIfDifferent<word>(os, "tauMC", "tauMC", tauMCName_);
|
os.writeEntryIfDifferent<word>("tauMC", "tauMC", tauMCName_);
|
||||||
|
|
||||||
os.writeKeyword("accommodationCoeff")
|
os.writeEntry("accommodationCoeff", accommodationCoeff_);
|
||||||
<< accommodationCoeff_ << token::END_STATEMENT << nl;
|
|
||||||
Uwall_.writeEntry("Uwall", os);
|
Uwall_.writeEntry("Uwall", os);
|
||||||
os.writeKeyword("thermalCreep")
|
os.writeEntry("thermalCreep", thermalCreep_);
|
||||||
<< thermalCreep_ << token::END_STATEMENT << nl;
|
os.writeEntry("curvature", curvature_);
|
||||||
os.writeKeyword("curvature") << curvature_ << token::END_STATEMENT << nl;
|
|
||||||
|
|
||||||
refValue().writeEntry("refValue", os);
|
refValue().writeEntry("refValue", os);
|
||||||
valueFraction().writeEntry("valueFraction", os);
|
valueFraction().writeEntry("valueFraction", os);
|
||||||
|
|||||||
@ -117,8 +117,8 @@ void Foam::fixedRhoFvPatchScalarField::write(Ostream& os) const
|
|||||||
{
|
{
|
||||||
fvPatchScalarField::write(os);
|
fvPatchScalarField::write(os);
|
||||||
|
|
||||||
writeEntryIfDifferent<word>(os, "p", "p", this->pName_);
|
os.writeEntryIfDifferent<word>("p", "p", pName_);
|
||||||
writeEntryIfDifferent<word>(os, "psi", "thermo:psi", psiName_);
|
os.writeEntryIfDifferent<word>("psi", "thermo:psi", psiName_);
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -113,6 +113,9 @@ int main(int argc, char *argv[])
|
|||||||
phiv_pos -= mesh.phi();
|
phiv_pos -= mesh.phi();
|
||||||
phiv_neg -= mesh.phi();
|
phiv_neg -= mesh.phi();
|
||||||
}
|
}
|
||||||
|
// Note: extracted out the orientation so becomes unoriented
|
||||||
|
phiv_pos.setOriented(false);
|
||||||
|
phiv_neg.setOriented(false);
|
||||||
|
|
||||||
volScalarField c("c", sqrt(thermo.Cp()/thermo.Cv()*rPsi));
|
volScalarField c("c", sqrt(thermo.Cp()/thermo.Cv()*rPsi));
|
||||||
surfaceScalarField cSf_pos
|
surfaceScalarField cSf_pos
|
||||||
@ -120,14 +123,11 @@ int main(int argc, char *argv[])
|
|||||||
"cSf_pos",
|
"cSf_pos",
|
||||||
interpolate(c, pos, T.name())*mesh.magSf()
|
interpolate(c, pos, T.name())*mesh.magSf()
|
||||||
);
|
);
|
||||||
cSf_pos.setOriented();
|
|
||||||
|
|
||||||
surfaceScalarField cSf_neg
|
surfaceScalarField cSf_neg
|
||||||
(
|
(
|
||||||
"cSf_neg",
|
"cSf_neg",
|
||||||
interpolate(c, neg, T.name())*mesh.magSf()
|
interpolate(c, neg, T.name())*mesh.magSf()
|
||||||
);
|
);
|
||||||
cSf_neg.setOriented();
|
|
||||||
|
|
||||||
surfaceScalarField ap
|
surfaceScalarField ap
|
||||||
(
|
(
|
||||||
@ -168,11 +168,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
phi = aphiv_pos*rho_pos + aphiv_neg*rho_neg;
|
phi = aphiv_pos*rho_pos + aphiv_neg*rho_neg;
|
||||||
|
|
||||||
surfaceVectorField phiUp
|
surfaceVectorField phiU(aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg);
|
||||||
(
|
// Note: reassembled orientation from the pos and neg parts so becomes
|
||||||
(aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg)
|
// oriented
|
||||||
+ (a_pos*p_pos + a_neg*p_neg)*mesh.Sf()
|
phiU.setOriented(true);
|
||||||
);
|
|
||||||
|
surfaceVectorField phiUp(phiU + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf());
|
||||||
|
|
||||||
surfaceScalarField phiEp
|
surfaceScalarField phiEp
|
||||||
(
|
(
|
||||||
@ -185,7 +186,10 @@ int main(int argc, char *argv[])
|
|||||||
// Make flux for pressure-work absolute
|
// Make flux for pressure-work absolute
|
||||||
if (mesh.moving())
|
if (mesh.moving())
|
||||||
{
|
{
|
||||||
phiEp += mesh.phi()*(a_pos*p_pos + a_neg*p_neg);
|
surfaceScalarField phia(a_pos*p_pos + a_neg*p_neg);
|
||||||
|
phia.setOriented(true);
|
||||||
|
|
||||||
|
phiEp += mesh.phi()*phia;
|
||||||
}
|
}
|
||||||
|
|
||||||
volScalarField muEff("muEff", turbulence->muEff());
|
volScalarField muEff("muEff", turbulence->muEff());
|
||||||
@ -222,7 +226,7 @@ int main(int argc, char *argv[])
|
|||||||
fvc::interpolate(muEff)*mesh.magSf()*fvc::snGrad(U)
|
fvc::interpolate(muEff)*mesh.magSf()*fvc::snGrad(U)
|
||||||
+ fvc::dotInterpolate(mesh.Sf(), tauMC)
|
+ fvc::dotInterpolate(mesh.Sf(), tauMC)
|
||||||
)
|
)
|
||||||
& (a_pos*U_pos + a_neg*U_neg)
|
& (a_pos*U_pos + a_neg*U_neg)
|
||||||
);
|
);
|
||||||
|
|
||||||
solve
|
solve
|
||||||
|
|||||||
@ -93,7 +93,10 @@ int main(int argc, char *argv[])
|
|||||||
surfaceScalarField p_neg("p_neg", rho_neg*rPsi_neg);
|
surfaceScalarField p_neg("p_neg", rho_neg*rPsi_neg);
|
||||||
|
|
||||||
surfaceScalarField phiv_pos("phiv_pos", U_pos & mesh.Sf());
|
surfaceScalarField phiv_pos("phiv_pos", U_pos & mesh.Sf());
|
||||||
|
// Note: extracted out the orientation so becomes unoriented
|
||||||
|
phiv_pos.setOriented(false);
|
||||||
surfaceScalarField phiv_neg("phiv_neg", U_neg & mesh.Sf());
|
surfaceScalarField phiv_neg("phiv_neg", U_neg & mesh.Sf());
|
||||||
|
phiv_neg.setOriented(false);
|
||||||
|
|
||||||
volScalarField c("c", sqrt(thermo.Cp()/thermo.Cv()*rPsi));
|
volScalarField c("c", sqrt(thermo.Cp()/thermo.Cv()*rPsi));
|
||||||
surfaceScalarField cSf_pos
|
surfaceScalarField cSf_pos
|
||||||
@ -101,20 +104,19 @@ int main(int argc, char *argv[])
|
|||||||
"cSf_pos",
|
"cSf_pos",
|
||||||
interpolate(c, pos, T.name())*mesh.magSf()
|
interpolate(c, pos, T.name())*mesh.magSf()
|
||||||
);
|
);
|
||||||
cSf_pos.setOriented();
|
|
||||||
|
|
||||||
surfaceScalarField cSf_neg
|
surfaceScalarField cSf_neg
|
||||||
(
|
(
|
||||||
"cSf_neg",
|
"cSf_neg",
|
||||||
interpolate(c, neg, T.name())*mesh.magSf()
|
interpolate(c, neg, T.name())*mesh.magSf()
|
||||||
);
|
);
|
||||||
cSf_neg.setOriented();
|
|
||||||
|
|
||||||
surfaceScalarField ap
|
surfaceScalarField ap
|
||||||
(
|
(
|
||||||
"ap",
|
"ap",
|
||||||
max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero)
|
max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero)
|
||||||
);
|
);
|
||||||
|
|
||||||
surfaceScalarField am
|
surfaceScalarField am
|
||||||
(
|
(
|
||||||
"am",
|
"am",
|
||||||
@ -163,11 +165,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
phi = aphiv_pos*rho_pos + aphiv_neg*rho_neg;
|
phi = aphiv_pos*rho_pos + aphiv_neg*rho_neg;
|
||||||
|
|
||||||
surfaceVectorField phiUp
|
surfaceVectorField phiU(aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg);
|
||||||
(
|
// Note: reassembled orientation from the pos and neg parts so becomes
|
||||||
(aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg)
|
// oriented
|
||||||
+ (a_pos*p_pos + a_neg*p_neg)*mesh.Sf()
|
phiU.setOriented(true);
|
||||||
);
|
|
||||||
|
surfaceVectorField phiUp(phiU + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf());
|
||||||
|
|
||||||
surfaceScalarField phiEp
|
surfaceScalarField phiEp
|
||||||
(
|
(
|
||||||
|
|||||||
@ -61,18 +61,6 @@ dimensionedScalar rhoMin
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Creating turbulence model\n" << endl;
|
|
||||||
autoPtr<compressible::turbulenceModel> turbulence
|
|
||||||
(
|
|
||||||
compressible::turbulenceModel::New
|
|
||||||
(
|
|
||||||
rho,
|
|
||||||
U,
|
|
||||||
phi,
|
|
||||||
thermo
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
mesh.setFluxRequired(p.name());
|
mesh.setFluxRequired(p.name());
|
||||||
|
|
||||||
Info<< "Creating field dpdt\n" << endl;
|
Info<< "Creating field dpdt\n" << endl;
|
||||||
@ -115,3 +103,15 @@ volScalarField K("K", 0.5*magSqr(U));
|
|||||||
|
|
||||||
// Mask field for zeroing out contributions on hole cells
|
// Mask field for zeroing out contributions on hole cells
|
||||||
#include "createCellMask.H"
|
#include "createCellMask.H"
|
||||||
|
|
||||||
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
|
autoPtr<compressible::turbulenceModel> turbulence
|
||||||
|
(
|
||||||
|
compressible::turbulenceModel::New
|
||||||
|
(
|
||||||
|
rho,
|
||||||
|
U,
|
||||||
|
phi,
|
||||||
|
thermo
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|||||||
@ -7,8 +7,8 @@ surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
|
|||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField rhorAUf("rhorAUf", faceMask*fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", faceMask*fvc::interpolate(rho*rAU));
|
||||||
volVectorField HbyA("HbyA", constrainHbyA(rAU*UEqn.H(), U, p));
|
volVectorField HbyA("HbyA", U);
|
||||||
//mesh.interpolate(HbyA);
|
HbyA = constrainHbyA(cellMask*rAU*UEqn.H(), U, p);
|
||||||
|
|
||||||
if (pimple.nCorrPISO() <= 1)
|
if (pimple.nCorrPISO() <= 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -0,0 +1,3 @@
|
|||||||
|
rhoSimpleFoam.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_APPBIN)/overRhoSimpleFoam
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I.. \
|
||||||
|
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||||
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/cfdTools \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
|
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||||
|
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
|
-I$(LIB_SRC)/overset/lnInclude
|
||||||
|
|
||||||
|
EXE_LIBS = \
|
||||||
|
-lcompressibleTransportModels \
|
||||||
|
-lfluidThermophysicalModels \
|
||||||
|
-lspecie \
|
||||||
|
-lturbulenceModels \
|
||||||
|
-lcompressibleTurbulenceModels \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-lsampling \
|
||||||
|
-lmeshTools \
|
||||||
|
-lfvOptions \
|
||||||
|
-loverset \
|
||||||
|
-ldynamicFvMesh \
|
||||||
|
-ltopoChangerFvMesh
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
// Solve the Momentum equation
|
||||||
|
MRF.correctBoundaryVelocity(U);
|
||||||
|
|
||||||
|
tmp<fvVectorMatrix> tUEqn
|
||||||
|
(
|
||||||
|
fvm::div(phi, U)
|
||||||
|
+ MRF.DDt(rho, U)
|
||||||
|
+ turbulence->divDevRhoReff(U)
|
||||||
|
==
|
||||||
|
fvOptions(rho, U)
|
||||||
|
);
|
||||||
|
fvVectorMatrix& UEqn = tUEqn.ref();
|
||||||
|
|
||||||
|
UEqn.relax();
|
||||||
|
|
||||||
|
fvOptions.constrain(UEqn);
|
||||||
|
|
||||||
|
if (simple.momentumPredictor())
|
||||||
|
{
|
||||||
|
solve(UEqn == -cellMask*fvc::grad(p));
|
||||||
|
}
|
||||||
|
|
||||||
|
fvOptions.correct(U);
|
||||||
@ -0,0 +1 @@
|
|||||||
|
const volScalarField& psi = thermo.psi();
|
||||||
@ -0,0 +1,91 @@
|
|||||||
|
Info<< "Reading thermophysical properties\n" << endl;
|
||||||
|
|
||||||
|
autoPtr<fluidThermo> pThermo
|
||||||
|
(
|
||||||
|
fluidThermo::New(mesh)
|
||||||
|
);
|
||||||
|
fluidThermo& thermo = pThermo();
|
||||||
|
thermo.validate(args.executable(), "h", "e");
|
||||||
|
|
||||||
|
volScalarField& p = thermo.p();
|
||||||
|
|
||||||
|
volScalarField rho
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"rho",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
thermo.rho()
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< "Reading field U\n" << endl;
|
||||||
|
volVectorField U
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"U",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
#include "compressibleCreatePhi.H"
|
||||||
|
|
||||||
|
pressureControl pressureControl(p, rho, simple.dict());
|
||||||
|
|
||||||
|
mesh.setFluxRequired(p.name());
|
||||||
|
|
||||||
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
|
autoPtr<compressible::turbulenceModel> turbulence
|
||||||
|
(
|
||||||
|
compressible::turbulenceModel::New
|
||||||
|
(
|
||||||
|
rho,
|
||||||
|
U,
|
||||||
|
phi,
|
||||||
|
thermo
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
|
||||||
|
|
||||||
|
#include "createMRF.H"
|
||||||
|
|
||||||
|
//- Overset specific
|
||||||
|
|
||||||
|
// Add solver-specific interpolations
|
||||||
|
{
|
||||||
|
dictionary oversetDict;
|
||||||
|
oversetDict.add("U", true);
|
||||||
|
oversetDict.add("p", true);
|
||||||
|
oversetDict.add("HbyA", true);
|
||||||
|
oversetDict.add("grad(p)", true);
|
||||||
|
oversetDict.add("rho", true);
|
||||||
|
|
||||||
|
const_cast<dictionary&>
|
||||||
|
(
|
||||||
|
mesh.schemesDict()
|
||||||
|
).add
|
||||||
|
(
|
||||||
|
"oversetInterpolationRequired",
|
||||||
|
oversetDict,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mask field for zeroing out contributions on hole cells
|
||||||
|
#include "createCellMask.H"
|
||||||
|
|
||||||
|
#include "createInterpolatedCells.H"
|
||||||
|
|
||||||
|
bool adjustFringe
|
||||||
|
(
|
||||||
|
simple.dict().lookupOrDefault("oversetAdjustPhi", false)
|
||||||
|
);
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
Info<< "Create dynamic mesh for time = "
|
||||||
|
<< runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
|
autoPtr<dynamicFvMesh> meshPtr
|
||||||
|
(
|
||||||
|
dynamicFvMesh::New
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
dynamicFvMesh::defaultRegion,
|
||||||
|
runTime.timeName(),
|
||||||
|
runTime,
|
||||||
|
IOobject::MUST_READ
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
dynamicFvMesh& mesh = meshPtr();
|
||||||
|
|
||||||
|
// Calculate initial mesh-to-mesh mapping. Note that this should be
|
||||||
|
// done under the hood, e.g. as a MeshObject
|
||||||
|
mesh.update();
|
||||||
@ -0,0 +1,123 @@
|
|||||||
|
{
|
||||||
|
surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
|
||||||
|
|
||||||
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
|
surfaceScalarField rhorAUf("rhorAUf", faceMask*fvc::interpolate(rho*rAU));
|
||||||
|
volVectorField HbyA("HbyA", U);
|
||||||
|
HbyA = constrainHbyA(cellMask*rAU*UEqn.H(), U, p);
|
||||||
|
tUEqn.clear();
|
||||||
|
|
||||||
|
bool closedVolume = false;
|
||||||
|
|
||||||
|
surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(rho)*fvc::flux(HbyA));
|
||||||
|
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
|
// Update the pressure BCs to ensure flux consistency
|
||||||
|
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
|
||||||
|
|
||||||
|
if (simple.transonic())
|
||||||
|
{
|
||||||
|
surfaceScalarField phid
|
||||||
|
(
|
||||||
|
"phid",
|
||||||
|
(fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyA
|
||||||
|
);
|
||||||
|
|
||||||
|
phiHbyA -= fvc::interpolate(psi*p)*phiHbyA/fvc::interpolate(rho);
|
||||||
|
|
||||||
|
while (simple.correctNonOrthogonal())
|
||||||
|
{
|
||||||
|
fvScalarMatrix pEqn
|
||||||
|
(
|
||||||
|
fvc::div(phiHbyA)
|
||||||
|
+ fvm::div(phid, p)
|
||||||
|
- fvm::laplacian(rhorAUf, p)
|
||||||
|
==
|
||||||
|
fvOptions(psi, p, rho.name())
|
||||||
|
);
|
||||||
|
|
||||||
|
// Relax the pressure equation to ensure diagonal-dominance
|
||||||
|
pEqn.relax();
|
||||||
|
|
||||||
|
pEqn.setReference
|
||||||
|
(
|
||||||
|
pressureControl.refCell(),
|
||||||
|
pressureControl.refValue()
|
||||||
|
);
|
||||||
|
|
||||||
|
pEqn.solve();
|
||||||
|
|
||||||
|
if (simple.finalNonOrthogonalIter())
|
||||||
|
{
|
||||||
|
phi = phiHbyA + pEqn.flux();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
closedVolume = adjustPhi(phiHbyA, U, p);
|
||||||
|
|
||||||
|
if (adjustFringe)
|
||||||
|
{
|
||||||
|
oversetAdjustPhi(phiHbyA, U);
|
||||||
|
}
|
||||||
|
|
||||||
|
while (simple.correctNonOrthogonal())
|
||||||
|
{
|
||||||
|
fvScalarMatrix pEqn
|
||||||
|
(
|
||||||
|
fvc::div(phiHbyA)
|
||||||
|
- fvm::laplacian(rhorAUf, p)
|
||||||
|
==
|
||||||
|
fvOptions(psi, p, rho.name())
|
||||||
|
);
|
||||||
|
|
||||||
|
pEqn.setReference
|
||||||
|
(
|
||||||
|
pressureControl.refCell(),
|
||||||
|
pressureControl.refValue()
|
||||||
|
);
|
||||||
|
|
||||||
|
pEqn.solve();
|
||||||
|
|
||||||
|
if (simple.finalNonOrthogonalIter())
|
||||||
|
{
|
||||||
|
phi = phiHbyA + pEqn.flux();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "incompressible/continuityErrs.H"
|
||||||
|
|
||||||
|
// Explicitly relax pressure for momentum corrector
|
||||||
|
p.relax();
|
||||||
|
|
||||||
|
volVectorField gradP(fvc::grad(p));
|
||||||
|
|
||||||
|
U = HbyA - rAU*cellMask*gradP;
|
||||||
|
U.correctBoundaryConditions();
|
||||||
|
fvOptions.correct(U);
|
||||||
|
|
||||||
|
|
||||||
|
bool pLimited = pressureControl.limit(p);
|
||||||
|
|
||||||
|
// For closed-volume cases adjust the pressure and density levels
|
||||||
|
// to obey overall mass continuity
|
||||||
|
if (closedVolume)
|
||||||
|
{
|
||||||
|
p += (initialMass - fvc::domainIntegrate(psi*p))
|
||||||
|
/fvc::domainIntegrate(psi);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pLimited || closedVolume)
|
||||||
|
{
|
||||||
|
p.correctBoundaryConditions();
|
||||||
|
}
|
||||||
|
|
||||||
|
rho = thermo.rho();
|
||||||
|
|
||||||
|
if (!simple.transonic())
|
||||||
|
{
|
||||||
|
rho.relax();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,92 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2017 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
|
||||||
|
overRhoSimpleFoam
|
||||||
|
|
||||||
|
Group
|
||||||
|
grpCompressibleSolvers
|
||||||
|
|
||||||
|
Description
|
||||||
|
Overset steady-state solver for turbulent flow of compressible fluids.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "fvCFD.H"
|
||||||
|
#include "dynamicFvMesh.H"
|
||||||
|
#include "fluidThermo.H"
|
||||||
|
#include "turbulentFluidThermoModel.H"
|
||||||
|
#include "simpleControl.H"
|
||||||
|
#include "pressureControl.H"
|
||||||
|
#include "fvOptions.H"
|
||||||
|
#include "cellCellStencilObject.H"
|
||||||
|
#include "localMin.H"
|
||||||
|
#include "oversetAdjustPhi.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
#define CREATE_MESH createUpdatedDynamicFvMesh.H
|
||||||
|
#include "postProcess.H"
|
||||||
|
|
||||||
|
#include "setRootCase.H"
|
||||||
|
#include "createTime.H"
|
||||||
|
#include "createUpdatedDynamicFvMesh.H"
|
||||||
|
#include "createControl.H"
|
||||||
|
#include "createFields.H"
|
||||||
|
#include "createFieldRefs.H"
|
||||||
|
#include "createFvOptions.H"
|
||||||
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
|
turbulence->validate();
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
|
while (simple.loop())
|
||||||
|
{
|
||||||
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
|
// Pressure-velocity SIMPLE corrector
|
||||||
|
#include "UEqn.H"
|
||||||
|
#include "EEqn.H"
|
||||||
|
#include "pEqn.H"
|
||||||
|
|
||||||
|
turbulence->correct();
|
||||||
|
|
||||||
|
runTime.write();
|
||||||
|
|
||||||
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
|
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||||
|
<< nl << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -39,6 +39,7 @@ The available solvers are grouped into the following categories:
|
|||||||
- \ref grpLagrangianSolvers
|
- \ref grpLagrangianSolvers
|
||||||
- \ref grpMultiphaseSolvers
|
- \ref grpMultiphaseSolvers
|
||||||
- \ref grpStressAnalysisSolvers
|
- \ref grpStressAnalysisSolvers
|
||||||
|
- \ref grpFiniteAreaSolvers
|
||||||
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -34,4 +34,10 @@ License
|
|||||||
This group contains moving mesh solvers solvers
|
This group contains moving mesh solvers solvers
|
||||||
@}
|
@}
|
||||||
|
|
||||||
|
\defgroup grpFiniteAreaSolvers Finite area solvers
|
||||||
|
@{
|
||||||
|
\ingroup grpSolvers
|
||||||
|
This group contains finite area solvers
|
||||||
|
@}
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|||||||
@ -86,7 +86,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
psi.write();
|
psi.write();
|
||||||
|
|
||||||
if (!args.optionFound("noH") || args.optionFound("HdotGradH"))
|
if (!args.found("noH") || args.found("HdotGradH"))
|
||||||
{
|
{
|
||||||
volVectorField H
|
volVectorField H
|
||||||
(
|
(
|
||||||
@ -99,7 +99,7 @@ int main(int argc, char *argv[])
|
|||||||
fvc::reconstruct(fvc::snGrad(psi)*mesh.magSf())
|
fvc::reconstruct(fvc::snGrad(psi)*mesh.magSf())
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!args.optionFound("noH"))
|
if (!args.found("noH"))
|
||||||
{
|
{
|
||||||
Info<< nl
|
Info<< nl
|
||||||
<< "Creating field H for time "
|
<< "Creating field H for time "
|
||||||
@ -108,7 +108,7 @@ int main(int argc, char *argv[])
|
|||||||
H.write();
|
H.write();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("HdotGradH"))
|
if (args.found("HdotGradH"))
|
||||||
{
|
{
|
||||||
Info<< nl
|
Info<< nl
|
||||||
<< "Creating field HdotGradH for time "
|
<< "Creating field HdotGradH for time "
|
||||||
@ -129,7 +129,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!args.optionFound("noB"))
|
if (!args.found("noB"))
|
||||||
{
|
{
|
||||||
Info<< nl
|
Info<< nl
|
||||||
<< "Creating field B for time "
|
<< "Creating field B for time "
|
||||||
|
|||||||
3
applications/solvers/finiteArea/liquidFilmFoam/Make/files
Executable file
3
applications/solvers/finiteArea/liquidFilmFoam/Make/files
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
liquidFilmFoam.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_APPBIN)/liquidFilmFoam
|
||||||
10
applications/solvers/finiteArea/liquidFilmFoam/Make/options
Executable file
10
applications/solvers/finiteArea/liquidFilmFoam/Make/options
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
|
-I$(LIB_SRC)/cfdTools/general/lnInclude
|
||||||
|
|
||||||
|
EXE_LIBS = \
|
||||||
|
-lfiniteArea \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-lmeshTools
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
// Stabilisation of friction factor calculation
|
||||||
|
// Friction factor is defined with standard gravity
|
||||||
|
frictionFactor.primitiveFieldRef() =
|
||||||
|
mag(2*9.81*sqr(manningField.primitiveField())/
|
||||||
|
pow(mag(h.primitiveField()) + 1e-7, 1.0/3.0));
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
scalar CoNumSigma = max
|
||||||
|
(
|
||||||
|
sqrt
|
||||||
|
(
|
||||||
|
2*M_PI*sigma*sqr(aMesh.edgeInterpolation::deltaCoeffs())
|
||||||
|
*aMesh.edgeInterpolation::deltaCoeffs()
|
||||||
|
/rhol
|
||||||
|
)
|
||||||
|
).value()*runTime.deltaT().value();
|
||||||
|
|
||||||
|
Info<< "Max Capillary Courant Number = " << CoNumSigma << '\n' << endl;
|
||||||
|
}
|
||||||
158
applications/solvers/finiteArea/liquidFilmFoam/createFaFields.H
Normal file
158
applications/solvers/finiteArea/liquidFilmFoam/createFaFields.H
Normal file
@ -0,0 +1,158 @@
|
|||||||
|
Info<< "Reading field h" << endl;
|
||||||
|
areaScalarField h
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"h",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
aMesh
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
Info<< "Reading field Us" << endl;
|
||||||
|
areaVectorField Us
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Us",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
aMesh
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
edgeScalarField phis
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"phis",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
fac::interpolate(Us) & aMesh.Le()
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
edgeScalarField phi2s
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"phi2s",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
fac::interpolate(h*Us) & aMesh.Le()
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
const areaVectorField& Ns = aMesh.faceAreaNormals();
|
||||||
|
areaVectorField Gs(g - Ns*(Ns & g));
|
||||||
|
areaScalarField Gn(mag(g - Gs));
|
||||||
|
|
||||||
|
// Mass source
|
||||||
|
areaScalarField Sm
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Sm",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
aMesh,
|
||||||
|
dimensionedScalar("Sm", dimLength/dimTime, 0)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Mass sink
|
||||||
|
areaScalarField Sd
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Sd",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
aMesh,
|
||||||
|
dimensionedScalar("Sd", dimLength/dimTime, 0)
|
||||||
|
);
|
||||||
|
|
||||||
|
areaVectorField Ug
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Sg",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
aMesh,
|
||||||
|
dimensionedVector("Ug", dimVelocity, vector::zero)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Surface pressure
|
||||||
|
areaScalarField ps
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"ps",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
rhol*Gn*h - sigma*fac::laplacian(h)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Friction factor
|
||||||
|
areaScalarField dotProduct
|
||||||
|
(
|
||||||
|
aMesh.faceAreaNormals() & (g/mag(g))
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< "View factor: min = " << min(dotProduct.internalField())
|
||||||
|
<< " max = " << max(dotProduct.internalField()) << endl;
|
||||||
|
|
||||||
|
areaScalarField manningField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"manningField",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
aMesh
|
||||||
|
);
|
||||||
|
|
||||||
|
areaScalarField frictionFactor
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"frictionFactor",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
aMesh,
|
||||||
|
dimensionedScalar("one", dimless, 0.01)
|
||||||
|
);
|
||||||
|
|
||||||
|
aMesh.setFluxRequired("h");
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
volVectorField U
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"U",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedVector("0", dimVelocity, vector::zero)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
volScalarField H
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"H",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar("0", dimLength, 0)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Create volume-to surface mapping object
|
||||||
|
volSurfaceMapping vsm(aMesh);
|
||||||
160
applications/solvers/finiteArea/liquidFilmFoam/liquidFilmFoam.C
Normal file
160
applications/solvers/finiteArea/liquidFilmFoam/liquidFilmFoam.C
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd |
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
| Copyright (C) 2016-2017 Wikki Ltd
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
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
|
||||||
|
liquidFilmFoam
|
||||||
|
|
||||||
|
Group
|
||||||
|
grpFiniteAreaSolvers
|
||||||
|
|
||||||
|
Description
|
||||||
|
Transient solver for incompressible, laminar flow of Newtonian fluids in
|
||||||
|
liquid film formulation.
|
||||||
|
|
||||||
|
Author
|
||||||
|
Zeljko Tukovic, FMENA
|
||||||
|
Hrvoje Jasak, Wikki Ltd.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "fvCFD.H"
|
||||||
|
#include "faCFD.H"
|
||||||
|
#include "loopControl.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
#include "setRootCase.H"
|
||||||
|
#include "createTime.H"
|
||||||
|
#include "createMesh.H"
|
||||||
|
#include "createFaMesh.H"
|
||||||
|
#include "readGravitationalAcceleration.H"
|
||||||
|
#include "readTransportProperties.H"
|
||||||
|
#include "createFaFields.H"
|
||||||
|
#include "createFvFields.H"
|
||||||
|
#include "createTimeControls.H"
|
||||||
|
|
||||||
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
|
while (runTime.run())
|
||||||
|
{
|
||||||
|
#include "readSolutionControls.H"
|
||||||
|
#include "readTimeControls.H"
|
||||||
|
#include "surfaceCourantNo.H"
|
||||||
|
#include "capillaryCourantNo.H"
|
||||||
|
#include "setDeltaT.H"
|
||||||
|
|
||||||
|
runTime++;
|
||||||
|
|
||||||
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
|
while (iters.loop())
|
||||||
|
{
|
||||||
|
phi2s = fac::interpolate(h)*phis;
|
||||||
|
|
||||||
|
#include "calcFrictionFactor.H"
|
||||||
|
|
||||||
|
faVectorMatrix UsEqn
|
||||||
|
(
|
||||||
|
fam::ddt(h, Us)
|
||||||
|
+ fam::div(phi2s, Us)
|
||||||
|
+ fam::Sp(0.0125*frictionFactor*mag(Us), Us)
|
||||||
|
==
|
||||||
|
Gs*h
|
||||||
|
- fam::Sp(Sd, Us)
|
||||||
|
);
|
||||||
|
|
||||||
|
UsEqn.relax();
|
||||||
|
solve(UsEqn == - fac::grad(ps*h)/rhol + ps*fac::grad(h)/rhol);
|
||||||
|
|
||||||
|
areaScalarField UsA(UsEqn.A());
|
||||||
|
|
||||||
|
Us = UsEqn.H()/UsA;
|
||||||
|
Us.correctBoundaryConditions();
|
||||||
|
|
||||||
|
phis =
|
||||||
|
(fac::interpolate(Us) & aMesh.Le())
|
||||||
|
- fac::interpolate(1.0/(rhol*UsA))*fac::lnGrad(ps*h)*aMesh.magLe()
|
||||||
|
+ fac::interpolate(ps/(rhol*UsA))*fac::lnGrad(h)*aMesh.magLe();
|
||||||
|
|
||||||
|
faScalarMatrix hEqn
|
||||||
|
(
|
||||||
|
fam::ddt(h)
|
||||||
|
+ fam::div(phis, h)
|
||||||
|
==
|
||||||
|
Sm
|
||||||
|
- fam::Sp
|
||||||
|
(
|
||||||
|
Sd/(h + dimensionedScalar("small", dimLength, SMALL)),
|
||||||
|
h
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
hEqn.relax();
|
||||||
|
hEqn.solve();
|
||||||
|
|
||||||
|
phi2s = hEqn.flux();
|
||||||
|
|
||||||
|
// Bound h
|
||||||
|
h.primitiveFieldRef() = max
|
||||||
|
(
|
||||||
|
max
|
||||||
|
(
|
||||||
|
h.primitiveField(),
|
||||||
|
fac::average(max(h, h0))().primitiveField()
|
||||||
|
*pos(h0.value() - h.primitiveField())
|
||||||
|
),
|
||||||
|
h0.value()
|
||||||
|
);
|
||||||
|
|
||||||
|
ps = rhol*Gn*h - sigma*fac::laplacian(h);
|
||||||
|
ps.correctBoundaryConditions();
|
||||||
|
|
||||||
|
Us -= (1.0/(rhol*UsA))*fac::grad(ps*h)
|
||||||
|
- (ps/(rhol*UsA))*fac::grad(h);
|
||||||
|
Us.correctBoundaryConditions();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (runTime.outputTime())
|
||||||
|
{
|
||||||
|
vsm.mapToVolume(h, H.boundaryFieldRef());
|
||||||
|
vsm.mapToVolume(Us, U.boundaryFieldRef());
|
||||||
|
|
||||||
|
runTime.write();
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
|
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||||
|
<< nl << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1 @@
|
|||||||
|
loopControl iters(runTime, aMesh.solutionDict(), "solution");
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
IOdictionary transportProperties
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"transportProperties",
|
||||||
|
runTime.constant(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
dimensionedScalar mug
|
||||||
|
(
|
||||||
|
transportProperties.lookup("mug")
|
||||||
|
);
|
||||||
|
|
||||||
|
dimensionedScalar mul
|
||||||
|
(
|
||||||
|
transportProperties.lookup("mul")
|
||||||
|
);
|
||||||
|
|
||||||
|
dimensionedScalar sigma
|
||||||
|
(
|
||||||
|
transportProperties.lookup("sigma")
|
||||||
|
);
|
||||||
|
|
||||||
|
dimensionedScalar rhol
|
||||||
|
(
|
||||||
|
transportProperties.lookup("rhol")
|
||||||
|
);
|
||||||
|
|
||||||
|
dimensionedScalar rhog
|
||||||
|
(
|
||||||
|
transportProperties.lookup("rhog")
|
||||||
|
);
|
||||||
|
|
||||||
|
dimensionedScalar h0
|
||||||
|
(
|
||||||
|
transportProperties.lookup("h0")
|
||||||
|
);
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd |
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
| Copyright (C) 2016-2017 Wikki Ltd
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
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
|
||||||
|
surfaceCourantNo
|
||||||
|
|
||||||
|
Author
|
||||||
|
Hrvoje Jasak, Wikki Ltd.
|
||||||
|
|
||||||
|
Description
|
||||||
|
Calculates and outputs the mean and maximum Courant Numbers for the
|
||||||
|
Finite Area method.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
scalar CoNum = 0.0;
|
||||||
|
scalar meanCoNum = 0.0;
|
||||||
|
scalar velMag = 0.0;
|
||||||
|
|
||||||
|
if (aMesh.nInternalEdges())
|
||||||
|
{
|
||||||
|
edgeScalarField SfUfbyDelta
|
||||||
|
(
|
||||||
|
aMesh.edgeInterpolation::deltaCoeffs()*mag(phis)
|
||||||
|
);
|
||||||
|
|
||||||
|
CoNum = max(SfUfbyDelta/aMesh.magLe())
|
||||||
|
.value()*runTime.deltaT().value();
|
||||||
|
|
||||||
|
meanCoNum = (sum(SfUfbyDelta)/sum(aMesh.magLe()))
|
||||||
|
.value()*runTime.deltaT().value();
|
||||||
|
|
||||||
|
velMag = max(mag(phis)/aMesh.magLe()).value();
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Courant Number mean: " << meanCoNum
|
||||||
|
<< " max: " << CoNum
|
||||||
|
<< " velocity magnitude: " << velMag << endl;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
surfactantFoam.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_APPBIN)/sphereSurfactantFoam
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
|
-I$(LIB_SRC)/cfdTools/general/lnInclude
|
||||||
|
|
||||||
|
EXE_LIBS = \
|
||||||
|
-lfiniteArea \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-lmeshTools
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
Info<< "Reading field Cs" << endl;
|
||||||
|
areaScalarField Cs
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Cs",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
aMesh
|
||||||
|
);
|
||||||
|
|
||||||
|
dimensioned<scalar> Cs0
|
||||||
|
(
|
||||||
|
"Cs0",
|
||||||
|
dimensionSet(1, -2, 0, 0, 0, 0, 0),
|
||||||
|
1.0
|
||||||
|
);
|
||||||
|
|
||||||
|
const areaVectorField& R = aMesh.areaCentres();
|
||||||
|
|
||||||
|
Cs = Cs0*(1.0 + R.component(vector::X)/mag(R));
|
||||||
|
|
||||||
|
|
||||||
|
dimensioned<scalar> Ds
|
||||||
|
(
|
||||||
|
"Ds",
|
||||||
|
dimensionSet(0, 2, -1, 0, 0, 0, 0),
|
||||||
|
1.0
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
areaVectorField Us
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Us",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
aMesh,
|
||||||
|
dimensioned<vector>("Us", dimVelocity, vector::zero)
|
||||||
|
);
|
||||||
|
|
||||||
|
dimensioned<scalar> Uinf("Uinf", dimVelocity, 1.0);
|
||||||
|
|
||||||
|
forAll (Us, faceI)
|
||||||
|
{
|
||||||
|
Us[faceI].x() =
|
||||||
|
Uinf.value()*(0.25*(3.0 + sqr(R[faceI].x()/mag(R[faceI]))) - 1.0);
|
||||||
|
|
||||||
|
Us[faceI].y() =
|
||||||
|
Uinf.value()*0.25*R[faceI].x()*R[faceI].y()/sqr(mag(R[faceI]));
|
||||||
|
|
||||||
|
Us[faceI].z() =
|
||||||
|
Uinf.value()*0.25*R[faceI].x()*R[faceI].z()/sqr(mag(R[faceI]));
|
||||||
|
}
|
||||||
|
|
||||||
|
Us -= aMesh.faceAreaNormals()*(aMesh.faceAreaNormals() & Us);
|
||||||
|
|
||||||
|
|
||||||
|
edgeScalarField phis
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"phis",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
linearEdgeInterpolate(Us) & aMesh.Le()
|
||||||
|
);
|
||||||
|
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
// Create Finite Area mesh
|
||||||
|
faMesh aMesh(mesh);
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
// Create volume-to surface mapping object
|
||||||
|
volSurfaceMapping vsm(aMesh);
|
||||||
|
|
||||||
|
volScalarField Cvf
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Cvf",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar("0", dimless/dimLength, 0)
|
||||||
|
);
|
||||||
|
|
||||||
|
vsm.mapToVolume(Cs, Cvf.boundaryFieldRef());
|
||||||
|
Cvf.write();
|
||||||
|
|
||||||
|
volVectorField U
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"U",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedVector("zero", dimVelocity, vector::zero)
|
||||||
|
);
|
||||||
|
|
||||||
|
vsm.mapToVolume(Us, U.boundaryFieldRef());
|
||||||
|
U.write();
|
||||||
@ -0,0 +1,91 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd |
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
| Copyright (C) 2016-2017 Wikki Ltd
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
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
|
||||||
|
surfactantFoam for sphere transport
|
||||||
|
|
||||||
|
Group
|
||||||
|
grpFiniteAreaSolvers
|
||||||
|
|
||||||
|
Description
|
||||||
|
Passive scalar transport equation solver on a sphere
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "fvCFD.H"
|
||||||
|
#include "faCFD.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
#include "setRootCase.H"
|
||||||
|
#include "createTime.H"
|
||||||
|
#include "createMesh.H"
|
||||||
|
|
||||||
|
#include "createFaMesh.H"
|
||||||
|
#include "createFaFields.H"
|
||||||
|
#include "createVolFields.H"
|
||||||
|
|
||||||
|
Info<< "Total mass of surfactant: "
|
||||||
|
<< sum(Cs.internalField()*aMesh.S()) << endl;
|
||||||
|
|
||||||
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
|
while (runTime.loop())
|
||||||
|
{
|
||||||
|
Info<< "Time = " << runTime.value() << endl;
|
||||||
|
|
||||||
|
faScalarMatrix CsEqn
|
||||||
|
(
|
||||||
|
fam::ddt(Cs)
|
||||||
|
+ fam::div(phis, Cs)
|
||||||
|
- fam::laplacian(Ds, Cs)
|
||||||
|
);
|
||||||
|
|
||||||
|
CsEqn.solve();
|
||||||
|
|
||||||
|
if (runTime.writeTime())
|
||||||
|
{
|
||||||
|
vsm.mapToVolume(Cs, Cvf.boundaryFieldRef());
|
||||||
|
|
||||||
|
runTime.write();
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Total mass of surfactant: "
|
||||||
|
<< sum(Cs.internalField()*aMesh.S()) << endl;
|
||||||
|
|
||||||
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
|
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||||
|
<< nl << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
surfactantFoam.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_APPBIN)/surfactantFoam
|
||||||
10
applications/solvers/finiteArea/surfactantFoam/Make/options
Normal file
10
applications/solvers/finiteArea/surfactantFoam/Make/options
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
|
-I$(LIB_SRC)/cfdTools/general/lnInclude
|
||||||
|
|
||||||
|
EXE_LIBS = \
|
||||||
|
-lfiniteArea \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-lmeshTools
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
Info<< "Reading field Cs" << endl;
|
||||||
|
areaScalarField Cs
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Cs",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
aMesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< "Reading transportProperties\n" << endl;
|
||||||
|
|
||||||
|
IOdictionary transportProperties
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"transportProperties",
|
||||||
|
runTime.constant(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
Info<< "Reading diffusivity D\n" << endl;
|
||||||
|
|
||||||
|
dimensionedScalar Ds
|
||||||
|
(
|
||||||
|
transportProperties.lookup("Ds")
|
||||||
|
);
|
||||||
|
|
||||||
|
areaVectorField Us
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Us",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
aMesh
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
edgeScalarField phis
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"phis",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
linearEdgeInterpolate(Us) & aMesh.Le()
|
||||||
|
);
|
||||||
|
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
// Create Finite Area mesh
|
||||||
|
faMesh aMesh(mesh);
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
// Create volume-to surface mapping object
|
||||||
|
volSurfaceMapping vsm(aMesh);
|
||||||
|
|
||||||
|
volScalarField Cvf
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Cvf",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar("0", dimless/dimLength, 0)
|
||||||
|
);
|
||||||
|
|
||||||
|
vsm.mapToVolume(Cs, Cvf.boundaryFieldRef());
|
||||||
|
Cvf.write();
|
||||||
|
|
||||||
|
volVectorField U
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"U",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedVector("zero", dimVelocity, vector::zero)
|
||||||
|
);
|
||||||
|
|
||||||
|
vsm.mapToVolume(Us, U.boundaryFieldRef());
|
||||||
|
U.write();
|
||||||
114
applications/solvers/finiteArea/surfactantFoam/surfactantFoam.C
Normal file
114
applications/solvers/finiteArea/surfactantFoam/surfactantFoam.C
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd |
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
| Copyright (C) 2016-2017 Wikki Ltd
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
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
|
||||||
|
surfactantFoam
|
||||||
|
|
||||||
|
Group
|
||||||
|
grpFiniteAreaSolvers
|
||||||
|
|
||||||
|
Description
|
||||||
|
Passive scalar transport equation solver.
|
||||||
|
|
||||||
|
\heading Solver details
|
||||||
|
The equation is given by:
|
||||||
|
|
||||||
|
\f[
|
||||||
|
\ddt{Cs} + \div \left(\vec{U} Cs\right) - \div \left(D_T \grad Cs \right)
|
||||||
|
= 0
|
||||||
|
\f]
|
||||||
|
|
||||||
|
Where:
|
||||||
|
\vartable
|
||||||
|
Cs | Passive scalar
|
||||||
|
Ds | Diffusion coefficient
|
||||||
|
\endvartable
|
||||||
|
|
||||||
|
\heading Required fields
|
||||||
|
\plaintable
|
||||||
|
Cs | Passive scalar
|
||||||
|
Us | Velocity [m/s]
|
||||||
|
\endplaintable
|
||||||
|
|
||||||
|
Author
|
||||||
|
Zeljko Tukovic, FMENA
|
||||||
|
Hrvoje Jasak, Wikki Ltd.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "fvCFD.H"
|
||||||
|
#include "faCFD.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
#include "setRootCase.H"
|
||||||
|
#include "createTime.H"
|
||||||
|
#include "createMesh.H"
|
||||||
|
#include "createFaMesh.H"
|
||||||
|
#include "createFaFields.H"
|
||||||
|
#include "createVolFields.H"
|
||||||
|
|
||||||
|
Info<< "Total mass of surfactant: "
|
||||||
|
<< sum(Cs.internalField()*aMesh.S()) << endl;
|
||||||
|
|
||||||
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
|
while (runTime.loop())
|
||||||
|
{
|
||||||
|
Info<< "Time = " << runTime.value() << endl;
|
||||||
|
|
||||||
|
faScalarMatrix CsEqn
|
||||||
|
(
|
||||||
|
fam::ddt(Cs)
|
||||||
|
+ fam::div(phis, Cs)
|
||||||
|
- fam::laplacian(Ds, Cs)
|
||||||
|
);
|
||||||
|
|
||||||
|
CsEqn.solve();
|
||||||
|
|
||||||
|
if (runTime.writeTime())
|
||||||
|
{
|
||||||
|
vsm.mapToVolume(Cs, Cvf.boundaryFieldRef());
|
||||||
|
|
||||||
|
runTime.write();
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Total mass of surfactant: "
|
||||||
|
<< sum(Cs.internalField()*aMesh.S()) << endl;
|
||||||
|
|
||||||
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
|
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||||
|
<< nl << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -47,6 +47,7 @@ Description
|
|||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
#include "fvOptions.H"
|
#include "fvOptions.H"
|
||||||
#include "coordinateSystem.H"
|
#include "coordinateSystem.H"
|
||||||
|
#include "loopControl.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -89,11 +90,10 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// --- PIMPLE loop
|
// --- PIMPLE loop
|
||||||
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
|
for (int oCorr=0; oCorr<nOuterCorr; ++oCorr)
|
||||||
{
|
{
|
||||||
bool finalIter = oCorr == nOuterCorr-1;
|
const bool finalIter = (oCorr == nOuterCorr-1);
|
||||||
|
|
||||||
forAll(fluidRegions, i)
|
forAll(fluidRegions, i)
|
||||||
{
|
{
|
||||||
@ -113,6 +113,35 @@ int main(int argc, char *argv[])
|
|||||||
#include "solveSolid.H"
|
#include "solveSolid.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Additional loops for energy solution only
|
||||||
|
if (!oCorr && nOuterCorr > 1)
|
||||||
|
{
|
||||||
|
loopControl looping(runTime, pimple, "energyCoupling");
|
||||||
|
|
||||||
|
while (looping.loop())
|
||||||
|
{
|
||||||
|
Info<< nl << looping << nl;
|
||||||
|
|
||||||
|
forAll(fluidRegions, i)
|
||||||
|
{
|
||||||
|
Info<< "\nSolving for fluid region "
|
||||||
|
<< fluidRegions[i].name() << endl;
|
||||||
|
#include "setRegionFluidFields.H"
|
||||||
|
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||||
|
frozenFlow = true;
|
||||||
|
#include "solveFluid.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(solidRegions, i)
|
||||||
|
{
|
||||||
|
Info<< "\nSolving for solid region "
|
||||||
|
<< solidRegions[i].name() << endl;
|
||||||
|
#include "setRegionSolidFields.H"
|
||||||
|
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||||
|
#include "solveSolid.H"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -42,6 +42,7 @@ Description
|
|||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
#include "fvOptions.H"
|
#include "fvOptions.H"
|
||||||
#include "coordinateSystem.H"
|
#include "coordinateSystem.H"
|
||||||
|
#include "loopControl.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -57,7 +58,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
|
|
||||||
while (runTime.loop())
|
while (runTime.loop())
|
||||||
{
|
{
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
@ -80,6 +80,35 @@ int main(int argc, char *argv[])
|
|||||||
#include "solveSolid.H"
|
#include "solveSolid.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Additional loops for energy solution only
|
||||||
|
{
|
||||||
|
loopControl looping(runTime, "SIMPLE", "energyCoupling");
|
||||||
|
|
||||||
|
while (looping.loop())
|
||||||
|
{
|
||||||
|
Info<< nl << looping << nl;
|
||||||
|
|
||||||
|
forAll(fluidRegions, i)
|
||||||
|
{
|
||||||
|
Info<< "\nSolving for fluid region "
|
||||||
|
<< fluidRegions[i].name() << endl;
|
||||||
|
#include "setRegionFluidFields.H"
|
||||||
|
#include "readFluidMultiRegionSIMPLEControls.H"
|
||||||
|
frozenFlow = true;
|
||||||
|
#include "solveFluid.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(solidRegions, i)
|
||||||
|
{
|
||||||
|
Info<< "\nSolving for solid region "
|
||||||
|
<< solidRegions[i].name() << endl;
|
||||||
|
#include "setRegionSolidFields.H"
|
||||||
|
#include "readSolidMultiRegionSIMPLEControls.H"
|
||||||
|
#include "solveSolid.H"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
|
|
||||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
|
|||||||
@ -16,17 +16,20 @@
|
|||||||
|
|
||||||
fvOptions.constrain(UEqn);
|
fvOptions.constrain(UEqn);
|
||||||
|
|
||||||
solve
|
if (momentumPredictor)
|
||||||
(
|
{
|
||||||
UEqn
|
solve
|
||||||
==
|
|
||||||
fvc::reconstruct
|
|
||||||
(
|
(
|
||||||
|
UEqn
|
||||||
|
==
|
||||||
|
fvc::reconstruct
|
||||||
(
|
(
|
||||||
- ghf*fvc::snGrad(rho)
|
(
|
||||||
- fvc::snGrad(p_rgh)
|
- ghf*fvc::snGrad(rho)
|
||||||
)*mesh.magSf()
|
- fvc::snGrad(p_rgh)
|
||||||
)
|
)*mesh.magSf()
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
|
}
|
||||||
|
|||||||
@ -2,3 +2,6 @@
|
|||||||
|
|
||||||
const int nNonOrthCorr =
|
const int nNonOrthCorr =
|
||||||
simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
|
simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
|
||||||
|
|
||||||
|
const bool momentumPredictor =
|
||||||
|
simple.lookupOrDefault("momentumPredictor", true);
|
||||||
|
|||||||
@ -12,6 +12,14 @@
|
|||||||
volScalarField& p = thermo.p();
|
volScalarField& p = thermo.p();
|
||||||
const volScalarField& psi = thermo.psi();
|
const volScalarField& psi = thermo.psi();
|
||||||
|
|
||||||
|
volScalarField& p_rgh = p_rghFluid[i];
|
||||||
|
|
||||||
|
const dimensionedVector& g = gFluid[i];
|
||||||
|
const volScalarField& gh = ghFluid[i];
|
||||||
|
const surfaceScalarField& ghf = ghfFluid[i];
|
||||||
|
|
||||||
|
radiation::radiationModel& rad = radiation[i];
|
||||||
|
|
||||||
IOMRFZoneList& MRF = MRFfluid[i];
|
IOMRFZoneList& MRF = MRFfluid[i];
|
||||||
fv::options& fvOptions = fluidFvOptions[i];
|
fv::options& fvOptions = fluidFvOptions[i];
|
||||||
|
|
||||||
@ -22,14 +30,7 @@
|
|||||||
initialMassFluid[i]
|
initialMassFluid[i]
|
||||||
);
|
);
|
||||||
|
|
||||||
radiation::radiationModel& rad = radiation[i];
|
bool frozenFlow = frozenFlowFluid[i];
|
||||||
|
|
||||||
const label pRefCell = pRefCellFluid[i];
|
const label pRefCell = pRefCellFluid[i];
|
||||||
const scalar pRefValue = pRefValueFluid[i];
|
const scalar pRefValue = pRefValueFluid[i];
|
||||||
const bool frozenFlow = frozenFlowFluid[i];
|
|
||||||
|
|
||||||
volScalarField& p_rgh = p_rghFluid[i];
|
|
||||||
|
|
||||||
const dimensionedVector& g = gFluid[i];
|
|
||||||
const volScalarField& gh = ghFluid[i];
|
|
||||||
const surfaceScalarField& ghf = ghfFluid[i];
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; ++nonOrth)
|
||||||
{
|
{
|
||||||
fvScalarMatrix hEqn
|
fvScalarMatrix hEqn
|
||||||
(
|
(
|
||||||
@ -20,9 +20,9 @@
|
|||||||
|
|
||||||
fvOptions.correct(h);
|
fvOptions.correct(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
thermo.correct();
|
||||||
|
|
||||||
|
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
|
||||||
|
<< max(thermo.T()).value() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
thermo.correct();
|
|
||||||
|
|
||||||
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
|
|
||||||
<< max(thermo.T()).value() << endl;
|
|
||||||
|
|||||||
@ -19,8 +19,8 @@ List<bool> frozenFlowFluid(fluidRegions.size(), false);
|
|||||||
PtrList<IOMRFZoneList> MRFfluid(fluidRegions.size());
|
PtrList<IOMRFZoneList> MRFfluid(fluidRegions.size());
|
||||||
PtrList<fv::options> fluidFvOptions(fluidRegions.size());
|
PtrList<fv::options> fluidFvOptions(fluidRegions.size());
|
||||||
|
|
||||||
List<label> refCellFluid(fluidRegions.size());
|
List<label> pRefCellFluid(fluidRegions.size());
|
||||||
List<scalar> refValueFluid(fluidRegions.size());
|
List<scalar> pRefValueFluid(fluidRegions.size());
|
||||||
|
|
||||||
// Populate fluid field pointer lists
|
// Populate fluid field pointer lists
|
||||||
forAll(fluidRegions, i)
|
forAll(fluidRegions, i)
|
||||||
@ -252,8 +252,8 @@ forAll(fluidRegions, i)
|
|||||||
|
|
||||||
turbulence[i].validate();
|
turbulence[i].validate();
|
||||||
|
|
||||||
refCellFluid[i] = 0;
|
pRefCellFluid[i] = 0;
|
||||||
refValueFluid[i] = 0.0;
|
pRefValueFluid[i] = 0.0;
|
||||||
|
|
||||||
if (p_rghFluid[i].needReference())
|
if (p_rghFluid[i].needReference())
|
||||||
{
|
{
|
||||||
@ -262,8 +262,8 @@ forAll(fluidRegions, i)
|
|||||||
thermoFluid[i].p(),
|
thermoFluid[i].p(),
|
||||||
p_rghFluid[i],
|
p_rghFluid[i],
|
||||||
pimpleDict,
|
pimpleDict,
|
||||||
refCellFluid[i],
|
pRefCellFluid[i],
|
||||||
refValueFluid[i]
|
pRefValueFluid[i]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,8 @@
|
|||||||
initialMassFluid[i]
|
initialMassFluid[i]
|
||||||
);
|
);
|
||||||
|
|
||||||
const bool frozenFlow = frozenFlowFluid[i];
|
bool frozenFlow = frozenFlowFluid[i];
|
||||||
|
|
||||||
|
const label pRefCell = pRefCellFluid[i];
|
||||||
|
const scalar pRefValue = pRefValueFluid[i];
|
||||||
|
|
||||||
const label pRefCell = refCellFluid[i];
|
|
||||||
const scalar pRefValue = refValueFluid[i];
|
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
const wordList solidsNames(rp["solid"]);
|
const wordList solidNames(rp["solid"]);
|
||||||
|
|
||||||
PtrList<fvMesh> solidRegions(solidsNames.size());
|
PtrList<fvMesh> solidRegions(solidNames.size());
|
||||||
|
|
||||||
forAll(solidsNames, i)
|
forAll(solidNames, i)
|
||||||
{
|
{
|
||||||
Info<< "Create solid mesh for region " << solidsNames[i]
|
Info<< "Create solid mesh for region " << solidNames[i]
|
||||||
<< " for time = " << runTime.timeName() << nl << endl;
|
<< " for time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
solidRegions.set
|
solidRegions.set
|
||||||
@ -14,7 +14,7 @@
|
|||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
solidsNames[i],
|
solidNames[i],
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
runTime,
|
runTime,
|
||||||
IOobject::MUST_READ
|
IOobject::MUST_READ
|
||||||
|
|||||||
@ -27,8 +27,8 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef solidRegionDiff_H
|
#ifndef solidRegionDiffNo_H
|
||||||
#define solidRegionDiff_H
|
#define solidRegionDiffNo_H
|
||||||
|
|
||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ if (finalIter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; ++nonOrth)
|
||||||
{
|
{
|
||||||
fvScalarMatrix hEqn
|
fvScalarMatrix hEqn
|
||||||
(
|
(
|
||||||
@ -26,13 +26,13 @@ if (finalIter)
|
|||||||
|
|
||||||
fvOptions.correct(h);
|
fvOptions.correct(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
thermo.correct();
|
||||||
|
|
||||||
|
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
|
||||||
|
<< max(thermo.T()).value() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
thermo.correct();
|
|
||||||
|
|
||||||
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
|
|
||||||
<< max(thermo.T()).value() << endl;
|
|
||||||
|
|
||||||
if (finalIter)
|
if (finalIter)
|
||||||
{
|
{
|
||||||
mesh.data::remove("finalIteration");
|
mesh.data::remove("finalIteration");
|
||||||
|
|||||||
@ -15,12 +15,16 @@
|
|||||||
)
|
)
|
||||||
: -dpdt
|
: -dpdt
|
||||||
)
|
)
|
||||||
- fvm::laplacian(alphaEff, he)
|
|
||||||
==
|
==
|
||||||
radiation->Sh(thermo, he)
|
radiation->Sh(thermo, he)
|
||||||
+ fvOptions(rho, he)
|
+ fvOptions(rho, he)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (turbulence.valid())
|
||||||
|
{
|
||||||
|
EEqn -= fvm::laplacian(turbulence->alphaEff(), he);
|
||||||
|
}
|
||||||
|
|
||||||
EEqn.relax();
|
EEqn.relax();
|
||||||
|
|
||||||
fvOptions.constrain(EEqn);
|
fvOptions.constrain(EEqn);
|
||||||
|
|||||||
@ -35,7 +35,31 @@ volVectorField U
|
|||||||
|
|
||||||
#include "compressibleCreatePhi.H"
|
#include "compressibleCreatePhi.H"
|
||||||
|
|
||||||
#include "setAlphaEff.H"
|
autoPtr<compressible::turbulenceModel> turbulence;
|
||||||
|
|
||||||
|
IOobject turbulencePropertiesHeader
|
||||||
|
(
|
||||||
|
"turbulenceProperties",
|
||||||
|
runTime.constant(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
if (turbulencePropertiesHeader.typeHeaderOk<IOdictionary>(false))
|
||||||
|
{
|
||||||
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
|
|
||||||
|
turbulence =
|
||||||
|
compressible::turbulenceModel::New
|
||||||
|
(
|
||||||
|
rho,
|
||||||
|
U,
|
||||||
|
phi,
|
||||||
|
thermo
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#include "createDpdt.H"
|
#include "createDpdt.H"
|
||||||
|
|
||||||
|
|||||||
@ -1,47 +0,0 @@
|
|||||||
Info<< "Creating turbulence model\n" << endl;
|
|
||||||
tmp<volScalarField> talphaEff;
|
|
||||||
|
|
||||||
IOobject turbulencePropertiesHeader
|
|
||||||
(
|
|
||||||
"turbulenceProperties",
|
|
||||||
runTime.constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
if (turbulencePropertiesHeader.typeHeaderOk<IOdictionary>(true))
|
|
||||||
{
|
|
||||||
autoPtr<compressible::turbulenceModel> turbulence
|
|
||||||
(
|
|
||||||
compressible::turbulenceModel::New
|
|
||||||
(
|
|
||||||
rho,
|
|
||||||
U,
|
|
||||||
phi,
|
|
||||||
thermo
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
talphaEff = turbulence->alphaEff();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
talphaEff = tmp<volScalarField>
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"alphaEff",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("0", dimMass/dimLength/dimTime, 0.0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -54,8 +54,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createFvOptions.H"
|
#include "createFvOptions.H"
|
||||||
|
|
||||||
const volScalarField& alphaEff = talphaEff();
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nEvolving thermodynamics\n" << endl;
|
Info<< "\nEvolving thermodynamics\n" << endl;
|
||||||
|
|||||||
@ -101,7 +101,7 @@ if (mesh.changing())
|
|||||||
pcorrEqn.setReferences
|
pcorrEqn.setReferences
|
||||||
(
|
(
|
||||||
validCells,
|
validCells,
|
||||||
scalarList(validCells.size(), 0.0),
|
scalar(0.0),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,7 +20,7 @@ surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
|
|||||||
surfaceScalarField rAUf("rAUf", faceMask*fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", faceMask*fvc::interpolate(rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = constrainHbyA(rAU*UEqn.H(), U, p);
|
HbyA = constrainHbyA(cellMask*rAU*UEqn.H(), U, p);
|
||||||
|
|
||||||
//mesh.interpolate(HbyA);
|
//mesh.interpolate(HbyA);
|
||||||
if (massFluxInterpolation)
|
if (massFluxInterpolation)
|
||||||
|
|||||||
@ -54,10 +54,8 @@ Description
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::addNote
|
#include "postProcess.H"
|
||||||
(
|
|
||||||
"Experimental version of pimpleDyMFoam with support for overset meshes"
|
|
||||||
);
|
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createDynamicFvMesh.H"
|
#include "createDynamicFvMesh.H"
|
||||||
|
|||||||
@ -16,6 +16,9 @@
|
|||||||
|
|
||||||
fvOptions.constrain(UEqn);
|
fvOptions.constrain(UEqn);
|
||||||
|
|
||||||
solve(UEqn == -cellMask*fvc::grad(p));
|
if (simple.momentumPredictor())
|
||||||
|
{
|
||||||
|
solve(UEqn == -cellMask*fvc::grad(p));
|
||||||
|
}
|
||||||
|
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
surfaceScalarField rAUf("rAUf", faceMask*fvc::interpolate(rAU));
|
surfaceScalarField rAUf("rAUf", faceMask*fvc::interpolate(rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = constrainHbyA(rAU*UEqn.H(), U, p);
|
HbyA = constrainHbyA(cellMask*rAU*UEqn.H(), U, p);
|
||||||
|
|
||||||
//mesh.interpolate(HbyA);
|
//mesh.interpolate(HbyA);
|
||||||
if (massFluxInterpolation)
|
if (massFluxInterpolation)
|
||||||
|
|||||||
@ -123,7 +123,7 @@ volScalarField alphac
|
|||||||
);
|
);
|
||||||
|
|
||||||
word kinematicCloudName("kinematicCloud");
|
word kinematicCloudName("kinematicCloud");
|
||||||
args.optionReadIfPresent("cloud", kinematicCloudName);
|
args.readIfPresent("cloud", kinematicCloudName);
|
||||||
|
|
||||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||||
basicKinematicTypeCloud kinematicCloud
|
basicKinematicTypeCloud kinematicCloud
|
||||||
|
|||||||
@ -58,7 +58,7 @@ volScalarField mu
|
|||||||
);
|
);
|
||||||
|
|
||||||
word kinematicCloudName("kinematicCloud");
|
word kinematicCloudName("kinematicCloud");
|
||||||
args.optionReadIfPresent("cloud", kinematicCloudName);
|
args.readIfPresent("cloud", kinematicCloudName);
|
||||||
|
|
||||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||||
basicKinematicCollidingCloud kinematicCloud
|
basicKinematicCollidingCloud kinematicCloud
|
||||||
|
|||||||
@ -114,7 +114,7 @@ volScalarField Qdot
|
|||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar("Qdot", dimEnergy/dimTime, 0.0)
|
dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0)
|
||||||
);
|
);
|
||||||
|
|
||||||
#include "createMRF.H"
|
#include "createMRF.H"
|
||||||
|
|||||||
@ -51,7 +51,7 @@ autoPtr<compressible::turbulenceModel> turbulence
|
|||||||
|
|
||||||
const word kinematicCloudName
|
const word kinematicCloudName
|
||||||
(
|
(
|
||||||
args.optionLookupOrDefault<word>("cloud", "kinematicCloud")
|
args.lookupOrDefault<word>("cloud", "kinematicCloud")
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||||
|
|||||||
@ -0,0 +1,43 @@
|
|||||||
|
volScalarField::Internal Sp
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Sp",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar("Sp", dgdt.dimensions(), 0)
|
||||||
|
);
|
||||||
|
|
||||||
|
volScalarField::Internal Su
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Su",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar("Su", dgdt.dimensions(), 0)
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(dgdt, celli)
|
||||||
|
{
|
||||||
|
if (dgdt[celli] > 0.0 && alpha1[celli] > 0.0)
|
||||||
|
{
|
||||||
|
Sp[celli] -= dgdt[celli]*alpha1[celli];
|
||||||
|
Su[celli] += dgdt[celli]*alpha1[celli];
|
||||||
|
}
|
||||||
|
else if (dgdt[celli] < 0.0 && alpha1[celli] < 1.0)
|
||||||
|
{
|
||||||
|
Sp[celli] += dgdt[celli]*(1.0 - alpha1[celli]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
volScalarField::Internal divU
|
||||||
|
(
|
||||||
|
mesh.moving()
|
||||||
|
? fvc::div(phiCN() + mesh.phi())
|
||||||
|
: fvc::div(phiCN())
|
||||||
|
);
|
||||||
@ -56,29 +56,13 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#include "rhofs.H"
|
p_rghEqnComp1 =
|
||||||
|
fvc::ddt(rho1) + psi1*correction(fvm::ddt(p_rgh))
|
||||||
p_rghEqnComp1 =
|
+ fvc::div(phi, rho1) - fvc::Sp(fvc::div(phi), rho1);
|
||||||
pos(alpha1)
|
|
||||||
*(
|
|
||||||
(
|
|
||||||
fvc::ddt(alpha1, rho1) + fvc::div(alphaPhi1*rho1f)
|
|
||||||
- (fvOptions(alpha1, mixture.thermo1().rho())&rho1)
|
|
||||||
)/rho1
|
|
||||||
- fvc::ddt(alpha1) - fvc::div(alphaPhi1)
|
|
||||||
+ (alpha1*psi1/rho1)*correction(fvm::ddt(p_rgh))
|
|
||||||
);
|
|
||||||
|
|
||||||
p_rghEqnComp2 =
|
p_rghEqnComp2 =
|
||||||
pos(alpha2)
|
fvc::ddt(rho2) + psi2*correction(fvm::ddt(p_rgh))
|
||||||
*(
|
+ fvc::div(phi, rho2) - fvc::Sp(fvc::div(phi), rho2);
|
||||||
(
|
|
||||||
fvc::ddt(alpha2, rho2) + fvc::div(alphaPhi2*rho2f)
|
|
||||||
- (fvOptions(alpha2, mixture.thermo2().rho())&rho2)
|
|
||||||
)/rho2
|
|
||||||
- fvc::ddt(alpha2) - fvc::div(alphaPhi2)
|
|
||||||
+ (alpha2*psi2/rho2)*correction(fvm::ddt(p_rgh))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cache p_rgh prior to solve for density update
|
// Cache p_rgh prior to solve for density update
|
||||||
@ -94,7 +78,11 @@
|
|||||||
|
|
||||||
solve
|
solve
|
||||||
(
|
(
|
||||||
p_rghEqnComp1() + p_rghEqnComp2() + p_rghEqnIncomp,
|
(
|
||||||
|
(max(alpha1, scalar(0))/rho1)*p_rghEqnComp1()
|
||||||
|
+ (max(alpha2, scalar(0))/rho2)*p_rghEqnComp2()
|
||||||
|
)
|
||||||
|
+ p_rghEqnIncomp,
|
||||||
mesh.solver(p_rgh.select(pimple.finalInnerIter()))
|
mesh.solver(p_rgh.select(pimple.finalInnerIter()))
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -105,8 +93,8 @@
|
|||||||
|
|
||||||
dgdt =
|
dgdt =
|
||||||
(
|
(
|
||||||
alpha1*(p_rghEqnComp2 & p_rgh)
|
pos(alpha2)*(p_rghEqnComp2 & p_rgh)/rho2
|
||||||
- alpha2*(p_rghEqnComp1 & p_rgh)
|
- pos(alpha1)*(p_rghEqnComp1 & p_rgh)/rho1
|
||||||
);
|
);
|
||||||
|
|
||||||
phi = phiHbyA + p_rghEqnIncomp.flux();
|
phi = phiHbyA + p_rghEqnIncomp.flux();
|
||||||
@ -131,8 +119,11 @@
|
|||||||
rho = alpha1*rho1 + alpha2*rho2;
|
rho = alpha1*rho1 + alpha2*rho2;
|
||||||
|
|
||||||
// Correct p_rgh for consistency with p and the updated densities
|
// Correct p_rgh for consistency with p and the updated densities
|
||||||
|
p = max(p_rgh + rho*gh, pMin);
|
||||||
p_rgh = p - rho*gh;
|
p_rgh = p - rho*gh;
|
||||||
p_rgh.correctBoundaryConditions();
|
p_rgh.correctBoundaryConditions();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -89,22 +89,22 @@ public:
|
|||||||
|
|
||||||
const rhoThermo& thermo1() const
|
const rhoThermo& thermo1() const
|
||||||
{
|
{
|
||||||
return thermo1_();
|
return *thermo1_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const rhoThermo& thermo2() const
|
const rhoThermo& thermo2() const
|
||||||
{
|
{
|
||||||
return thermo2_();
|
return *thermo2_;
|
||||||
}
|
}
|
||||||
|
|
||||||
rhoThermo& thermo1()
|
rhoThermo& thermo1()
|
||||||
{
|
{
|
||||||
return thermo1_();
|
return *thermo1_;
|
||||||
}
|
}
|
||||||
|
|
||||||
rhoThermo& thermo2()
|
rhoThermo& thermo2()
|
||||||
{
|
{
|
||||||
return thermo2_();
|
return *thermo2_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Correct the thermodynamics of each phase
|
//- Correct the thermodynamics of each phase
|
||||||
|
|||||||
@ -125,8 +125,7 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
|||||||
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
|
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchScalarField::write(os);
|
fvPatchScalarField::write(os);
|
||||||
os.writeKeyword("thetaProperties")
|
os.writeEntry("thetaProperties", thetaProps_);
|
||||||
<< thetaProps_ << token::END_STATEMENT << nl;
|
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -62,15 +62,8 @@ public:
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
class hash
|
struct hash
|
||||||
:
|
|
||||||
public Hash<interfacePair>
|
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
|
|
||||||
hash()
|
|
||||||
{}
|
|
||||||
|
|
||||||
label operator()(const interfacePair& key) const
|
label operator()(const interfacePair& key) const
|
||||||
{
|
{
|
||||||
return word::hash()(key.first()) + word::hash()(key.second());
|
return word::hash()(key.first()) + word::hash()(key.second());
|
||||||
@ -80,8 +73,7 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
interfacePair()
|
interfacePair() {} // = default
|
||||||
{}
|
|
||||||
|
|
||||||
interfacePair(const word& alpha1Name, const word& alpha2Name)
|
interfacePair(const word& alpha1Name, const word& alpha2Name)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -81,7 +81,7 @@ Foam::phaseModel::phaseModel
|
|||||||
Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
|
Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
return autoPtr<phaseModel>(nullptr);
|
return autoPtr<phaseModel>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -100,7 +100,7 @@ public:
|
|||||||
|
|
||||||
autoPtr<phaseModel> operator()(Istream& is) const
|
autoPtr<phaseModel> operator()(Istream& is) const
|
||||||
{
|
{
|
||||||
return autoPtr<phaseModel>(new phaseModel(is, p_, T_));
|
return autoPtr<phaseModel>::New(is, p_, T_);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -120,13 +120,13 @@ public:
|
|||||||
//- Return const-access to phase rhoThermo
|
//- Return const-access to phase rhoThermo
|
||||||
const rhoThermo& thermo() const
|
const rhoThermo& thermo() const
|
||||||
{
|
{
|
||||||
return thermo_();
|
return *thermo_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return access to phase rhoThermo
|
//- Return access to phase rhoThermo
|
||||||
rhoThermo& thermo()
|
rhoThermo& thermo()
|
||||||
{
|
{
|
||||||
return thermo_();
|
return *thermo_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return const-access to phase divergence
|
//- Return const-access to phase divergence
|
||||||
|
|||||||
@ -106,13 +106,13 @@ public:
|
|||||||
//- Return const-access to the mixture viscosityModel
|
//- Return const-access to the mixture viscosityModel
|
||||||
const mixtureViscosityModel& muModel() const
|
const mixtureViscosityModel& muModel() const
|
||||||
{
|
{
|
||||||
return muModel_();
|
return *muModel_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return const-access to the continuous-phase viscosityModel
|
//- Return const-access to the continuous-phase viscosityModel
|
||||||
const viscosityModel& nucModel() const
|
const viscosityModel& nucModel() const
|
||||||
{
|
{
|
||||||
return nucModel_();
|
return *nucModel_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return const-access to the dispersed-phase density
|
//- Return const-access to the dispersed-phase density
|
||||||
|
|||||||
@ -29,8 +29,10 @@ volVectorField U
|
|||||||
#include "createPhi.H"
|
#include "createPhi.H"
|
||||||
|
|
||||||
// Creating e based thermo
|
// Creating e based thermo
|
||||||
autoPtr<twoPhaseMixtureEThermo> thermo;
|
autoPtr<twoPhaseMixtureEThermo> thermo
|
||||||
thermo.set(new twoPhaseMixtureEThermo(U, phi));
|
(
|
||||||
|
new twoPhaseMixtureEThermo(U, phi)
|
||||||
|
);
|
||||||
|
|
||||||
// Create mixture and
|
// Create mixture and
|
||||||
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\n" << endl;
|
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\n" << endl;
|
||||||
|
|||||||
@ -35,8 +35,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef flashThermo_H
|
#ifndef twoPhaseMixtureEThermo_H
|
||||||
#define flashThermo_H
|
#define twoPhaseMixtureEThermo_H
|
||||||
|
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
|
|
||||||
|
|||||||
@ -181,19 +181,19 @@ public:
|
|||||||
//- Return const-access to phase1 viscosityModel
|
//- Return const-access to phase1 viscosityModel
|
||||||
const viscosityModel& nuModel1() const
|
const viscosityModel& nuModel1() const
|
||||||
{
|
{
|
||||||
return nuModel1_();
|
return *nuModel1_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return const-access to phase2 viscosityModel
|
//- Return const-access to phase2 viscosityModel
|
||||||
const viscosityModel& nuModel2() const
|
const viscosityModel& nuModel2() const
|
||||||
{
|
{
|
||||||
return nuModel2_();
|
return *nuModel2_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return const-access to phase3 viscosityModel
|
//- Return const-access to phase3 viscosityModel
|
||||||
const viscosityModel& nuModel3() const
|
const viscosityModel& nuModel3() const
|
||||||
{
|
{
|
||||||
return nuModel3_();
|
return *nuModel3_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return the dynamic laminar viscosity
|
//- Return the dynamic laminar viscosity
|
||||||
|
|||||||
@ -110,7 +110,7 @@
|
|||||||
pcorrEqn.setReferences
|
pcorrEqn.setReferences
|
||||||
(
|
(
|
||||||
validCells,
|
validCells,
|
||||||
scalarList(validCells.size(), 0.0),
|
scalar(0.0),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#include "readTimeControls.H"
|
#include "readTimeControls.H"
|
||||||
|
|
||||||
correctPhi = pimple.dict().lookupOrDefault<Switch>("correctPhi", true);
|
correctPhi = pimple.dict().lookupOrDefault<Switch>("correctPhi", false);
|
||||||
|
|
||||||
checkMeshCourantNo =
|
checkMeshCourantNo =
|
||||||
pimple.dict().lookupOrDefault<Switch>("checkMeshCourantNo", false);
|
pimple.dict().lookupOrDefault<Switch>("checkMeshCourantNo", false);
|
||||||
|
|||||||
@ -17,4 +17,5 @@ EXE_LIBS = \
|
|||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lfvOptions \
|
-lfvOptions \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lsampling
|
-lsampling \
|
||||||
|
-lwaveModels
|
||||||
|
|||||||
@ -125,8 +125,7 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
|||||||
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
|
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchScalarField::write(os);
|
fvPatchScalarField::write(os);
|
||||||
os.writeKeyword("thetaProperties")
|
os.writeEntry("thetaProperties", thetaProps_);
|
||||||
<< thetaProps_ << token::END_STATEMENT << nl;
|
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,8 +32,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef constant_H
|
#ifndef diameterModels_constant_H
|
||||||
#define constant_H
|
#define diameterModels_constant_H
|
||||||
|
|
||||||
#include "diameterModel.H"
|
#include "diameterModel.H"
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::isothermal
|
Foam::diameterModels::isothermal
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Isothermal dispersed-phase particle diameter model.
|
Isothermal dispersed-phase particle diameter model.
|
||||||
@ -32,8 +32,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef isothermal_H
|
#ifndef diameterModels_isothermal_H
|
||||||
#define isothermal_H
|
#define diameterModels_isothermal_H
|
||||||
|
|
||||||
#include "diameterModel.H"
|
#include "diameterModel.H"
|
||||||
|
|
||||||
|
|||||||
@ -74,30 +74,16 @@ public:
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
class symmHash
|
struct symmHash
|
||||||
:
|
|
||||||
public Hash<interfacePair>
|
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
|
|
||||||
symmHash()
|
|
||||||
{}
|
|
||||||
|
|
||||||
label operator()(const interfacePair& key) const
|
label operator()(const interfacePair& key) const
|
||||||
{
|
{
|
||||||
return word::hash()(key.first()) + word::hash()(key.second());
|
return word::hash()(key.first()) + word::hash()(key.second());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class hash
|
struct hash
|
||||||
:
|
|
||||||
public Hash<interfacePair>
|
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
|
|
||||||
hash()
|
|
||||||
{}
|
|
||||||
|
|
||||||
label operator()(const interfacePair& key) const
|
label operator()(const interfacePair& key) const
|
||||||
{
|
{
|
||||||
return word::hash()(key.first(), word::hash()(key.second()));
|
return word::hash()(key.first(), word::hash()(key.second()));
|
||||||
@ -107,8 +93,7 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
interfacePair()
|
interfacePair() {} // = default
|
||||||
{}
|
|
||||||
|
|
||||||
interfacePair(const word& alpha1Name, const word& alpha2Name)
|
interfacePair(const word& alpha1Name, const word& alpha2Name)
|
||||||
:
|
:
|
||||||
@ -233,8 +218,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~multiphaseSystem()
|
virtual ~multiphaseSystem() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -205,7 +205,7 @@ Foam::phaseModel::~phaseModel()
|
|||||||
Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
|
Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
return autoPtr<phaseModel>(nullptr);
|
return autoPtr<phaseModel>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -190,12 +190,12 @@ public:
|
|||||||
|
|
||||||
const surfaceScalarField& phi() const
|
const surfaceScalarField& phi() const
|
||||||
{
|
{
|
||||||
return phiPtr_();
|
return *phiPtr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
surfaceScalarField& phi()
|
surfaceScalarField& phi()
|
||||||
{
|
{
|
||||||
return phiPtr_();
|
return *phiPtr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const surfaceScalarField& alphaPhi() const
|
const surfaceScalarField& alphaPhi() const
|
||||||
|
|||||||
@ -125,8 +125,7 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
|||||||
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
|
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchScalarField::write(os);
|
fvPatchScalarField::write(os);
|
||||||
os.writeKeyword("thetaProperties")
|
os.writeEntry("thetaProperties", thetaProps_);
|
||||||
<< thetaProps_ << token::END_STATEMENT << nl;
|
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user