mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into splitCyclic
Conflicts: applications/utilities/mesh/generation/blockMesh/blockMeshApp.C applications/utilities/parallelProcessing/decomposePar/decomposeMesh.C etc/bashrc etc/cshrc src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C src/decompositionMethods/parMetisDecomp/parMetisDecomp.C src/dynamicMesh/Make/files src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C src/dynamicMesh/perfectInterface/perfectInterface.C src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.H src/finiteVolume/Make/files src/mesh/blockMesh/blockMesh/blockMesh.C src/mesh/blockMesh/blockMesh/blockMeshTopology.C src/meshTools/Make/files src/meshTools/sets/topoSets/faceSet.C
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@ -50,8 +50,8 @@ doc/[Dd]oxygen/html
|
|||||||
doc/[Dd]oxygen/latex
|
doc/[Dd]oxygen/latex
|
||||||
doc/[Dd]oxygen/man
|
doc/[Dd]oxygen/man
|
||||||
|
|
||||||
# Other HTML files e.g. ReleaseNotes-?.?.html
|
# generated files in the main directory (e.g. ReleaseNotes-?.?.html)
|
||||||
*.html
|
/*.html
|
||||||
|
|
||||||
# source packages - anywhere
|
# source packages - anywhere
|
||||||
*.tar.bz2
|
*.tar.bz2
|
||||||
|
|||||||
5
Allwmake
5
Allwmake
@ -1,13 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd ${0%/*} || exit 1 # run from this directory
|
cd ${0%/*} || exit 1 # run from this directory
|
||||||
|
|
||||||
if [ "$PWD" != "$WM_PROJECT_DIR" ]
|
wmakeCheckPwd "$WM_PROJECT_DIR" || {
|
||||||
then
|
|
||||||
echo "Error: Current directory is not \$WM_PROJECT_DIR"
|
echo "Error: Current directory is not \$WM_PROJECT_DIR"
|
||||||
echo " The environment variables are inconsistent with the installation."
|
echo " The environment variables are inconsistent with the installation."
|
||||||
echo " Check the OpenFOAM entries in your dot-files and source them."
|
echo " Check the OpenFOAM entries in your dot-files and source them."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
}
|
||||||
|
|
||||||
# wmake is required for subsequent targets
|
# wmake is required for subsequent targets
|
||||||
( cd wmake/src && make )
|
( cd wmake/src && make )
|
||||||
|
|||||||
6
README
6
README
@ -99,7 +99,7 @@
|
|||||||
and a csh/tcsh example:
|
and a csh/tcsh example:
|
||||||
|
|
||||||
+ setenv FOAM_INST_DIR /data/app/OpenFOAM
|
+ setenv FOAM_INST_DIR /data/app/OpenFOAM
|
||||||
+ foamDotFile=$FOAM_INST_DIR/OpenFOAM-1.6/etc/bashrc
|
+ foamDotFile=$FOAM_INST_DIR/OpenFOAM-1.6/etc/cshrc
|
||||||
+ if ( -f $foamDotFile ) source $foamDotFile
|
+ if ( -f $foamDotFile ) source $foamDotFile
|
||||||
|
|
||||||
The value set in '$FOAM_INST_DIR' will be used to locate the remaining parts
|
The value set in '$FOAM_INST_DIR' will be used to locate the remaining parts
|
||||||
@ -180,12 +180,12 @@
|
|||||||
downloads a supported version of Qt /e.g./ 4.3.5 as described in the section
|
downloads a supported version of Qt /e.g./ 4.3.5 as described in the section
|
||||||
on "Qt". The user should unpack the source pack in the $WM_THIRD_PARTY_DIR.
|
on "Qt". The user should unpack the source pack in the $WM_THIRD_PARTY_DIR.
|
||||||
Then the user can build Qt by executing from within $WM_THIRD_PARTY_DIR:
|
Then the user can build Qt by executing from within $WM_THIRD_PARTY_DIR:
|
||||||
+ makeQt
|
+ ./makeQt
|
||||||
|
|
||||||
The user should then compile ParaView using the local version of Qt by
|
The user should then compile ParaView using the local version of Qt by
|
||||||
executing makeParaView with the -qmake option, giving the full path of the
|
executing makeParaView with the -qmake option, giving the full path of the
|
||||||
newly built qmake as an argument:
|
newly built qmake as an argument:
|
||||||
+ makeParaView -qmake <path_to_qmake>
|
+ ./makeParaView -qmake <path_to_qmake>
|
||||||
|
|
||||||
The user must then recompile the PV3FoamReader module as normal (see above).
|
The user must then recompile the PV3FoamReader module as normal (see above).
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd ${0%/*} || exit 1 # run from this directory
|
cd ${0%/*} || exit 1 # run from this directory
|
||||||
|
|
||||||
if [ "$PWD" != "$WM_PROJECT_DIR/applications" ]
|
wmakeCheckPwd "$WM_PROJECT_DIR/applications" || {
|
||||||
then
|
|
||||||
echo "Error: Current directory is not \$WM_PROJECT_DIR/applications"
|
echo "Error: Current directory is not \$WM_PROJECT_DIR/applications"
|
||||||
echo " The environment variables are inconsistent with the installation."
|
echo " The environment variables are inconsistent with the installation."
|
||||||
echo " Check the OpenFOAM entries in your dot-files and source them."
|
echo " Check the OpenFOAM entries in your dot-files and source them."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
}
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
volVectorField force =
|
volVectorField force =
|
||||||
U/dimensionedScalar("dt", dimTime, runTime.deltaT().value());
|
U/dimensionedScalar("dt", dimTime, runTime.deltaTValue());
|
||||||
|
|
||||||
Kmesh K(mesh);
|
Kmesh K(mesh);
|
||||||
UOprocess forceGen(K, runTime.deltaT().value(), turbulenceProperties);
|
UOprocess forceGen(K, runTime.deltaTValue(), turbulenceProperties);
|
||||||
|
|||||||
@ -52,7 +52,7 @@ Foam::autoPtr<Foam::PDRDragModel> Foam::PDRDragModel::New
|
|||||||
) << "Unknown PDRDragModel type "
|
) << "Unknown PDRDragModel type "
|
||||||
<< PDRDragModelTypeName << endl << endl
|
<< PDRDragModelTypeName << endl << endl
|
||||||
<< "Valid PDRDragModels are : " << endl
|
<< "Valid PDRDragModels are : " << endl
|
||||||
<< dictionaryConstructorTablePtr_->toc()
|
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -41,11 +41,11 @@ Description
|
|||||||
|
|
||||||
StCoNum =
|
StCoNum =
|
||||||
max(SfUfbyDelta/mesh.magSf()).value()
|
max(SfUfbyDelta/mesh.magSf()).value()
|
||||||
*runTime.deltaT().value();
|
*runTime.deltaTValue();
|
||||||
|
|
||||||
meanStCoNum =
|
meanStCoNum =
|
||||||
(sum(SfUfbyDelta)/sum(mesh.magSf())).value()
|
(sum(SfUfbyDelta)/sum(mesh.magSf())).value()
|
||||||
*runTime.deltaT().value();
|
*runTime.deltaTValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "St courant Number mean: " << meanStCoNum
|
Info<< "St courant Number mean: " << meanStCoNum
|
||||||
|
|||||||
@ -56,7 +56,7 @@ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
|
|||||||
) << "Unknown XiEqModel type "
|
) << "Unknown XiEqModel type "
|
||||||
<< XiEqModelTypeName << endl << endl
|
<< XiEqModelTypeName << endl << endl
|
||||||
<< "Valid XiEqModels are : " << endl
|
<< "Valid XiEqModels are : " << endl
|
||||||
<< dictionaryConstructorTablePtr_->toc()
|
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -56,7 +56,7 @@ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
|
|||||||
) << "Unknown XiGModel type "
|
) << "Unknown XiGModel type "
|
||||||
<< XiGModelTypeName << endl << endl
|
<< XiGModelTypeName << endl << endl
|
||||||
<< "Valid XiGModels are : " << endl
|
<< "Valid XiGModels are : " << endl
|
||||||
<< dictionaryConstructorTablePtr_->toc()
|
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,7 @@ Foam::autoPtr<Foam::XiModel> Foam::XiModel::New
|
|||||||
) << "Unknown XiModel type "
|
) << "Unknown XiModel type "
|
||||||
<< XiModelTypeName << endl << endl
|
<< XiModelTypeName << endl << endl
|
||||||
<< "Valid XiModels are : " << endl
|
<< "Valid XiModels are : " << endl
|
||||||
<< dictionaryConstructorTablePtr_->toc()
|
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -41,12 +41,12 @@ if (adjustTimeStep)
|
|||||||
(
|
(
|
||||||
min
|
min
|
||||||
(
|
(
|
||||||
deltaTFact*runTime.deltaT().value(),
|
deltaTFact*runTime.deltaTValue(),
|
||||||
maxDeltaT
|
maxDeltaT
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "deltaT = " << runTime.deltaT().value() << endl;
|
Info<< "deltaT = " << runTime.deltaTValue() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -40,7 +40,7 @@ if (ign.ignited())
|
|||||||
(
|
(
|
||||||
mesh.surfaceInterpolation::deltaCoeffs()
|
mesh.surfaceInterpolation::deltaCoeffs()
|
||||||
*mag(phiSt)/(fvc::interpolate(rho)*mesh.magSf())
|
*mag(phiSt)/(fvc::interpolate(rho)*mesh.magSf())
|
||||||
).value()*runTime.deltaT().value();
|
).value()*runTime.deltaTValue();
|
||||||
|
|
||||||
Info<< "Max St-Courant Number = " << StCoNum << endl;
|
Info<< "Max St-Courant Number = " << StCoNum << endl;
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,14 @@ PtrList<volScalarField>& Y = composition.Y();
|
|||||||
|
|
||||||
word inertSpecie(thermo.lookup("inertSpecie"));
|
word inertSpecie(thermo.lookup("inertSpecie"));
|
||||||
|
|
||||||
|
if (!composition.contains(inertSpecie))
|
||||||
|
{
|
||||||
|
FatalErrorIn(args.executable())
|
||||||
|
<< "Specified inert specie '" << inertSpecie << "' not found in "
|
||||||
|
<< "species list. Available species:" << composition.species()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
volScalarField rho
|
volScalarField rho
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
|
|||||||
@ -30,7 +30,7 @@ scalar gasMass0 = fvc::domainIntegrate(rho).value();
|
|||||||
|
|
||||||
if (dieselSpray.twoD())
|
if (dieselSpray.twoD())
|
||||||
{
|
{
|
||||||
gasMass0 *= 2.0*mathematicalConstant::pi/dieselSpray.angleOfWedge();
|
gasMass0 *= constant::mathematical::twoPi/dieselSpray.angleOfWedge();
|
||||||
}
|
}
|
||||||
|
|
||||||
gasMass0 -=
|
gasMass0 -=
|
||||||
|
|||||||
@ -43,6 +43,7 @@ Description
|
|||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include "volPointInterpolation.H"
|
#include "volPointInterpolation.H"
|
||||||
#include "thermoPhysicsTypes.H"
|
#include "thermoPhysicsTypes.H"
|
||||||
|
#include "mathematicalConstants.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -88,8 +89,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
chemistry.solve
|
chemistry.solve
|
||||||
(
|
(
|
||||||
runTime.value() - runTime.deltaT().value(),
|
runTime.value() - runTime.deltaTValue(),
|
||||||
runTime.deltaT().value()
|
runTime.deltaTValue()
|
||||||
);
|
);
|
||||||
|
|
||||||
// turbulent time scale
|
// turbulent time scale
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
if (dieselSpray.twoD())
|
if (dieselSpray.twoD())
|
||||||
{
|
{
|
||||||
gasMass *= 2.0*mathematicalConstant::pi/dieselSpray.angleOfWedge();
|
gasMass *= constant::mathematical::twoPi/dieselSpray.angleOfWedge();
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar addedMass = gasMass - gasMass0;
|
scalar addedMass = gasMass - gasMass0;
|
||||||
|
|||||||
@ -41,6 +41,7 @@ Description
|
|||||||
#include "IFstream.H"
|
#include "IFstream.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include "Switch.H"
|
#include "Switch.H"
|
||||||
|
#include "mathematicalConstants.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -79,8 +80,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
chemistry.solve
|
chemistry.solve
|
||||||
(
|
(
|
||||||
runTime.value() - runTime.deltaT().value(),
|
runTime.value() - runTime.deltaTValue(),
|
||||||
runTime.deltaT().value()
|
runTime.deltaTValue()
|
||||||
);
|
);
|
||||||
|
|
||||||
// turbulent time scale
|
// turbulent time scale
|
||||||
|
|||||||
@ -58,6 +58,7 @@ Description
|
|||||||
#include "ignition.H"
|
#include "ignition.H"
|
||||||
#include "Switch.H"
|
#include "Switch.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
|
#include "mathematicalConstants.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
chemistry.solve
|
chemistry.solve
|
||||||
(
|
(
|
||||||
runTime.value() - runTime.deltaT().value(),
|
runTime.value() - runTime.deltaTValue(),
|
||||||
runTime.deltaT().value()
|
runTime.deltaTValue()
|
||||||
);
|
);
|
||||||
|
|
||||||
// turbulent time scale
|
// turbulent time scale
|
||||||
|
|||||||
@ -68,10 +68,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "chemistry.H"
|
#include "chemistry.H"
|
||||||
#include "rhoEqn.H"
|
#include "rhoEqn.H"
|
||||||
#include "UEqn.H"
|
|
||||||
|
|
||||||
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++)
|
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++)
|
||||||
{
|
{
|
||||||
|
#include "UEqn.H"
|
||||||
#include "YEqn.H"
|
#include "YEqn.H"
|
||||||
|
|
||||||
#define Db turbulence->alphaEff()
|
#define Db turbulence->alphaEff()
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
chemistry.solve
|
chemistry.solve
|
||||||
(
|
(
|
||||||
runTime.value() - runTime.deltaT().value(),
|
runTime.value() - runTime.deltaTValue(),
|
||||||
runTime.deltaT().value()
|
runTime.deltaTValue()
|
||||||
);
|
);
|
||||||
|
|
||||||
// turbulent time scale
|
// turbulent time scale
|
||||||
|
|||||||
@ -182,7 +182,7 @@ void smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Field<scalar> C2 = pmu/prho
|
Field<scalar> C2 = pmu/prho
|
||||||
*sqrt(ppsi*mathematicalConstant::pi/2.0)
|
*sqrt(ppsi*constant::mathematical::piByTwo)
|
||||||
*2.0*gamma_/Pr.value()/(gamma_ + 1.0)
|
*2.0*gamma_/Pr.value()/(gamma_ + 1.0)
|
||||||
*(2.0 - accommodationCoeff_)/accommodationCoeff_;
|
*(2.0 - accommodationCoeff_)/accommodationCoeff_;
|
||||||
|
|
||||||
|
|||||||
@ -147,7 +147,7 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs()
|
|||||||
const fvPatchField<scalar>& ppsi =
|
const fvPatchField<scalar>& ppsi =
|
||||||
patch().lookupPatchField<volScalarField, scalar>("psi");
|
patch().lookupPatchField<volScalarField, scalar>("psi");
|
||||||
|
|
||||||
Field<scalar> C1 = sqrt(ppsi*mathematicalConstant::pi/2.0)
|
Field<scalar> C1 = sqrt(ppsi*constant::mathematical::piByTwo)
|
||||||
*(2.0 - accommodationCoeff_)/accommodationCoeff_;
|
*(2.0 - accommodationCoeff_)/accommodationCoeff_;
|
||||||
|
|
||||||
Field<scalar> pnu = pmu/prho;
|
Field<scalar> pnu = pmu/prho;
|
||||||
|
|||||||
@ -38,11 +38,11 @@ if (mesh.nInternalFaces())
|
|||||||
surfaceScalarField amaxSfbyDelta =
|
surfaceScalarField amaxSfbyDelta =
|
||||||
mesh.surfaceInterpolation::deltaCoeffs()*amaxSf;
|
mesh.surfaceInterpolation::deltaCoeffs()*amaxSf;
|
||||||
|
|
||||||
CoNum = max(amaxSfbyDelta/mesh.magSf()).value()*runTime.deltaT().value();
|
CoNum = max(amaxSfbyDelta/mesh.magSf()).value()*runTime.deltaTValue();
|
||||||
|
|
||||||
meanCoNum =
|
meanCoNum =
|
||||||
(sum(amaxSfbyDelta)/sum(mesh.magSf())).value()
|
(sum(amaxSfbyDelta)/sum(mesh.magSf())).value()
|
||||||
*runTime.deltaT().value();
|
*runTime.deltaTValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Mean and max Courant Numbers = "
|
Info<< "Mean and max Courant Numbers = "
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/thermalPorousZone/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels \
|
-I$(LIB_SRC)/turbulenceModels \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
|
||||||
-I$(LIB_SRC)/finiteVolume/cfdTools \
|
-I$(LIB_SRC)/finiteVolume/cfdTools \
|
||||||
@ -8,6 +9,7 @@ EXE_INC = \
|
|||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
|
-lthermalPorousZone \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
|||||||
@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
|
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
|
||||||
|
|
||||||
porousZones pZones(mesh);
|
thermalPorousZones pZones(mesh);
|
||||||
Switch pressureImplicitPorosity(false);
|
Switch pressureImplicitPorosity(false);
|
||||||
|
|
||||||
int nUCorr = 0;
|
int nUCorr = 0;
|
||||||
@ -84,4 +84,3 @@
|
|||||||
pressureImplicitPorosity = true;
|
pressureImplicitPorosity = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,8 @@
|
|||||||
- p*fvc::div(phi/fvc::interpolate(rho))
|
- p*fvc::div(phi/fvc::interpolate(rho))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
pZones.addEnthalpySource(thermo, rho, hEqn);
|
||||||
|
|
||||||
hEqn.relax();
|
hEqn.relax();
|
||||||
|
|
||||||
eqnResidual = hEqn.solve().initialResidual();
|
eqnResidual = hEqn.solve().initialResidual();
|
||||||
|
|||||||
@ -34,7 +34,7 @@ Description
|
|||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "basicPsiThermo.H"
|
#include "basicPsiThermo.H"
|
||||||
#include "RASModel.H"
|
#include "RASModel.H"
|
||||||
#include "porousZones.H"
|
#include "thermalPorousZones.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ if (transonic)
|
|||||||
|
|
||||||
pEqn.setReference(pRefCell, pRefValue);
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
|
|
||||||
// retain the residual from the first iteration
|
// Retain the residual from the first iteration
|
||||||
if (nonOrth == 0)
|
if (nonOrth == 0)
|
||||||
{
|
{
|
||||||
eqnResidual = pEqn.solve().initialResidual();
|
eqnResidual = pEqn.solve().initialResidual();
|
||||||
|
|||||||
@ -0,0 +1,3 @@
|
|||||||
|
rhoSimplecFoam.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_APPBIN)/rhoSimplecFoam
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I../rhoSimpleFoam \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/turbulenceModels \
|
||||||
|
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/cfdTools \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
|
EXE_LIBS = \
|
||||||
|
-lbasicThermophysicalModels \
|
||||||
|
-lspecie \
|
||||||
|
-lcompressibleRASModels \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-lmeshTools
|
||||||
17
applications/solvers/compressible/rhoSimplecFoam/UEqn.H
Normal file
17
applications/solvers/compressible/rhoSimplecFoam/UEqn.H
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// Solve the Momentum equation
|
||||||
|
|
||||||
|
tmp<fvVectorMatrix> UEqn
|
||||||
|
(
|
||||||
|
fvm::div(phi, U)
|
||||||
|
- fvm::Sp(fvc::div(phi), U)
|
||||||
|
+ turbulence->divDevRhoReff(U)
|
||||||
|
);
|
||||||
|
|
||||||
|
UEqn().relax();
|
||||||
|
|
||||||
|
eqnResidual = solve
|
||||||
|
(
|
||||||
|
UEqn() == -fvc::grad(p)
|
||||||
|
).initialResidual();
|
||||||
|
|
||||||
|
maxResidual = max(eqnResidual, maxResidual);
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
Info<< "Reading thermophysical properties\n" << endl;
|
||||||
|
|
||||||
|
autoPtr<basicPsiThermo> pThermo
|
||||||
|
(
|
||||||
|
basicPsiThermo::New(mesh)
|
||||||
|
);
|
||||||
|
basicPsiThermo& thermo = pThermo();
|
||||||
|
|
||||||
|
volScalarField rho
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"rho",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
thermo.rho()
|
||||||
|
);
|
||||||
|
|
||||||
|
volScalarField& p = thermo.p();
|
||||||
|
volScalarField& h = thermo.h();
|
||||||
|
const volScalarField& psi = thermo.psi();
|
||||||
|
|
||||||
|
Info<< "Reading field U\n" << endl;
|
||||||
|
volVectorField U
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"U",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
#include "compressibleCreatePhi.H"
|
||||||
|
|
||||||
|
label pRefCell = 0;
|
||||||
|
scalar pRefValue = 0.0;
|
||||||
|
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
|
||||||
|
|
||||||
|
dimensionedScalar pMin
|
||||||
|
(
|
||||||
|
mesh.solutionDict().subDict("SIMPLE").lookup("pMin")
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
|
autoPtr<compressible::RASModel> turbulence
|
||||||
|
(
|
||||||
|
compressible::RASModel::New
|
||||||
|
(
|
||||||
|
rho,
|
||||||
|
U,
|
||||||
|
phi,
|
||||||
|
thermo
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
|
||||||
29
applications/solvers/compressible/rhoSimplecFoam/hEqn.H
Normal file
29
applications/solvers/compressible/rhoSimplecFoam/hEqn.H
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
fvScalarMatrix hEqn
|
||||||
|
(
|
||||||
|
fvm::div(phi, h)
|
||||||
|
- fvm::Sp(fvc::div(phi), h)
|
||||||
|
- fvm::laplacian(turbulence->alphaEff(), h)
|
||||||
|
==
|
||||||
|
fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p, "div(U,p)"))
|
||||||
|
- p*fvc::div(phi/fvc::interpolate(rho))
|
||||||
|
);
|
||||||
|
|
||||||
|
hEqn.relax();
|
||||||
|
|
||||||
|
eqnResidual = hEqn.solve().initialResidual();
|
||||||
|
maxResidual = max(eqnResidual, maxResidual);
|
||||||
|
|
||||||
|
thermo.correct();
|
||||||
|
|
||||||
|
rho = thermo.rho();
|
||||||
|
|
||||||
|
if (!transonic)
|
||||||
|
{
|
||||||
|
rho.relax();
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "rho max/min : "
|
||||||
|
<< max(rho).value() << " "
|
||||||
|
<< min(rho).value() << endl;
|
||||||
|
}
|
||||||
123
applications/solvers/compressible/rhoSimplecFoam/pEqn.H
Normal file
123
applications/solvers/compressible/rhoSimplecFoam/pEqn.H
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
volScalarField p0 = p;
|
||||||
|
|
||||||
|
volScalarField AU = UEqn().A();
|
||||||
|
volScalarField AtU = AU - UEqn().H1();
|
||||||
|
U = UEqn().H()/AU;
|
||||||
|
UEqn.clear();
|
||||||
|
|
||||||
|
bool closedVolume = false;
|
||||||
|
|
||||||
|
if (transonic)
|
||||||
|
{
|
||||||
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||||
|
{
|
||||||
|
surfaceScalarField phid
|
||||||
|
(
|
||||||
|
"phid",
|
||||||
|
fvc::interpolate(psi*U) & mesh.Sf()
|
||||||
|
);
|
||||||
|
|
||||||
|
surfaceScalarField phic
|
||||||
|
(
|
||||||
|
"phic",
|
||||||
|
fvc::interpolate(rho/AtU - rho/AU)*fvc::snGrad(p)*mesh.magSf()
|
||||||
|
+ phid*(fvc::interpolate(p) - fvc::interpolate(p, "UD"))
|
||||||
|
);
|
||||||
|
|
||||||
|
refCast<mixedFvPatchScalarField>(p.boundaryField()[1]).refValue()
|
||||||
|
= p.boundaryField()[1];
|
||||||
|
|
||||||
|
fvScalarMatrix pEqn
|
||||||
|
(
|
||||||
|
fvm::div(phid, p)
|
||||||
|
+ fvc::div(phic)
|
||||||
|
- fvm::Sp(fvc::div(phid), p)
|
||||||
|
+ fvc::div(phid)*p
|
||||||
|
- fvm::laplacian(rho/AtU, p)
|
||||||
|
);
|
||||||
|
|
||||||
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
|
|
||||||
|
// Retain the residual from the first iteration
|
||||||
|
if (nonOrth == 0)
|
||||||
|
{
|
||||||
|
eqnResidual = pEqn.solve().initialResidual();
|
||||||
|
maxResidual = max(eqnResidual, maxResidual);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pEqn.solve();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nonOrth == nNonOrthCorr)
|
||||||
|
{
|
||||||
|
phi == phic + pEqn.flux();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||||
|
{
|
||||||
|
phi = fvc::interpolate(rho*U) & mesh.Sf();
|
||||||
|
closedVolume = adjustPhi(phi, U, p);
|
||||||
|
phi += fvc::interpolate(rho/AtU - rho/AU)*fvc::snGrad(p)*mesh.magSf();
|
||||||
|
|
||||||
|
fvScalarMatrix pEqn
|
||||||
|
(
|
||||||
|
fvc::div(phi)
|
||||||
|
//- fvm::laplacian(rho/AU, p)
|
||||||
|
- fvm::laplacian(rho/AtU, p)
|
||||||
|
);
|
||||||
|
|
||||||
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
|
|
||||||
|
// Retain the residual from the first iteration
|
||||||
|
if (nonOrth == 0)
|
||||||
|
{
|
||||||
|
eqnResidual = pEqn.solve().initialResidual();
|
||||||
|
maxResidual = max(eqnResidual, maxResidual);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pEqn.solve();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (nonOrth == nNonOrthCorr)
|
||||||
|
{
|
||||||
|
phi += pEqn.flux();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// The incompressibe for of the continuity error check is appropriate for
|
||||||
|
// steady-state compressible also.
|
||||||
|
#include "incompressible/continuityErrs.H"
|
||||||
|
|
||||||
|
// Explicitly relax pressure for momentum corrector
|
||||||
|
p.relax();
|
||||||
|
|
||||||
|
U -= (fvc::grad(p0)*(1.0/AU - 1.0/AtU) + fvc::grad(p)/AtU);
|
||||||
|
//U -= fvc::grad(p)/AU;
|
||||||
|
|
||||||
|
U.correctBoundaryConditions();
|
||||||
|
|
||||||
|
bound(p, pMin);
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
rho = thermo.rho();
|
||||||
|
|
||||||
|
if (!transonic)
|
||||||
|
{
|
||||||
|
rho.relax();
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;
|
||||||
@ -0,0 +1,92 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Application
|
||||||
|
rhoSimplecFoam
|
||||||
|
|
||||||
|
Description
|
||||||
|
Steady-state SIMPLEC solver for laminar or turbulent RANS flow of
|
||||||
|
compressible fluids.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "fvCFD.H"
|
||||||
|
#include "basicPsiThermo.H"
|
||||||
|
#include "RASModel.H"
|
||||||
|
#include "mixedFvPatchFields.H"
|
||||||
|
#include "bound.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
#include "setRootCase.H"
|
||||||
|
#include "createTime.H"
|
||||||
|
#include "createMesh.H"
|
||||||
|
#include "createFields.H"
|
||||||
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
|
for (runTime++; !runTime.end(); runTime++)
|
||||||
|
{
|
||||||
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
|
#include "readSIMPLEControls.H"
|
||||||
|
#include "initConvergenceCheck.H"
|
||||||
|
|
||||||
|
p.storePrevIter();
|
||||||
|
|
||||||
|
if (!transonic)
|
||||||
|
{
|
||||||
|
rho.storePrevIter();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Velocity-pressure-enthalpy SIMPLEC corrector
|
||||||
|
{
|
||||||
|
#include "UEqn.H"
|
||||||
|
#include "pEqn.H"
|
||||||
|
#include "hEqn.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
turbulence->correct();
|
||||||
|
|
||||||
|
runTime.write();
|
||||||
|
|
||||||
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
|
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||||
|
<< nl << endl;
|
||||||
|
|
||||||
|
#include "convergenceCheck.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -68,7 +68,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
mesh.surfaceInterpolation::deltaCoeffs()
|
mesh.surfaceInterpolation::deltaCoeffs()
|
||||||
*mag(phiv)/mesh.magSf()
|
*mag(phiv)/mesh.magSf()
|
||||||
).value()*runTime.deltaT().value();
|
).value()*runTime.deltaTValue();
|
||||||
|
|
||||||
Info<< "\nMax Courant Number = " << CoNum << endl;
|
Info<< "\nMax Courant Number = " << CoNum << endl;
|
||||||
|
|
||||||
|
|||||||
@ -65,7 +65,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
mesh.surfaceInterpolation::deltaCoeffs()
|
mesh.surfaceInterpolation::deltaCoeffs()
|
||||||
*mag(phiv)/mesh.magSf()
|
*mag(phiv)/mesh.magSf()
|
||||||
).value()*runTime.deltaT().value();
|
).value()*runTime.deltaTValue();
|
||||||
|
|
||||||
Info<< "Max Courant Number = " << CoNum << endl;
|
Info<< "Max Courant Number = " << CoNum << endl;
|
||||||
|
|
||||||
|
|||||||
@ -1,162 +0,0 @@
|
|||||||
|
|
||||||
Info<< nl << "Reading field boundaryT" << endl;
|
|
||||||
volScalarField boundaryT
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"boundaryT",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< nl << "Reading field boundaryU" << endl;
|
|
||||||
volVectorField boundaryU
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"boundaryU",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< nl << "Reading field rhoN (number density)" << endl;
|
|
||||||
volScalarField rhoN
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rhoN",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< nl << "Reading field rhoM (mass density)" << endl;
|
|
||||||
volScalarField rhoM
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rhoM",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< nl << "Reading field rhoNdsmc (dsmc particle density)" << endl;
|
|
||||||
volScalarField dsmcRhoN
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"dsmcRhoN",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< nl << "Reading field momentum (momentum density)" << endl;
|
|
||||||
volVectorField momentum
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"momentum",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< nl << "Reading field linearKE (linear kinetic energy density)"
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
volScalarField linearKE
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"linearKE",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< nl << "Reading field internalE (internal energy density)" << endl;
|
|
||||||
volScalarField internalE
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"internalE",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< nl << "Reading field iDof (internal degree of freedom density)"
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
volScalarField iDof
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"iDof",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< nl << "Reading field q (surface heat transfer)" << endl;
|
|
||||||
volScalarField q
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"q",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< nl << "Reading field fD (surface force density)" << endl;
|
|
||||||
volVectorField fD
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"fD",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< nl << "Constructing dsmcCloud " << endl;
|
|
||||||
|
|
||||||
dsmcCloud dsmc("dsmc", boundaryT, boundaryU);
|
|
||||||
@ -41,53 +41,21 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
#include "createFields.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Info<< nl << "Constructing dsmcCloud " << endl;
|
||||||
|
|
||||||
|
dsmcCloud dsmc("dsmc", mesh);
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
while (runTime.run())
|
while (runTime.loop())
|
||||||
{
|
{
|
||||||
runTime++;
|
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
// Carry out dsmcCloud timestep
|
|
||||||
|
|
||||||
dsmc.evolve();
|
dsmc.evolve();
|
||||||
|
|
||||||
// Retrieve flow field data from dsmcCloud
|
|
||||||
|
|
||||||
rhoN = dsmc.rhoN();
|
|
||||||
rhoN.correctBoundaryConditions();
|
|
||||||
|
|
||||||
rhoM = dsmc.rhoM();
|
|
||||||
rhoM.correctBoundaryConditions();
|
|
||||||
|
|
||||||
dsmcRhoN = dsmc.dsmcRhoN();
|
|
||||||
dsmcRhoN.correctBoundaryConditions();
|
|
||||||
|
|
||||||
momentum = dsmc.momentum();
|
|
||||||
momentum.correctBoundaryConditions();
|
|
||||||
|
|
||||||
linearKE = dsmc.linearKE();
|
|
||||||
linearKE.correctBoundaryConditions();
|
|
||||||
|
|
||||||
internalE = dsmc.internalE();
|
|
||||||
internalE.correctBoundaryConditions();
|
|
||||||
|
|
||||||
iDof = dsmc.iDof();
|
|
||||||
iDof.correctBoundaryConditions();
|
|
||||||
|
|
||||||
// Retrieve surface field data from dsmcCloud
|
|
||||||
|
|
||||||
q = dsmc.q();
|
|
||||||
|
|
||||||
fD = dsmc.fD();
|
|
||||||
|
|
||||||
// Print status of dsmcCloud
|
|
||||||
|
|
||||||
dsmc.info();
|
dsmc.info();
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
Info<< "magnetic flux divergence error = "
|
Info<< "magnetic flux divergence error = "
|
||||||
<< runTime.deltaT().value()
|
<< runTime.deltaTValue()
|
||||||
*mag(fvc::div(phiB))().weightedAverage(mesh.V()).value()
|
*mag(fvc::div(phiB))().weightedAverage(mesh.V()).value()
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
fvm::laplacian(rhorUAf, p) == fvc::div(phi)
|
fvm::laplacian(rhorUAf, p) == fvc::div(phi)
|
||||||
);
|
);
|
||||||
|
|
||||||
pEqn.setReference(pRefCell, p[pRefCell]);
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
|
|
||||||
// retain the residual from the first iteration
|
// retain the residual from the first iteration
|
||||||
if (nonOrth == 0)
|
if (nonOrth == 0)
|
||||||
|
|||||||
@ -1,7 +1,4 @@
|
|||||||
regionProperties/regionProperties.C
|
|
||||||
|
|
||||||
derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C
|
derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C
|
||||||
derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField.C
|
|
||||||
|
|
||||||
fluid/compressibleCourantNo.C
|
fluid/compressibleCourantNo.C
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
|
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
|
|||||||
@ -47,10 +47,10 @@ Foam::scalar Foam::compressibleCourantNo
|
|||||||
/ fvc::interpolate(rho);
|
/ fvc::interpolate(rho);
|
||||||
|
|
||||||
CoNum = max(SfUfbyDelta/mesh.magSf())
|
CoNum = max(SfUfbyDelta/mesh.magSf())
|
||||||
.value()*runTime.deltaT().value();
|
.value()*runTime.deltaTValue();
|
||||||
|
|
||||||
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
||||||
.value()*runTime.deltaT().value();
|
.value()*runTime.deltaTValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Region: " << mesh.name() << " Courant Number mean: " << meanCoNum
|
Info<< "Region: " << mesh.name() << " Courant Number mean: " << meanCoNum
|
||||||
|
|||||||
@ -41,24 +41,6 @@
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< " Adding to KFluid\n" << endl;
|
|
||||||
KFluid.set
|
|
||||||
(
|
|
||||||
i,
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"K",
|
|
||||||
runTime.timeName(),
|
|
||||||
fluidRegions[i],
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
thermoFluid[i].Cp()*thermoFluid[i].alpha()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< " Adding to UFluid\n" << endl;
|
Info<< " Adding to UFluid\n" << endl;
|
||||||
UFluid.set
|
UFluid.set
|
||||||
(
|
(
|
||||||
@ -129,6 +111,24 @@
|
|||||||
).ptr()
|
).ptr()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Info<< " Adding to KFluid\n" << endl;
|
||||||
|
KFluid.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"K",
|
||||||
|
runTime.timeName(),
|
||||||
|
fluidRegions[i],
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
thermoFluid[i].Cp()*turbulence[i].alphaEff()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
Info<< " Adding to DpDtFluid\n" << endl;
|
Info<< " Adding to DpDtFluid\n" << endl;
|
||||||
DpDtFluid.set
|
DpDtFluid.set
|
||||||
(
|
(
|
||||||
|
|||||||
@ -0,0 +1,5 @@
|
|||||||
|
derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C
|
||||||
|
chtMultiRegionSimpleFoam.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_APPBIN)/chtMultiRegionSimpleFoam
|
||||||
|
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
/* -DFULLDEBUG -O0 -g */ \
|
||||||
|
-Ifluid \
|
||||||
|
-Isolid \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/turbulenceModels \
|
||||||
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
|
||||||
|
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude
|
||||||
|
|
||||||
|
EXE_LIBS = \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-lbasicThermophysicalModels \
|
||||||
|
-lspecie \
|
||||||
|
-lcompressibleRASModels
|
||||||
@ -0,0 +1,99 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Application
|
||||||
|
chtMultiRegionSimpleFoam
|
||||||
|
|
||||||
|
Description
|
||||||
|
Steady-state version of chtMultiRegionFoam
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "fvCFD.H"
|
||||||
|
#include "basicPsiThermo.H"
|
||||||
|
#include "turbulenceModel.H"
|
||||||
|
#include "fixedGradientFvPatchFields.H"
|
||||||
|
#include "regionProperties.H"
|
||||||
|
#include "compressibleCourantNo.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
#include "setRootCase.H"
|
||||||
|
#include "createTime.H"
|
||||||
|
|
||||||
|
regionProperties rp(runTime);
|
||||||
|
|
||||||
|
#include "createFluidMeshes.H"
|
||||||
|
#include "createSolidMeshes.H"
|
||||||
|
|
||||||
|
#include "createFluidFields.H"
|
||||||
|
#include "createSolidFields.H"
|
||||||
|
|
||||||
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
|
|
||||||
|
while (runTime.run())
|
||||||
|
{
|
||||||
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
|
forAll(fluidRegions, i)
|
||||||
|
{
|
||||||
|
Info<< "\nSolving for fluid region "
|
||||||
|
<< fluidRegions[i].name() << endl;
|
||||||
|
#include "setRegionFluidFields.H"
|
||||||
|
#include "readFluidMultiRegionSIMPLEControls.H"
|
||||||
|
#include "initConvergenceCheck.H"
|
||||||
|
#include "solveFluid.H"
|
||||||
|
#include "convergenceCheck.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(solidRegions, i)
|
||||||
|
{
|
||||||
|
Info<< "\nSolving for solid region "
|
||||||
|
<< solidRegions[i].name() << endl;
|
||||||
|
#include "setRegionSolidFields.H"
|
||||||
|
#include "readSolidMultiRegionSIMPLEControls.H"
|
||||||
|
#include "initConvergenceCheck.H"
|
||||||
|
#include "solveSolid.H"
|
||||||
|
#include "convergenceCheck.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
runTime++;
|
||||||
|
|
||||||
|
runTime.write();
|
||||||
|
|
||||||
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
|
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||||
|
<< nl << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,168 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "solidWallHeatFluxTemperatureFvPatchScalarField.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "fvPatchFieldMapper.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
|
||||||
|
solidWallHeatFluxTemperatureFvPatchScalarField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchScalarField(p, iF),
|
||||||
|
q_(p.size(), 0.0),
|
||||||
|
KName_("undefined-K")
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
|
||||||
|
solidWallHeatFluxTemperatureFvPatchScalarField
|
||||||
|
(
|
||||||
|
const solidWallHeatFluxTemperatureFvPatchScalarField& ptf,
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<scalar, volMesh>& iF,
|
||||||
|
const fvPatchFieldMapper& mapper
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
||||||
|
q_(ptf.q_, mapper),
|
||||||
|
KName_(ptf.KName_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
|
||||||
|
solidWallHeatFluxTemperatureFvPatchScalarField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<scalar, volMesh>& iF,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchScalarField(p, iF, dict),
|
||||||
|
q_("q", dict, p.size()),
|
||||||
|
KName_(dict.lookup("K"))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
|
||||||
|
solidWallHeatFluxTemperatureFvPatchScalarField
|
||||||
|
(
|
||||||
|
const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchScalarField(tppsf),
|
||||||
|
q_(tppsf.q_),
|
||||||
|
KName_(tppsf.KName_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
|
||||||
|
solidWallHeatFluxTemperatureFvPatchScalarField
|
||||||
|
(
|
||||||
|
const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf,
|
||||||
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchScalarField(tppsf, iF),
|
||||||
|
q_(tppsf.q_),
|
||||||
|
KName_(tppsf.KName_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::autoMap
|
||||||
|
(
|
||||||
|
const fvPatchFieldMapper& m
|
||||||
|
)
|
||||||
|
{
|
||||||
|
fixedValueFvPatchScalarField::autoMap(m);
|
||||||
|
q_.autoMap(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::rmap
|
||||||
|
(
|
||||||
|
const fvPatchScalarField& ptf,
|
||||||
|
const labelList& addr
|
||||||
|
)
|
||||||
|
{
|
||||||
|
fixedValueFvPatchScalarField::rmap(ptf, addr);
|
||||||
|
|
||||||
|
const solidWallHeatFluxTemperatureFvPatchScalarField& hfptf =
|
||||||
|
refCast<const solidWallHeatFluxTemperatureFvPatchScalarField>(ptf);
|
||||||
|
|
||||||
|
q_.rmap(hfptf.q_, addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
|
||||||
|
{
|
||||||
|
if (updated())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const scalarField& Kw =
|
||||||
|
patch().lookupPatchField<volScalarField, scalar>(KName_);
|
||||||
|
|
||||||
|
const fvPatchScalarField& Tw = *this;
|
||||||
|
|
||||||
|
operator==(q_/(patch().deltaCoeffs()*Kw) + Tw.patchInternalField());
|
||||||
|
|
||||||
|
fixedValueFvPatchScalarField::updateCoeffs();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::write
|
||||||
|
(
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
fixedValueFvPatchScalarField::write(os);
|
||||||
|
q_.writeEntry("q", os);
|
||||||
|
os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
makePatchTypeField
|
||||||
|
(
|
||||||
|
fvPatchScalarField,
|
||||||
|
solidWallHeatFluxTemperatureFvPatchScalarField
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,181 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Class
|
||||||
|
solidWallHeatFluxTemperatureFvPatchScalarField
|
||||||
|
|
||||||
|
Description
|
||||||
|
Heat flux boundary condition for temperature on solid region
|
||||||
|
|
||||||
|
Example usage:
|
||||||
|
myWallPatch
|
||||||
|
{
|
||||||
|
type solidWallHeatFluxTemperature;
|
||||||
|
K K; // Name of K field
|
||||||
|
q uniform 1000; // Heat flux / [W/m2]
|
||||||
|
value 300.0; // Initial temperature / [K]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
solidWallHeatFluxTemperatureFvPatchScalarField.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H
|
||||||
|
#define solidWallHeatFluxTemperatureFvPatchScalarField_H
|
||||||
|
|
||||||
|
#include "fixedValueFvPatchFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class solidWallHeatFluxTemperatureFvPatchScalarField Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class solidWallHeatFluxTemperatureFvPatchScalarField
|
||||||
|
:
|
||||||
|
public fixedValueFvPatchScalarField
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Heat flux / [W/m2]
|
||||||
|
scalarField q_;
|
||||||
|
|
||||||
|
//- Name of thermal conductivity field
|
||||||
|
word KName_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("solidWallHeatFluxTemperature");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from patch and internal field
|
||||||
|
solidWallHeatFluxTemperatureFvPatchScalarField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<scalar, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from patch, internal field and dictionary
|
||||||
|
solidWallHeatFluxTemperatureFvPatchScalarField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<scalar, volMesh>&,
|
||||||
|
const dictionary&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct by mapping given
|
||||||
|
// solidWallHeatFluxTemperatureFvPatchScalarField
|
||||||
|
// onto a new patch
|
||||||
|
solidWallHeatFluxTemperatureFvPatchScalarField
|
||||||
|
(
|
||||||
|
const solidWallHeatFluxTemperatureFvPatchScalarField&,
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<scalar, volMesh>&,
|
||||||
|
const fvPatchFieldMapper&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct as copy
|
||||||
|
solidWallHeatFluxTemperatureFvPatchScalarField
|
||||||
|
(
|
||||||
|
const solidWallHeatFluxTemperatureFvPatchScalarField&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
virtual tmp<fvPatchScalarField> clone() const
|
||||||
|
{
|
||||||
|
return tmp<fvPatchScalarField>
|
||||||
|
(
|
||||||
|
new solidWallHeatFluxTemperatureFvPatchScalarField(*this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Construct as copy setting internal field reference
|
||||||
|
solidWallHeatFluxTemperatureFvPatchScalarField
|
||||||
|
(
|
||||||
|
const solidWallHeatFluxTemperatureFvPatchScalarField&,
|
||||||
|
const DimensionedField<scalar, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone setting internal field reference
|
||||||
|
virtual tmp<fvPatchScalarField> clone
|
||||||
|
(
|
||||||
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<fvPatchScalarField>
|
||||||
|
(
|
||||||
|
new solidWallHeatFluxTemperatureFvPatchScalarField(*this, iF)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
// Evaluation functions
|
||||||
|
|
||||||
|
//- Update the coefficients associated with the patch field
|
||||||
|
virtual void updateCoeffs();
|
||||||
|
|
||||||
|
|
||||||
|
// Mapping functions
|
||||||
|
|
||||||
|
//- Map (and resize as needed) from self given a mapping object
|
||||||
|
virtual void autoMap
|
||||||
|
(
|
||||||
|
const fvPatchFieldMapper&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Reverse map the given fvPatchField onto this fvPatchField
|
||||||
|
virtual void rmap
|
||||||
|
(
|
||||||
|
const fvPatchScalarField&,
|
||||||
|
const labelList&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// I-O
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
void write(Ostream&) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
// Solve the Momentum equation
|
||||||
|
tmp<fvVectorMatrix> UEqn
|
||||||
|
(
|
||||||
|
fvm::div(phi, U)
|
||||||
|
- fvm::Sp(fvc::div(phi), U)
|
||||||
|
+ turb.divDevRhoReff(U)
|
||||||
|
);
|
||||||
|
|
||||||
|
UEqn().relax();
|
||||||
|
|
||||||
|
eqnResidual = solve
|
||||||
|
(
|
||||||
|
UEqn()
|
||||||
|
==
|
||||||
|
fvc::reconstruct
|
||||||
|
(
|
||||||
|
fvc::interpolate(rho)*(g & mesh.Sf())
|
||||||
|
- fvc::snGrad(p)*mesh.magSf()
|
||||||
|
)
|
||||||
|
).initialResidual();
|
||||||
|
|
||||||
|
maxResidual = max(eqnResidual, maxResidual);
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
dimensionedScalar totalMass = fvc::domainIntegrate(rho);
|
||||||
|
|
||||||
|
scalar sumLocalContErr =
|
||||||
|
(
|
||||||
|
fvc::domainIntegrate(mag(rho - thermo.rho()))/totalMass
|
||||||
|
).value();
|
||||||
|
|
||||||
|
scalar globalContErr =
|
||||||
|
(
|
||||||
|
fvc::domainIntegrate(rho - thermo.rho())/totalMass
|
||||||
|
).value();
|
||||||
|
|
||||||
|
cumulativeContErr[i] += globalContErr;
|
||||||
|
|
||||||
|
Info<< "time step continuity errors (" << mesh.name() << ")"
|
||||||
|
<< ": sum local = " << sumLocalContErr
|
||||||
|
<< ", global = " << globalContErr
|
||||||
|
<< ", cumulative = " << cumulativeContErr[i]
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
@ -22,39 +22,42 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "error.H"
|
#include "compressibleCourantNo.H"
|
||||||
#include "blockMesh.H"
|
#include "fvc.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
Foam::scalar Foam::compressibleCourantNo
|
||||||
|
(
|
||||||
Foam::labelList Foam::blockMesh::createBlockOffsets()
|
const fvMesh& mesh,
|
||||||
|
const Time& runTime,
|
||||||
|
const volScalarField& rho,
|
||||||
|
const surfaceScalarField& phi
|
||||||
|
)
|
||||||
{
|
{
|
||||||
Info<< nl << "Creating block offsets" << endl;
|
scalar CoNum = 0.0;
|
||||||
|
scalar meanCoNum = 0.0;
|
||||||
|
|
||||||
blockMesh& blocks = *this;
|
//- Can have fluid domains with 0 cells so do not test.
|
||||||
|
//if (mesh.nInternalFaces())
|
||||||
nPoints_ = blocks[0].points().size();
|
|
||||||
nCells_ = blocks[0].cells().size();
|
|
||||||
|
|
||||||
labelList BlockOffsets(blocks.size());
|
|
||||||
BlockOffsets[0] = 0;
|
|
||||||
|
|
||||||
label blockLabel;
|
|
||||||
for (blockLabel=1; blockLabel<blocks.size(); blockLabel++)
|
|
||||||
{
|
{
|
||||||
nPoints_ += blocks[blockLabel].points().size();
|
surfaceScalarField SfUfbyDelta =
|
||||||
nCells_ += blocks[blockLabel].cells().size();
|
mesh.surfaceInterpolation::deltaCoeffs()
|
||||||
|
* mag(phi)
|
||||||
|
/ fvc::interpolate(rho);
|
||||||
|
|
||||||
BlockOffsets[blockLabel]
|
CoNum = max(SfUfbyDelta/mesh.magSf())
|
||||||
= BlockOffsets[blockLabel-1]
|
.value()*runTime.deltaT().value();
|
||||||
+ blocks[blockLabel-1].points().size();
|
|
||||||
|
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
||||||
|
.value()*runTime.deltaT().value();
|
||||||
}
|
}
|
||||||
|
|
||||||
return BlockOffsets;
|
Info<< "Region: " << mesh.name() << " Courant Number mean: " << meanCoNum
|
||||||
|
<< " max: " << CoNum << endl;
|
||||||
|
|
||||||
|
return CoNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -23,27 +23,27 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
Calculates and outputs the mean and maximum Courant Numbers for the fluid
|
||||||
|
regions
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include <ctype.h>
|
#ifndef compressibleCourantNo_H
|
||||||
|
#define compressibleCourantNo_H
|
||||||
|
|
||||||
#include "vtkFoamData.h"
|
#include "fvMesh.H"
|
||||||
#include "vtkObjectFactory.h"
|
|
||||||
|
|
||||||
vtkCxxRevisionMacro(vtkFoamData, "$Revision: 1.20 $");
|
namespace Foam
|
||||||
vtkStandardNewMacro(vtkFoamData);
|
{
|
||||||
|
scalar compressibleCourantNo
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
(
|
||||||
|
const fvMesh& mesh,
|
||||||
vtkFoamData::vtkFoamData()
|
const Time& runTime,
|
||||||
{}
|
const volScalarField& rho,
|
||||||
|
const surfaceScalarField& phi
|
||||||
|
);
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
}
|
||||||
|
|
||||||
vtkFoamData::~vtkFoamData()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
scalar CoNum = -GREAT;
|
||||||
|
forAll(fluidRegions, regionI)
|
||||||
|
{
|
||||||
|
CoNum = max
|
||||||
|
(
|
||||||
|
compressibleCourantNo
|
||||||
|
(
|
||||||
|
fluidRegions[regionI],
|
||||||
|
runTime,
|
||||||
|
rhoFluid[regionI],
|
||||||
|
phiFluid[regionI]
|
||||||
|
),
|
||||||
|
CoNum
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
// check convergence
|
||||||
|
Info<< "maxResidual: " << maxResidual
|
||||||
|
<< " convergence criterion: " << convergenceCriterion
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
if (maxResidual < convergenceCriterion)
|
||||||
|
{
|
||||||
|
Info<< "reached convergence criterion: " << convergenceCriterion << endl;
|
||||||
|
runTime.writeAndEnd();
|
||||||
|
Info<< "latestTime = " << runTime.timeName() << endl;
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,144 @@
|
|||||||
|
// Initialise fluid field pointer lists
|
||||||
|
PtrList<basicPsiThermo> thermoFluid(fluidRegions.size());
|
||||||
|
PtrList<volScalarField> rhoFluid(fluidRegions.size());
|
||||||
|
PtrList<volScalarField> KFluid(fluidRegions.size());
|
||||||
|
PtrList<volVectorField> UFluid(fluidRegions.size());
|
||||||
|
PtrList<surfaceScalarField> phiFluid(fluidRegions.size());
|
||||||
|
PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size());
|
||||||
|
PtrList<compressible::turbulenceModel> turbulence(fluidRegions.size());
|
||||||
|
PtrList<volScalarField> DpDtf(fluidRegions.size());
|
||||||
|
|
||||||
|
List<scalar> initialMassFluid(fluidRegions.size());
|
||||||
|
List<label> pRefCellFluid(fluidRegions.size(),0);
|
||||||
|
List<scalar> pRefValueFluid(fluidRegions.size(),0.0);
|
||||||
|
|
||||||
|
|
||||||
|
// Populate fluid field pointer lists
|
||||||
|
forAll(fluidRegions, i)
|
||||||
|
{
|
||||||
|
Info<< "*** Reading fluid mesh thermophysical properties for region "
|
||||||
|
<< fluidRegions[i].name() << nl << endl;
|
||||||
|
|
||||||
|
Info<< " Adding to thermoFluid\n" << endl;
|
||||||
|
|
||||||
|
thermoFluid.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
basicPsiThermo::New(fluidRegions[i]).ptr()
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< " Adding to rhoFluid\n" << endl;
|
||||||
|
rhoFluid.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"rho",
|
||||||
|
runTime.timeName(),
|
||||||
|
fluidRegions[i],
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
thermoFluid[i].rho()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< " Adding to KFluid\n" << endl;
|
||||||
|
KFluid.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"K",
|
||||||
|
runTime.timeName(),
|
||||||
|
fluidRegions[i],
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
thermoFluid[i].Cp()*thermoFluid[i].alpha()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< " Adding to UFluid\n" << endl;
|
||||||
|
UFluid.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new volVectorField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"U",
|
||||||
|
runTime.timeName(),
|
||||||
|
fluidRegions[i],
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
fluidRegions[i]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< " Adding to phiFluid\n" << endl;
|
||||||
|
phiFluid.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new surfaceScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"phi",
|
||||||
|
runTime.timeName(),
|
||||||
|
fluidRegions[i],
|
||||||
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
linearInterpolate(rhoFluid[i]*UFluid[i])
|
||||||
|
& fluidRegions[i].Sf()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< " Adding to gFluid\n" << endl;
|
||||||
|
gFluid.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new uniformDimensionedVectorField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"g",
|
||||||
|
runTime.constant(),
|
||||||
|
fluidRegions[i],
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< " Adding to turbulence\n" << endl;
|
||||||
|
turbulence.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
compressible::turbulenceModel::New
|
||||||
|
(
|
||||||
|
rhoFluid[i],
|
||||||
|
UFluid[i],
|
||||||
|
phiFluid[i],
|
||||||
|
thermoFluid[i]
|
||||||
|
).ptr()
|
||||||
|
);
|
||||||
|
|
||||||
|
initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value();
|
||||||
|
|
||||||
|
setRefCell
|
||||||
|
(
|
||||||
|
thermoFluid[i].p(),
|
||||||
|
fluidRegions[i].solutionDict().subDict("SIMPLE"),
|
||||||
|
pRefCellFluid[i],
|
||||||
|
pRefValueFluid[i]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
PtrList<fvMesh> fluidRegions(rp.fluidRegionNames().size());
|
||||||
|
|
||||||
|
forAll(rp.fluidRegionNames(), i)
|
||||||
|
{
|
||||||
|
Info<< "Create fluid mesh for region " << rp.fluidRegionNames()[i]
|
||||||
|
<< " for time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
|
fluidRegions.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new fvMesh
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
rp.fluidRegionNames()[i],
|
||||||
|
runTime.timeName(),
|
||||||
|
runTime,
|
||||||
|
IOobject::MUST_READ
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
fvScalarMatrix hEqn
|
||||||
|
(
|
||||||
|
fvm::div(phi, h)
|
||||||
|
- fvm::Sp(fvc::div(phi), h)
|
||||||
|
- fvm::laplacian(turb.alphaEff(), h)
|
||||||
|
==
|
||||||
|
fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p))
|
||||||
|
- p*fvc::div(phi/fvc::interpolate(rho))
|
||||||
|
);
|
||||||
|
|
||||||
|
hEqn.relax();
|
||||||
|
|
||||||
|
eqnResidual = hEqn.solve().initialResidual();
|
||||||
|
maxResidual = max(eqnResidual, maxResidual);
|
||||||
|
|
||||||
|
thermo.correct();
|
||||||
|
|
||||||
|
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
|
||||||
|
<< max(thermo.T()).value() << endl;
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
// initialize values for convergence checks
|
||||||
|
|
||||||
|
scalar eqnResidual = 1, maxResidual = 0;
|
||||||
|
scalar convergenceCriterion = 0;
|
||||||
|
|
||||||
|
simple.readIfPresent("convergence", convergenceCriterion);
|
||||||
|
|
||||||
@ -0,0 +1,74 @@
|
|||||||
|
{
|
||||||
|
// From buoyantSimpleFoam
|
||||||
|
|
||||||
|
rho = thermo.rho();
|
||||||
|
|
||||||
|
volScalarField rUA = 1.0/UEqn().A();
|
||||||
|
surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
|
||||||
|
|
||||||
|
U = rUA*UEqn().H();
|
||||||
|
UEqn.clear();
|
||||||
|
|
||||||
|
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
|
||||||
|
bool closedVolume = adjustPhi(phi, U, p);
|
||||||
|
|
||||||
|
surfaceScalarField buoyancyPhi =
|
||||||
|
rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf());
|
||||||
|
phi += buoyancyPhi;
|
||||||
|
|
||||||
|
// Solve pressure
|
||||||
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||||
|
{
|
||||||
|
fvScalarMatrix pEqn
|
||||||
|
(
|
||||||
|
fvm::laplacian(rhorUAf, p) == fvc::div(phi)
|
||||||
|
);
|
||||||
|
|
||||||
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
|
|
||||||
|
// retain the residual from the first iteration
|
||||||
|
if (nonOrth == 0)
|
||||||
|
{
|
||||||
|
eqnResidual = pEqn.solve().initialResidual();
|
||||||
|
maxResidual = max(eqnResidual, maxResidual);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pEqn.solve();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nonOrth == nNonOrthCorr)
|
||||||
|
{
|
||||||
|
// 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate the conservative fluxes
|
||||||
|
phi -= pEqn.flux();
|
||||||
|
|
||||||
|
// Explicitly relax pressure for momentum corrector
|
||||||
|
p.relax();
|
||||||
|
|
||||||
|
// Correct the momentum source with the pressure gradient flux
|
||||||
|
// calculated from the relaxed pressure
|
||||||
|
U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rhorUAf);
|
||||||
|
U.correctBoundaryConditions();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#include "continuityErrs.H"
|
||||||
|
|
||||||
|
rho = thermo.rho();
|
||||||
|
rho.relax();
|
||||||
|
|
||||||
|
Info<< "Min/max rho:" << min(rho).value() << ' '
|
||||||
|
<< max(rho).value() << endl;
|
||||||
|
|
||||||
|
// Update thermal conductivity
|
||||||
|
K = thermo.Cp()*turb.alphaEff();
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
dictionary simple = fluidRegions[i].solutionDict().subDict("SIMPLE");
|
||||||
|
|
||||||
|
int nNonOrthCorr = 0;
|
||||||
|
if (simple.found("nNonOrthogonalCorrectors"))
|
||||||
|
{
|
||||||
|
nNonOrthCorr = readInt(simple.lookup("nNonOrthogonalCorrectors"));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool momentumPredictor = true;
|
||||||
|
if (simple.found("momentumPredictor"))
|
||||||
|
{
|
||||||
|
momentumPredictor = Switch(simple.lookup("momentumPredictor"));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool fluxGradp = false;
|
||||||
|
if (simple.found("fluxGradp"))
|
||||||
|
{
|
||||||
|
fluxGradp = Switch(simple.lookup("fluxGradp"));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool transonic = false;
|
||||||
|
if (simple.found("transonic"))
|
||||||
|
{
|
||||||
|
transonic = Switch(simple.lookup("transonic"));
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
const fvMesh& mesh = fluidRegions[i];
|
||||||
|
|
||||||
|
basicPsiThermo& thermo = thermoFluid[i];
|
||||||
|
volScalarField& rho = rhoFluid[i];
|
||||||
|
volScalarField& K = KFluid[i];
|
||||||
|
volVectorField& U = UFluid[i];
|
||||||
|
surfaceScalarField& phi = phiFluid[i];
|
||||||
|
const dimensionedVector& g = gFluid[i];
|
||||||
|
|
||||||
|
compressible::turbulenceModel& turb = turbulence[i];
|
||||||
|
|
||||||
|
volScalarField& p = thermo.p();
|
||||||
|
const volScalarField& psi = thermo.psi();
|
||||||
|
volScalarField& h = thermo.h();
|
||||||
|
|
||||||
|
const dimensionedScalar initialMass
|
||||||
|
(
|
||||||
|
"initialMass",
|
||||||
|
dimMass,
|
||||||
|
initialMassFluid[i]
|
||||||
|
);
|
||||||
|
|
||||||
|
const label pRefCell = pRefCellFluid[i];
|
||||||
|
const scalar pRefValue = pRefValueFluid[i];
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
// Pressure-velocity SIMPLE corrector
|
||||||
|
|
||||||
|
p.storePrevIter();
|
||||||
|
rho.storePrevIter();
|
||||||
|
{
|
||||||
|
#include "UEqn.H"
|
||||||
|
#include "hEqn.H"
|
||||||
|
#include "pEqn.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
turb.correct();
|
||||||
@ -0,0 +1,91 @@
|
|||||||
|
// Initialise solid field pointer lists
|
||||||
|
PtrList<volScalarField> rhos(solidRegions.size());
|
||||||
|
PtrList<volScalarField> cps(solidRegions.size());
|
||||||
|
PtrList<volScalarField> rhosCps(solidRegions.size());
|
||||||
|
PtrList<volScalarField> Ks(solidRegions.size());
|
||||||
|
PtrList<volScalarField> Ts(solidRegions.size());
|
||||||
|
|
||||||
|
// Populate solid field pointer lists
|
||||||
|
forAll(solidRegions, i)
|
||||||
|
{
|
||||||
|
Info<< "*** Reading solid mesh thermophysical properties for region "
|
||||||
|
<< solidRegions[i].name() << nl << endl;
|
||||||
|
|
||||||
|
Info<< " Adding to rhos\n" << endl;
|
||||||
|
rhos.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"rho",
|
||||||
|
runTime.timeName(),
|
||||||
|
solidRegions[i],
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
solidRegions[i]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< " Adding to cps\n" << endl;
|
||||||
|
cps.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"cp",
|
||||||
|
runTime.timeName(),
|
||||||
|
solidRegions[i],
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
solidRegions[i]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
rhosCps.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new volScalarField("rhosCps", rhos[i]*cps[i])
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< " Adding to Ks\n" << endl;
|
||||||
|
Ks.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"K",
|
||||||
|
runTime.timeName(),
|
||||||
|
solidRegions[i],
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
solidRegions[i]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< " Adding to Ts\n" << endl;
|
||||||
|
Ts.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"T",
|
||||||
|
runTime.timeName(),
|
||||||
|
solidRegions[i],
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
solidRegions[i]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
PtrList<fvMesh> solidRegions(rp.solidRegionNames().size());
|
||||||
|
|
||||||
|
forAll(rp.solidRegionNames(), i)
|
||||||
|
{
|
||||||
|
Info<< "Create solid mesh for region " << rp.solidRegionNames()[i]
|
||||||
|
<< " for time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
|
solidRegions.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new fvMesh
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
rp.solidRegionNames()[i],
|
||||||
|
runTime.timeName(),
|
||||||
|
runTime,
|
||||||
|
IOobject::MUST_READ
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Force calculation of geometric properties to prevent it being done
|
||||||
|
// later in e.g. some boundary evaluation
|
||||||
|
//(void)solidRegions[i].weights();
|
||||||
|
//(void)solidRegions[i].deltaCoeffs();
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
dictionary simple = solidRegions[i].solutionDict().subDict("SIMPLE");
|
||||||
|
|
||||||
|
int nNonOrthCorr = 0;
|
||||||
|
if (simple.found("nNonOrthogonalCorrectors"))
|
||||||
|
{
|
||||||
|
nNonOrthCorr = readInt(simple.lookup("nNonOrthogonalCorrectors"));
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
fvMesh& mesh = solidRegions[i];
|
||||||
|
|
||||||
|
volScalarField& rho = rhos[i];
|
||||||
|
volScalarField& cp = cps[i];
|
||||||
|
volScalarField& K = Ks[i];
|
||||||
|
volScalarField& T = Ts[i];
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||||
|
{
|
||||||
|
fvScalarMatrix tEqn
|
||||||
|
(
|
||||||
|
-fvm::laplacian(K, T)
|
||||||
|
);
|
||||||
|
tEqn.relax();
|
||||||
|
eqnResidual = tEqn.solve().initialResidual();
|
||||||
|
maxResidual = max(eqnResidual, maxResidual);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Min/max T:" << min(T).value() << ' '
|
||||||
|
<< max(T).value() << endl;
|
||||||
|
}
|
||||||
@ -7,8 +7,7 @@
|
|||||||
scalar epsilon = turbulence->epsilon()()[cellId];
|
scalar epsilon = turbulence->epsilon()()[cellId];
|
||||||
// scalar omega = turbulence->omega()()[cellId];
|
// scalar omega = turbulence->omega()()[cellId];
|
||||||
scalar k = turbulence->k()()[cellId];
|
scalar k = turbulence->k()()[cellId];
|
||||||
scalar Up =
|
scalar magUp = mag(U[cellId] - U.boundaryField()[patchId][faceId]);
|
||||||
flowDirection & (U[cellId] - U.boundaryField()[patchId][faceId]);
|
|
||||||
|
|
||||||
scalar tauw = flowDirection & R & wallNormal;
|
scalar tauw = flowDirection & R & wallNormal;
|
||||||
|
|
||||||
@ -16,7 +15,7 @@
|
|||||||
|
|
||||||
scalar yPlus = uTau*y[cellId]/(nu + ROOTVSMALL);
|
scalar yPlus = uTau*y[cellId]/(nu + ROOTVSMALL);
|
||||||
|
|
||||||
scalar uPlus = Up/(uTau + ROOTVSMALL);
|
scalar uPlus = magUp/(uTau + ROOTVSMALL);
|
||||||
|
|
||||||
scalar nutPlus = nut/nu;
|
scalar nutPlus = nut/nu;
|
||||||
|
|
||||||
@ -26,7 +25,7 @@
|
|||||||
|
|
||||||
// scalar omegaPlus = omega*nu/(sqr(uTau) + ROOTVSMALL);
|
// scalar omegaPlus = omega*nu/(sqr(uTau) + ROOTVSMALL);
|
||||||
|
|
||||||
scalar Rey = Up*y[cellId]/nu;
|
scalar Rey = magUp*y[cellId]/nu;
|
||||||
|
|
||||||
Info<< "Rey = " << Rey << ", uTau = " << uTau << ", nut+ = " << nutPlus
|
Info<< "Rey = " << Rey << ", uTau = " << uTau << ", nut+ = " << nutPlus
|
||||||
<< ", y+ = " << yPlus << ", u+ = " << uPlus
|
<< ", y+ = " << yPlus << ", u+ = " << uPlus
|
||||||
|
|||||||
@ -9,6 +9,7 @@ EXE_INC = \
|
|||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-ldynamicFvMesh \
|
-ldynamicFvMesh \
|
||||||
|
-ltopoChangerFvMesh \
|
||||||
-ldynamicMesh \
|
-ldynamicMesh \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
|||||||
@ -1,4 +1,26 @@
|
|||||||
{
|
{
|
||||||
|
if (mesh.changing())
|
||||||
|
{
|
||||||
|
forAll(U.boundaryField(), patchi)
|
||||||
|
{
|
||||||
|
if (U.boundaryField()[patchi].fixesValue())
|
||||||
|
{
|
||||||
|
U.boundaryField()[patchi].initEvaluate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(U.boundaryField(), patchi)
|
||||||
|
{
|
||||||
|
if (U.boundaryField()[patchi].fixesValue())
|
||||||
|
{
|
||||||
|
U.boundaryField()[patchi].evaluate();
|
||||||
|
|
||||||
|
phi.boundaryField()[patchi] =
|
||||||
|
U.boundaryField()[patchi] & mesh.Sf().boundaryField()[patchi];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wordList pcorrTypes
|
wordList pcorrTypes
|
||||||
(
|
(
|
||||||
p.boundaryField().size(),
|
p.boundaryField().size(),
|
||||||
|
|||||||
@ -0,0 +1,3 @@
|
|||||||
|
porousSimpleFoam.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_APPBIN)/porousSimpleFoam
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I../simpleFoam \
|
||||||
|
-I$(LIB_SRC)/turbulenceModels \
|
||||||
|
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
|
||||||
|
-I$(LIB_SRC)/transportModels \
|
||||||
|
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude
|
||||||
|
|
||||||
|
EXE_LIBS = \
|
||||||
|
-lincompressibleRASModels \
|
||||||
|
-lincompressibleTransportModels \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-lmeshTools
|
||||||
47
applications/solvers/incompressible/porousSimpleFoam/UEqn.H
Normal file
47
applications/solvers/incompressible/porousSimpleFoam/UEqn.H
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
// Construct the Momentum equation
|
||||||
|
|
||||||
|
tmp<fvVectorMatrix> UEqn
|
||||||
|
(
|
||||||
|
fvm::div(phi, U)
|
||||||
|
- fvm::Sp(fvc::div(phi), U)
|
||||||
|
+ turbulence->divDevReff(U)
|
||||||
|
);
|
||||||
|
|
||||||
|
UEqn().relax();
|
||||||
|
|
||||||
|
// Include the porous media resistance and solve the momentum equation
|
||||||
|
// either implicit in the tensorial resistance or transport using by
|
||||||
|
// including the spherical part of the resistance in the momentum diagonal
|
||||||
|
|
||||||
|
tmp<volScalarField> trAU;
|
||||||
|
tmp<volTensorField> trTU;
|
||||||
|
|
||||||
|
if (pressureImplicitPorosity)
|
||||||
|
{
|
||||||
|
tmp<volTensorField> tTU = tensor(I)*UEqn().A();
|
||||||
|
pZones.addResistance(UEqn(), tTU());
|
||||||
|
trTU = inv(tTU());
|
||||||
|
trTU().rename("rAU");
|
||||||
|
|
||||||
|
volVectorField gradp = fvc::grad(p);
|
||||||
|
|
||||||
|
for (int UCorr=0; UCorr<nUCorr; UCorr++)
|
||||||
|
{
|
||||||
|
U = trTU() & (UEqn().H() - gradp);
|
||||||
|
}
|
||||||
|
U.correctBoundaryConditions();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pZones.addResistance(UEqn());
|
||||||
|
|
||||||
|
eqnResidual = solve
|
||||||
|
(
|
||||||
|
UEqn() == -fvc::grad(p)
|
||||||
|
). initialResidual();
|
||||||
|
|
||||||
|
maxResidual = max(eqnResidual, maxResidual);
|
||||||
|
|
||||||
|
trAU = 1.0/UEqn().A();
|
||||||
|
trAU().rename("rAU");
|
||||||
|
}
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
Info << "Reading field p\n" << endl;
|
||||||
|
volScalarField p
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"p",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Info << "Reading field U\n" << endl;
|
||||||
|
volVectorField U
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"U",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
# include "createPhi.H"
|
||||||
|
|
||||||
|
|
||||||
|
label pRefCell = 0;
|
||||||
|
scalar pRefValue = 0.0;
|
||||||
|
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
|
||||||
|
|
||||||
|
|
||||||
|
singlePhaseTransportModel laminarTransport(U, phi);
|
||||||
|
|
||||||
|
autoPtr<incompressible::RASModel> turbulence
|
||||||
|
(
|
||||||
|
incompressible::RASModel::New(U, phi, laminarTransport)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
porousZones pZones(mesh);
|
||||||
|
Switch pressureImplicitPorosity(false);
|
||||||
|
|
||||||
|
int nUCorr = 0;
|
||||||
|
if (pZones.size())
|
||||||
|
{
|
||||||
|
// nUCorrectors for pressureImplicitPorosity
|
||||||
|
if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors"))
|
||||||
|
{
|
||||||
|
nUCorr = readInt
|
||||||
|
(
|
||||||
|
mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nUCorr > 0)
|
||||||
|
{
|
||||||
|
pressureImplicitPorosity = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
59
applications/solvers/incompressible/porousSimpleFoam/pEqn.H
Normal file
59
applications/solvers/incompressible/porousSimpleFoam/pEqn.H
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
if (pressureImplicitPorosity)
|
||||||
|
{
|
||||||
|
U = trTU()&UEqn().H();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
U = trAU()*UEqn().H();
|
||||||
|
}
|
||||||
|
|
||||||
|
UEqn.clear();
|
||||||
|
phi = fvc::interpolate(U) & mesh.Sf();
|
||||||
|
adjustPhi(phi, U, p);
|
||||||
|
|
||||||
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||||
|
{
|
||||||
|
tmp<fvScalarMatrix> tpEqn;
|
||||||
|
|
||||||
|
if (pressureImplicitPorosity)
|
||||||
|
{
|
||||||
|
tpEqn = (fvm::laplacian(trTU(), p) == fvc::div(phi));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tpEqn = (fvm::laplacian(trAU(), p) == fvc::div(phi));
|
||||||
|
}
|
||||||
|
|
||||||
|
tpEqn().setReference(pRefCell, pRefValue);
|
||||||
|
// retain the residual from the first iteration
|
||||||
|
if (nonOrth == 0)
|
||||||
|
{
|
||||||
|
eqnResidual = tpEqn().solve().initialResidual();
|
||||||
|
maxResidual = max(eqnResidual, maxResidual);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tpEqn().solve();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nonOrth == nNonOrthCorr)
|
||||||
|
{
|
||||||
|
phi -= tpEqn().flux();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "continuityErrs.H"
|
||||||
|
|
||||||
|
// Explicitly relax pressure for momentum corrector
|
||||||
|
p.relax();
|
||||||
|
|
||||||
|
if (pressureImplicitPorosity)
|
||||||
|
{
|
||||||
|
U -= trTU()&fvc::grad(p);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
U -= trAU()*fvc::grad(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
U.correctBoundaryConditions();
|
||||||
@ -0,0 +1,85 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Application
|
||||||
|
porousSimpleFoam
|
||||||
|
|
||||||
|
Description
|
||||||
|
Steady-state solver for incompressible, turbulent flow with
|
||||||
|
implicit or explicit porosity treatment
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "fvCFD.H"
|
||||||
|
#include "singlePhaseTransportModel.H"
|
||||||
|
#include "RASModel.H"
|
||||||
|
#include "porousZones.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
#include "setRootCase.H"
|
||||||
|
#include "createTime.H"
|
||||||
|
#include "createMesh.H"
|
||||||
|
#include "createFields.H"
|
||||||
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
|
while (runTime.loop())
|
||||||
|
{
|
||||||
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
|
#include "readSIMPLEControls.H"
|
||||||
|
#include "initConvergenceCheck.H"
|
||||||
|
|
||||||
|
p.storePrevIter();
|
||||||
|
|
||||||
|
// Pressure-velocity SIMPLE corrector
|
||||||
|
{
|
||||||
|
#include "UEqn.H"
|
||||||
|
#include "pEqn.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
turbulence->correct();
|
||||||
|
|
||||||
|
runTime.write();
|
||||||
|
|
||||||
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
|
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||||
|
<< nl << endl;
|
||||||
|
|
||||||
|
#include "convergenceCheck.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -42,10 +42,10 @@ if (mesh.nInternalFaces())
|
|||||||
*mag(phi)/fvc::interpolate(h);
|
*mag(phi)/fvc::interpolate(h);
|
||||||
|
|
||||||
CoNum = max(SfUfbyDelta/mesh.magSf())
|
CoNum = max(SfUfbyDelta/mesh.magSf())
|
||||||
.value()*runTime.deltaT().value();
|
.value()*runTime.deltaTValue();
|
||||||
|
|
||||||
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
||||||
.value()*runTime.deltaT().value();
|
.value()*runTime.deltaTValue();
|
||||||
|
|
||||||
// Gravity wave Courant number
|
// Gravity wave Courant number
|
||||||
waveCoNum =
|
waveCoNum =
|
||||||
@ -53,7 +53,7 @@ if (mesh.nInternalFaces())
|
|||||||
(
|
(
|
||||||
mesh.surfaceInterpolation::deltaCoeffs()
|
mesh.surfaceInterpolation::deltaCoeffs()
|
||||||
*sqrt(fvc::interpolate(h))
|
*sqrt(fvc::interpolate(h))
|
||||||
).value()*sqrt(magg).value()*runTime.deltaT().value();
|
).value()*sqrt(magg).value()*runTime.deltaTValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Courant number mean: " << meanCoNum
|
Info<< "Courant number mean: " << meanCoNum
|
||||||
|
|||||||
@ -90,7 +90,6 @@ int main(int argc, char *argv[])
|
|||||||
// --- PISO loop
|
// --- PISO loop
|
||||||
for (int corr=0; corr<nCorr; corr++)
|
for (int corr=0; corr<nCorr; corr++)
|
||||||
{
|
{
|
||||||
surfaceScalarField hf = fvc::interpolate(h);
|
|
||||||
volScalarField rUA = 1.0/hUEqn.A();
|
volScalarField rUA = 1.0/hUEqn.A();
|
||||||
surfaceScalarField ghrUAf = magg*fvc::interpolate(h*rUA);
|
surfaceScalarField ghrUAf = magg*fvc::interpolate(h*rUA);
|
||||||
|
|
||||||
|
|||||||
@ -14,4 +14,3 @@
|
|||||||
).initialResidual();
|
).initialResidual();
|
||||||
|
|
||||||
maxResidual = max(eqnResidual, maxResidual);
|
maxResidual = max(eqnResidual, maxResidual);
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
|
|||||||
label inertIndex = -1;
|
label inertIndex = -1;
|
||||||
volScalarField Yt = 0.0*Y[0];
|
volScalarField Yt = 0.0*Y[0];
|
||||||
|
|
||||||
for (label i=0; i<Y.size(); i++)
|
forAll(Y, i)
|
||||||
{
|
{
|
||||||
if (Y[i].name() != inertSpecie)
|
if (Y[i].name() != inertSpecie)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
chemistry.solve
|
chemistry.solve
|
||||||
(
|
(
|
||||||
runTime.value() - runTime.deltaT().value(),
|
runTime.value() - runTime.deltaTValue(),
|
||||||
runTime.deltaT().value()
|
runTime.deltaTValue()
|
||||||
);
|
);
|
||||||
|
|
||||||
// turbulent time scale
|
// turbulent time scale
|
||||||
|
|||||||
@ -38,7 +38,6 @@ Description
|
|||||||
#include "CoalCloud.H"
|
#include "CoalCloud.H"
|
||||||
#include "psiChemistryModel.H"
|
#include "psiChemistryModel.H"
|
||||||
#include "chemistrySolver.H"
|
#include "chemistrySolver.H"
|
||||||
#include "thermoPhysicsTypes.H"
|
|
||||||
#include "timeActivatedExplicitCellSource.H"
|
#include "timeActivatedExplicitCellSource.H"
|
||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
Info<< "\nConstructing coal cloud" << endl;
|
Info<< "\nConstructing coal cloud" << endl;
|
||||||
CoalCloud<gasThermoPhysics> coalParcels
|
thermoCoalCloud coalParcels
|
||||||
(
|
(
|
||||||
"coalCloud1",
|
"coalCloud1",
|
||||||
rho,
|
rho,
|
||||||
|
|||||||
@ -13,6 +13,14 @@
|
|||||||
|
|
||||||
word inertSpecie(thermo.lookup("inertSpecie"));
|
word inertSpecie(thermo.lookup("inertSpecie"));
|
||||||
|
|
||||||
|
if (!composition.contains(inertSpecie))
|
||||||
|
{
|
||||||
|
FatalErrorIn(args.executable())
|
||||||
|
<< "Specified inert specie '" << inertSpecie << "' not found in "
|
||||||
|
<< "species list. Available species:" << composition.species()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
volScalarField& p = thermo.p();
|
volScalarField& p = thermo.p();
|
||||||
volScalarField& h = thermo.h();
|
volScalarField& h = thermo.h();
|
||||||
const volScalarField& T = thermo.T();
|
const volScalarField& T = thermo.T();
|
||||||
|
|||||||
@ -15,7 +15,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
|
|||||||
label inertIndex = -1;
|
label inertIndex = -1;
|
||||||
volScalarField Yt = 0.0*Y[0];
|
volScalarField Yt = 0.0*Y[0];
|
||||||
|
|
||||||
for (label i=0; i<Y.size(); i++)
|
forAll(Y, i)
|
||||||
{
|
{
|
||||||
if (Y[i].name() != inertSpecie)
|
if (Y[i].name() != inertSpecie)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
chemistry.solve
|
chemistry.solve
|
||||||
(
|
(
|
||||||
runTime.value() - runTime.deltaT().value(),
|
runTime.value() - runTime.deltaTValue(),
|
||||||
runTime.deltaT().value()
|
runTime.deltaTValue()
|
||||||
);
|
);
|
||||||
|
|
||||||
// turbulent time scale
|
// turbulent time scale
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
Info<< "\nConstructing reacting cloud" << endl;
|
Info<< "\nConstructing reacting cloud" << endl;
|
||||||
BasicReactingCloud<icoPoly8ThermoPhysics> parcels
|
icoPoly8ThermoReactingCloud parcels
|
||||||
(
|
(
|
||||||
"reactingCloud1",
|
"reactingCloud1",
|
||||||
rho,
|
rho,
|
||||||
|
|||||||
@ -13,6 +13,14 @@
|
|||||||
|
|
||||||
word inertSpecie(thermo.lookup("inertSpecie"));
|
word inertSpecie(thermo.lookup("inertSpecie"));
|
||||||
|
|
||||||
|
if (!composition.contains(inertSpecie))
|
||||||
|
{
|
||||||
|
FatalErrorIn(args.executable())
|
||||||
|
<< "Specified inert specie '" << inertSpecie << "' not found in "
|
||||||
|
<< "species list. Available species:" << composition.species()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
volScalarField& p = thermo.p();
|
volScalarField& p = thermo.p();
|
||||||
volScalarField& h = thermo.h();
|
volScalarField& h = thermo.h();
|
||||||
const volScalarField& T = thermo.T();
|
const volScalarField& T = thermo.T();
|
||||||
|
|||||||
@ -46,7 +46,6 @@ Description
|
|||||||
#include "BasicReactingCloud.H"
|
#include "BasicReactingCloud.H"
|
||||||
#include "rhoChemistryModel.H"
|
#include "rhoChemistryModel.H"
|
||||||
#include "chemistrySolver.H"
|
#include "chemistrySolver.H"
|
||||||
#include "thermoPhysicsTypes.H"
|
|
||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
#include "porousZones.H"
|
#include "porousZones.H"
|
||||||
#include "timeActivatedExplicitMulticomponentPointSource.H"
|
#include "timeActivatedExplicitMulticomponentPointSource.H"
|
||||||
|
|||||||
@ -1,20 +1,5 @@
|
|||||||
dictionary additional = mesh.solutionDict().subDict("additional");
|
dictionary additional = mesh.solutionDict().subDict("additional");
|
||||||
|
|
||||||
bool dpdt = true;
|
bool dpdt = additional.lookupOrDefault("dpdt", true);
|
||||||
if (additional.found("dpdt"))
|
bool eWork = additional.lookupOrDefault("eWork", true);
|
||||||
{
|
bool hWork = additional.lookupOrDefault("hWork", true);
|
||||||
additional.lookup("dpdt") >> dpdt;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool eWork = true;
|
|
||||||
if (additional.found("eWork"))
|
|
||||||
{
|
|
||||||
additional.lookup("eWork") >> eWork;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hWork = true;
|
|
||||||
if (additional.found("hWork"))
|
|
||||||
{
|
|
||||||
additional.lookup("hWork") >> hWork;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
|
|||||||
label inertIndex = -1;
|
label inertIndex = -1;
|
||||||
volScalarField Yt = 0.0*Y[0];
|
volScalarField Yt = 0.0*Y[0];
|
||||||
|
|
||||||
for (label i=0; i<Y.size(); i++)
|
forAll(Y, i)
|
||||||
{
|
{
|
||||||
if (Y[i].name() != inertSpecie)
|
if (Y[i].name() != inertSpecie)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
chemistry.solve
|
chemistry.solve
|
||||||
(
|
(
|
||||||
runTime.value() - runTime.deltaT().value(),
|
runTime.value() - runTime.deltaTValue(),
|
||||||
runTime.deltaT().value()
|
runTime.deltaTValue()
|
||||||
);
|
);
|
||||||
|
|
||||||
// turbulent time scale
|
// turbulent time scale
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
Info<< "\nConstructing reacting cloud" << endl;
|
Info<< "\nConstructing reacting cloud" << endl;
|
||||||
BasicReactingCloud<gasThermoPhysics> parcels
|
thermoReactingCloud parcels
|
||||||
(
|
(
|
||||||
"reactingCloud1",
|
"reactingCloud1",
|
||||||
rho,
|
rho,
|
||||||
|
|||||||
@ -13,6 +13,14 @@
|
|||||||
|
|
||||||
word inertSpecie(thermo.lookup("inertSpecie"));
|
word inertSpecie(thermo.lookup("inertSpecie"));
|
||||||
|
|
||||||
|
if (!composition.contains(inertSpecie))
|
||||||
|
{
|
||||||
|
FatalErrorIn(args.executable())
|
||||||
|
<< "Specified inert specie '" << inertSpecie << "' not found in "
|
||||||
|
<< "species list. Available species:" << composition.species()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
volScalarField& p = thermo.p();
|
volScalarField& p = thermo.p();
|
||||||
volScalarField& h = thermo.h();
|
volScalarField& h = thermo.h();
|
||||||
const volScalarField& T = thermo.T();
|
const volScalarField& T = thermo.T();
|
||||||
|
|||||||
@ -37,7 +37,6 @@ Description
|
|||||||
#include "BasicReactingCloud.H"
|
#include "BasicReactingCloud.H"
|
||||||
#include "psiChemistryModel.H"
|
#include "psiChemistryModel.H"
|
||||||
#include "chemistrySolver.H"
|
#include "chemistrySolver.H"
|
||||||
#include "thermoPhysicsTypes.H"
|
|
||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
for (label i=0; i<Ua.boundaryField().size(); i++)
|
for (label i=0; i<Ua.boundaryField().size(); i++)
|
||||||
{
|
{
|
||||||
if (isType<fixedValueFvPatchVectorField>(Ua.boundaryField()[i]))
|
if (isA<fixedValueFvPatchVectorField>(Ua.boundaryField()[i]))
|
||||||
{
|
{
|
||||||
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
|
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
for (label i=0; i<Ub.boundaryField().size(); i++)
|
for (label i=0; i<Ub.boundaryField().size(); i++)
|
||||||
{
|
{
|
||||||
if (isType<fixedValueFvPatchVectorField>(Ub.boundaryField()[i]))
|
if (isA<fixedValueFvPatchVectorField>(Ub.boundaryField()[i]))
|
||||||
{
|
{
|
||||||
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
|
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user