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())
{
surfaceScalarField SfUfbyDelta =
mesh.surfaceInterpolation::deltaCoeffs()
*mag(phiSt/fvc::interpolate(rho));
scalarField sumPhi =
fvc::surfaceSum(mag(phiSt))().internalField()
/rho.internalField();
StCoNum =
max(SfUfbyDelta/mesh.magSf()).value()
*runTime.deltaTValue();
StCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
meanStCoNum =
(sum(SfUfbyDelta)/sum(mesh.magSf())).value()
*runTime.deltaTValue();
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
}
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();
scalar globalContErr = runTime.deltaT().value()*
scalar globalContErr = runTime.deltaTValue()*
fvc::div(phia)().weightedAverage(mesh.V()).value();
cumulativeContErr += globalContErr;

View File

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

View File

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

View File

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

View File

@ -43,10 +43,10 @@ if (mesh.nInternalFaces())
pos(alpha1 - 0.01)*pos(0.99 - alpha1)
*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 =
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

View File

@ -42,12 +42,12 @@ if (adjustTimeStep)
(
min
(
deltaTFact*runTime.deltaT().value(),
deltaTFact*runTime.deltaTValue(),
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())
{
surfaceScalarField alpha1f = fvc::interpolate(alpha1);
surfaceScalarField alpha2f = fvc::interpolate(alpha2);
surfaceScalarField SfUfbyDelta = max
scalarField sumPhi = max
(
pos(alpha1f - 0.01)*pos(0.99 - alpha1f),
pos(alpha2f - 0.01)*pos(0.99 - alpha2f)
)*mesh.surfaceInterpolation::deltaCoeffs()*mag(phi);
pos(alpha1 - 0.01)*pos(0.99 - alpha1),
pos(alpha2 - 0.01)*pos(0.99 - alpha2)
)*fvc::surfaceSum(mag(phi))().internalField();
alphaCoNum = max(SfUfbyDelta/mesh.magSf())
.value()*runTime.deltaT().value();
alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
meanAlphaCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
.value()*runTime.deltaT().value();
meanAlphaCoNum =
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
}
Info<< "Interface Courant Number mean: " << meanAlphaCoNum

View File

@ -39,15 +39,14 @@ scalar meanAlphaCoNum = 0.0;
if (mesh.nInternalFaces())
{
surfaceScalarField SfUfbyDelta =
mixture.nearInterface()
*mesh.surfaceInterpolation::deltaCoeffs()*mag(phi);
scalarField sumPhi =
mixture.nearInterface()().internalField()
*fvc::surfaceSum(mag(phi))().internalField();
alphaCoNum = max(SfUfbyDelta/mesh.magSf())
.value()*runTime.deltaT().value();
alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
meanAlphaCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
.value()*runTime.deltaT().value();
meanAlphaCoNum =
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
}
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
{
tmp<surfaceScalarField> tnearInt
tmp<volScalarField> tnearInt
(
new surfaceScalarField
new volScalarField
(
IOobject
(
@ -477,8 +477,7 @@ Foam::multiphaseMixture::nearInterface() const
forAllConstIter(PtrDictionary<phase>, phases_, iter)
{
surfaceScalarField alphaf = fvc::interpolate(iter());
tnearInt() = max(tnearInt(), pos(alphaf - 0.01)*pos(0.99 - alphaf));
tnearInt() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter()));
}
return tnearInt;

View File

@ -258,7 +258,7 @@ public:
//- Indicator of the proximity of 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
void solve();

View File

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

View File

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

View File

@ -38,10 +38,10 @@ if (mesh.nInternalFaces())
fvc::surfaceSum(mag(phi))().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 =
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

View File

@ -37,10 +37,10 @@ if (mesh.nInternalFaces())
scalarField sumPhi =
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 =
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

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
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
runApplication blockMesh
refineMeshByCellSet 1 2 3
runApplication $application
./Allrun
)
(
cd throttle3D || exit
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
./Allrun
)
# ----------------------------------------------------------------- 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;
nFaces 51;
startFace 15151;
startFace 35380;
}
outlet
{
type patch;
nFaces 51;
startFace 15202;
startFace 35431;
}
walls
{
type wall;
nFaces 436;
startFace 15253;
nFaces 640;
startFace 35482;
}
frontBack
{
type empty;
nFaces 15420;
startFace 15689;
nFaces 35580;
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