Created new functionObject for dsmcFields, renamed post processing utility dsmcFields to dsmcFieldsCalc and calling function object from there.

This commit is contained in:
graham
2009-03-09 19:29:08 +00:00
parent a7341a7e95
commit e49d70a85a
14 changed files with 590 additions and 96 deletions

View File

@ -1,3 +0,0 @@
dsmcFields.C
EXE = $(FOAM_APPBIN)/dsmcFields

View File

@ -0,0 +1,3 @@
dsmcFieldsCalc.C
EXE = $(FOAM_APPBIN)/dsmcFieldsCalc

View File

@ -2,6 +2,7 @@ EXE_INC = \
-I$(LIB_SRC)/postProcessing/postCalc \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/postProcessing/functionObjects/utilities/lnInclude \
-I$(LIB_SRC)/lagrangian/dsmc/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
@ -9,6 +10,7 @@ EXE_LIBS = \
$(FOAM_LIBBIN)/postCalc.o \
-lmeshTools \
-lfiniteVolume \
-lutilityFunctionObjects \
-llagrangian \
-ldsmc

View File

@ -34,6 +34,7 @@ Description
#include "calc.H"
#include "fvc.H"
#include "dsmcCloud.H"
#include "dsmcFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -133,97 +134,17 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
Info<< "Reading field iDofMean" << endl;
volScalarField iDofMean(iDofMeanheader, mesh);
// Check if there are any zero values in the density fields
dsmcFields dF
(
"dsmcFieldsUtility",
mesh,
dictionary(),
false
);
if (min(rhoNMean).value() > VSMALL)
if (writeResults)
{
// TODO Sort out boundary field values if required
Info<< nl << "Calculating UMean field." << endl;
volVectorField UMean
(
IOobject
(
"UMean",
runTime.timeName(),
mesh,
IOobject::NO_READ
),
momentumMean/rhoMMean
);
Info<< nl << "Calculating translationalTMean field." << endl;
volScalarField translationalTMean
(
IOobject
(
"translationalTMean",
runTime.timeName(),
mesh,
IOobject::NO_READ
),
2.0/(3.0*dsmcCloud::kb*rhoNMean)
*(linearKEMean - 0.5*rhoMMean*(UMean & UMean))
);
Info<< nl << "Calculating internalTMean field." << endl;
volScalarField internalTMean
(
IOobject
(
"internalTMean",
runTime.timeName(),
mesh,
IOobject::NO_READ
),
2.0/(dsmcCloud::kb*iDofMean)*internalEMean
);
Info<< nl << "Calculating overallTMean field." << endl;
volScalarField overallTMean
(
IOobject
(
"overallTMean",
runTime.timeName(),
mesh,
IOobject::NO_READ
),
2.0/(dsmcCloud::kb*(3.0*rhoNMean + iDofMean))
*(linearKEMean - 0.5*rhoMMean*(UMean & UMean) + internalEMean)
);
Info<< nl << "mag(UMean) max/min : "
<< max(mag(UMean)).value() << " "
<< min(mag(UMean)).value() << endl;
Info<< nl << "translationalTMean max/min : "
<< max(translationalTMean).value() << " "
<< min(translationalTMean).value() << endl;
Info<< nl << "internalTMean max/min : "
<< max(internalTMean).value() << " "
<< min(internalTMean).value() << endl;
Info<< nl << "overallTMean max/min : "
<< max(overallTMean).value() << " "
<< min(overallTMean).value() << endl;
if (writeResults)
{
UMean.write();
translationalTMean.write();
internalTMean.write();
overallTMean.write();
}
}
else
{
Info<< "Small or negative value (" << min(rhoNMean)
<< ") found in rhoNMean field. "
<< "Not calculating fields to avoid division by zero "
<< "or invalid results."
<< endl;
dF.write();
}
}
}