Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2010-10-13 18:15:01 +01:00
24 changed files with 163 additions and 196 deletions

View File

@ -34,17 +34,14 @@ Description
if (mesh.nInternalFaces()) if (mesh.nInternalFaces())
{ {
surfaceScalarField SfUfbyDelta = scalarField sumPhi =
mesh.surfaceInterpolation::deltaCoeffs() fvc::surfaceSum(mag(phiSt))().internalField()
*mag(phiSt/fvc::interpolate(rho)); /rho.internalField();
StCoNum = StCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
max(SfUfbyDelta/mesh.magSf()).value()
*runTime.deltaTValue();
meanStCoNum = meanStCoNum =
(sum(SfUfbyDelta)/sum(mesh.magSf())).value() 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
*runTime.deltaTValue();
} }
Info<< "St courant Number mean: " << meanStCoNum Info<< "St courant Number mean: " << meanStCoNum

View File

@ -30,10 +30,10 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
{ {
scalar sumLocalContErr = runTime.deltaT().value()* scalar sumLocalContErr = runTime.deltaTValue()*
mag(fvc::div(phia))().weightedAverage(mesh.V()).value(); mag(fvc::div(phia))().weightedAverage(mesh.V()).value();
scalar globalContErr = runTime.deltaT().value()* scalar globalContErr = runTime.deltaTValue()*
fvc::div(phia)().weightedAverage(mesh.V()).value(); fvc::div(phia)().weightedAverage(mesh.V()).value();
cumulativeContErr += globalContErr; cumulativeContErr += globalContErr;

View File

@ -36,23 +36,23 @@ scalar waveCoNum = 0.0;
if (mesh.nInternalFaces()) if (mesh.nInternalFaces())
{ {
surfaceScalarField SfUfbyDelta = scalarField sumPhi =
mesh.surfaceInterpolation::deltaCoeffs() fvc::surfaceSum(mag(phi))().internalField()
*mag(phi)/fvc::interpolate(h); /h.internalField();
CoNum = max(SfUfbyDelta/mesh.magSf()) CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
.value()*runTime.deltaTValue();
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) meanCoNum =
.value()*runTime.deltaTValue(); 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
// Gravity wave Courant number // Gravity wave Courant number
waveCoNum = waveCoNum = 0.25*gMax
0.5*max (
fvc::surfaceSum
( (
mesh.surfaceInterpolation::deltaCoeffs() fvc::interpolate(sqrt(h))*mesh.magSf()
*sqrt(fvc::interpolate(h)) )().internalField()/mesh.V().field()
).value()*sqrt(magg).value()*runTime.deltaTValue(); )*sqrt(magg).value()*runTime.deltaTValue();
} }
Info<< "Courant number mean: " << meanCoNum Info<< "Courant number mean: " << meanCoNum

View File

@ -35,19 +35,21 @@ scalar acousticCoNum = 0.0;
if (mesh.nInternalFaces()) if (mesh.nInternalFaces())
{ {
surfaceScalarField SfUfbyDelta = scalarField sumPhi =
mesh.surfaceInterpolation::deltaCoeffs()*mag(phiv); fvc::surfaceSum(mag(phiv))().internalField();
CoNum = max(SfUfbyDelta/mesh.magSf()) CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
.value()*runTime.deltaTValue();
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) meanCoNum =
.value()*runTime.deltaTValue(); 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
acousticCoNum = max acousticCoNum = 0.5*gMax
( (
mesh.surfaceInterpolation::deltaCoeffs()/sqrt(fvc::interpolate(psi)) fvc::surfaceSum
).value()*runTime.deltaTValue(); (
fvc::interpolate(scalar(1)/sqrt(psi))*mesh.magSf()
)().internalField()/mesh.V().field()
)*runTime.deltaTValue();
} }
Info<< "phiv Courant Number mean: " << meanCoNum Info<< "phiv Courant Number mean: " << meanCoNum

View File

@ -86,7 +86,7 @@ int main(int argc, char *argv[])
<< nl << endl; << nl << endl;
} }
Info<< "\n end \n"; Info<< "End\n" << endl;
return 0; return 0;
} }

View File

@ -43,10 +43,10 @@ if (mesh.nInternalFaces())
pos(alpha1 - 0.01)*pos(0.99 - alpha1) pos(alpha1 - 0.01)*pos(0.99 - alpha1)
*fvc::surfaceSum(mag(phi))().internalField(); *fvc::surfaceSum(mag(phi))().internalField();
alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaT().value(); alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
meanAlphaCoNum = meanAlphaCoNum =
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaT().value(); 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
} }
Info<< "Interface Courant Number mean: " << meanAlphaCoNum Info<< "Interface Courant Number mean: " << meanAlphaCoNum

View File

@ -42,12 +42,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;
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -39,20 +39,16 @@ scalar meanAlphaCoNum = 0.0;
if (mesh.nInternalFaces()) if (mesh.nInternalFaces())
{ {
surfaceScalarField alpha1f = fvc::interpolate(alpha1); scalarField sumPhi = max
surfaceScalarField alpha2f = fvc::interpolate(alpha2);
surfaceScalarField SfUfbyDelta = max
( (
pos(alpha1f - 0.01)*pos(0.99 - alpha1f), pos(alpha1 - 0.01)*pos(0.99 - alpha1),
pos(alpha2f - 0.01)*pos(0.99 - alpha2f) pos(alpha2 - 0.01)*pos(0.99 - alpha2)
)*mesh.surfaceInterpolation::deltaCoeffs()*mag(phi); )*fvc::surfaceSum(mag(phi))().internalField();
alphaCoNum = max(SfUfbyDelta/mesh.magSf()) alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
.value()*runTime.deltaT().value();
meanAlphaCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) meanAlphaCoNum =
.value()*runTime.deltaT().value(); 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
} }
Info<< "Interface Courant Number mean: " << meanAlphaCoNum Info<< "Interface Courant Number mean: " << meanAlphaCoNum

View File

@ -39,15 +39,14 @@ scalar meanAlphaCoNum = 0.0;
if (mesh.nInternalFaces()) if (mesh.nInternalFaces())
{ {
surfaceScalarField SfUfbyDelta = scalarField sumPhi =
mixture.nearInterface() mixture.nearInterface()().internalField()
*mesh.surfaceInterpolation::deltaCoeffs()*mag(phi); *fvc::surfaceSum(mag(phi))().internalField();
alphaCoNum = max(SfUfbyDelta/mesh.magSf()) alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
.value()*runTime.deltaT().value();
meanAlphaCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) meanAlphaCoNum =
.value()*runTime.deltaT().value(); 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
} }
Info<< "Interface Courant Number mean: " << meanAlphaCoNum Info<< "Interface Courant Number mean: " << meanAlphaCoNum

View File

@ -457,12 +457,12 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::K
} }
Foam::tmp<Foam::surfaceScalarField> Foam::tmp<Foam::volScalarField>
Foam::multiphaseMixture::nearInterface() const Foam::multiphaseMixture::nearInterface() const
{ {
tmp<surfaceScalarField> tnearInt tmp<volScalarField> tnearInt
( (
new surfaceScalarField new volScalarField
( (
IOobject IOobject
( (
@ -477,8 +477,7 @@ Foam::multiphaseMixture::nearInterface() const
forAllConstIter(PtrDictionary<phase>, phases_, iter) forAllConstIter(PtrDictionary<phase>, phases_, iter)
{ {
surfaceScalarField alphaf = fvc::interpolate(iter()); tnearInt() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter()));
tnearInt() = max(tnearInt(), pos(alphaf - 0.01)*pos(0.99 - alphaf));
} }
return tnearInt; return tnearInt;

View File

@ -258,7 +258,7 @@ public:
//- Indicator of the proximity of the interface //- Indicator of the proximity of the interface
// Field values are 1 near and 0 away for the interface. // Field values are 1 near and 0 away for the interface.
tmp<surfaceScalarField> nearInterface() const; tmp<volScalarField> nearInterface() const;
//- Solve for the mixture phase-fractions //- Solve for the mixture phase-fractions
void solve(); void solve();

View File

@ -1,11 +1,10 @@
# include "CourantNo.H" # include "CourantNo.H"
{ {
scalar UrCoNum = max scalar UrCoNum = 0.5*gMax
( (
mesh.surfaceInterpolation::deltaCoeffs()*mag(phia - phib) fvc::surfaceSum(mag(phia - phib))().internalField()/mesh.V().field()
/mesh.magSf() )*runTime.deltaTValue();
).value()*runTime.deltaT().value();
Info<< "Max Ur Courant Number = " << UrCoNum << endl; Info<< "Max Ur Courant Number = " << UrCoNum << endl;

View File

@ -34,14 +34,13 @@ scalar meanMeshCoNum = 0.0;
if (mesh.nInternalFaces()) if (mesh.nInternalFaces())
{ {
surfaceScalarField SfUfbyDelta = scalarField sumPhi =
mesh.surfaceInterpolation::deltaCoeffs()*mag(mesh.phi()); fvc::surfaceSum(mag(mesh.phi()))().internalField();
meshCoNum = max(SfUfbyDelta/mesh.magSf()) meshCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
.value()*runTime.deltaTValue();
meanMeshCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) meanMeshCoNum =
.value()*runTime.deltaTValue(); 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
} }
Info<< "Mesh Courant Number mean: " << meanMeshCoNum Info<< "Mesh Courant Number mean: " << meanMeshCoNum

View File

@ -38,10 +38,10 @@ if (mesh.nInternalFaces())
fvc::surfaceSum(mag(phi))().internalField() fvc::surfaceSum(mag(phi))().internalField()
/rho.internalField(); /rho.internalField();
CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaT().value(); CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
meanCoNum = meanCoNum =
0.5*(gSum(sumPhi)/sum(mesh.V().field()))*runTime.deltaT().value(); 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
} }
Info<< "Courant Number mean: " << meanCoNum Info<< "Courant Number mean: " << meanCoNum

View File

@ -37,10 +37,10 @@ if (mesh.nInternalFaces())
scalarField sumPhi = scalarField sumPhi =
fvc::surfaceSum(mag(phi))().internalField(); fvc::surfaceSum(mag(phi))().internalField();
CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaT().value(); CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
meanCoNum = meanCoNum =
0.5*(gSum(sumPhi)/sum(mesh.V().field()))*runTime.deltaT().value(); 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
} }
Info<< "Courant Number mean: " << meanCoNum Info<< "Courant Number mean: " << meanCoNum

View File

@ -1,24 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "0/uniform/lagrangian/dsmc";
object particleProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
processor0
{
particleCount 63978;
}
// ************************************************************************* //

View File

@ -1,24 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "0/uniform/lagrangian/dsmc";
object particleProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
processor0
{
particleCount 63978;
}
// ************************************************************************* //

View File

@ -1,30 +0,0 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
(
cd throttle || exit
rm -rf constant/polyMesh/sets > /dev/null 2>&1
rm -rf 0/polyMesh > /dev/null 2>&1
rm system/topoSetDict > /dev/null 2>&1
cleanCase
)
(
cd throttle3D || exit
rm -rf constant/polyMesh/sets > /dev/null 2>&1
rm -rf 0 > /dev/null 2>&1
cp -r 0.org 0
rm system/topoSetDict > /dev/null 2>&1
rm -rf processor[0-9] > /dev/null 2>&1
cleanCase
)
# ----------------------------------------------------------------- end-of-file

View File

@ -1,50 +1,14 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="cavitatingFoam"
refineMeshByCellSet()
{
while [ $# -ge 1 ]
do
echo "creating cell set for primary zone - $1"
cp system/topoSetDict.$1 system/topoSetDict
topoSet > log.topoSet.$1 2>&1
echo "refining primary zone - $1"
refineMesh -dict -overwrite > log.refineMesh.$1 2>&1
shift
done
}
( (
cd throttle || exit cd throttle || exit
./Allrun
runApplication blockMesh
refineMeshByCellSet 1 2 3
runApplication $application
) )
( (
cd throttle3D || exit cd throttle3D || exit
./Allrun
cp -r 0.org 0
runApplication blockMesh
refineMeshByCellSet 1 2 3
echo "mapping fields from 2D throttle case"
mapFields ../throttle -sourceTime latestTime > log.mapFields 2>&1
runApplication decomposePar
runParallel $application 4
runApplication reconstructPar
) )
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,12 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
rm -rf constant/polyMesh/sets > /dev/null 2>&1
rm -rf 0/polyMesh > /dev/null 2>&1
rm system/topoSetDict > /dev/null 2>&1
cleanCase
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,28 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="cavitatingFoam"
refineMeshByCellSet()
{
while [ $# -ge 1 ]
do
echo "creating cell set for primary zone - $1"
cp system/topoSetDict.$1 system/topoSetDict
topoSet > log.topoSet.$1 2>&1
echo "refining primary zone - $1"
refineMesh -dict -overwrite > log.refineMesh.$1 2>&1
shift
done
}
runApplication blockMesh
refineMeshByCellSet 1 2 3
runApplication $application
# ----------------------------------------------------------------- end-of-file

View File

@ -21,25 +21,25 @@ FoamFile
{ {
type patch; type patch;
nFaces 51; nFaces 51;
startFace 15151; startFace 35380;
} }
outlet outlet
{ {
type patch; type patch;
nFaces 51; nFaces 51;
startFace 15202; startFace 35431;
} }
walls walls
{ {
type wall; type wall;
nFaces 436; nFaces 640;
startFace 15253; startFace 35482;
} }
frontBack frontBack
{ {
type empty; type empty;
nFaces 15420; nFaces 35580;
startFace 15689; startFace 36122;
} }
) )

View File

@ -0,0 +1,14 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
rm -rf constant/polyMesh/sets > /dev/null 2>&1
rm -rf 0 > /dev/null 2>&1
cp -r 0.org 0
rm system/topoSetDict > /dev/null 2>&1
rm -rf processor[0-9] > /dev/null 2>&1
cleanCase
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,36 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="cavitatingFoam"
refineMeshByCellSet()
{
while [ $# -ge 1 ]
do
echo "creating cell set for primary zone - $1"
cp system/topoSetDict.$1 system/topoSetDict
topoSet > log.topoSet.$1 2>&1
echo "refining primary zone - $1"
refineMesh -dict -overwrite > log.refineMesh.$1 2>&1
shift
done
}
cp -r 0.org 0
runApplication blockMesh
refineMeshByCellSet 1 2 3
echo "mapping fields from 2D throttle case"
mapFields ../throttle -sourceTime latestTime > log.mapFields 2>&1
runApplication decomposePar
runParallel $application 4
runApplication reconstructPar
# ----------------------------------------------------------------- end-of-file