Commit 1f121751 authored by Andrew Heather's avatar Andrew Heather Committed by graham
Browse files

removing redundant averaging files

parent 5de6dec9
nAveragingSteps++;
scalar nm1Coeff = scalar(nAveragingSteps - 1)/nAveragingSteps;
scalar nCoeff = 1.0/nAveragingSteps;
//R += sqr(Umean);
kGSMean += 0.5*tr(sqr(Umean));
Umean = nm1Coeff*Umean + nCoeff*U;
kGSMean = nm1Coeff*kGSMean + nCoeff*0.5*tr(sqr(U)) - 0.5*tr(sqr(Umean));
//R = nm1Coeff*R + nCoeff*sqr(U) - sqr(Umean);
//Bmean = nm1Coeff*Bmean + nCoeff*turbulence->B();
kMean = nm1Coeff*kMean + nCoeff*turbulence->k();
nuEffMean = nm1Coeff*nuEffMean + nCoeff*turbulence->nuEff();
gammaMean = nm1Coeff*gammaMean + nCoeff*gamma;
sigmaMean = nm1Coeff*sigmaMean + nCoeff*mag(fvc::grad(gamma));
pPrime2Mean += sqr(pMean);
pMean = nm1Coeff*pMean + nCoeff*pd;
pPrime2Mean = nm1Coeff*pPrime2Mean + nCoeff*sqr(pd) - sqr(pMean);
label nAveragingSteps = 1;
IFstream nAveragingStepsFile
(
runTime.path()/runTime.timeName()/"uniform"/"nAveragingSteps.raw"
);
volVectorField* UmeanPtr;
//volTensorField* RPtr;
//volTensorField* BmeanPtr;
volScalarField* kMeanPtr;
volScalarField* kGSMeanPtr;
volScalarField* nuEffMeanPtr;
volScalarField* gammaMeanPtr;
volScalarField* sigmaMeanPtr;
volScalarField* pMeanPtr;
volScalarField* pPrime2MeanPtr;
if (nAveragingStepsFile.good())
{
nAveragingStepsFile >> nAveragingSteps;
Info<< "Reading field Umean\n" << endl;
UmeanPtr = new volVectorField
(
IOobject
(
"Umean",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
/*
Info<< "\nReading field R\n" << endl;
RPtr = new volTensorField
(
IOobject
(
"R",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "\nReading field Bmean\n" << endl;
BmeanPtr = new volTensorField
(
IOobject
(
"Bmean",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
*/
Info<< "\nReading field kMean\n" << endl;
kMeanPtr = new volScalarField
(
IOobject
(
"kMean",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "\nReading field kGSMean\n" << endl;
kGSMeanPtr = new volScalarField
(
IOobject
(
"kGSMean",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "\nReading field nuEffMean\n" << endl;
nuEffMeanPtr = new volScalarField
(
IOobject
(
"nuEffMean",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "\nReading field gammaMean\n" << endl;
gammaMeanPtr = new volScalarField
(
IOobject
(
"gammaMean",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "\nReading field sigmaMean\n" << endl;
sigmaMeanPtr = new volScalarField
(
IOobject
(
"sigmaMean",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field pMean\n" << endl;
pMeanPtr = new volScalarField
(
IOobject
(
"pMean",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field pPrime2Mean\n" << endl;
pPrime2MeanPtr = new volScalarField
(
IOobject
(
"pPrime2Mean",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
}
else
{
Info<< "Creating field Umean\n" << endl;
UmeanPtr = new volVectorField
(
IOobject
(
"Umean",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
U
);
/*
Info<< "Creating field R\n" << endl;
RPtr = new volTensorField
(
IOobject
(
"R",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
sqr(U) - sqr(*UmeanPtr)
);
Info<< "Creating field Bmean\n" << endl;
BmeanPtr = new volTensorField
(
IOobject
(
"Bmean",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
turbulence->B()
);
*/
Info<< "Creating field kMean\n" << endl;
kMeanPtr = new volScalarField
(
IOobject
(
"kMean",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
turbulence->k()
);
Info<< "Creating field kGSMean\n" << endl;
kGSMeanPtr = new volScalarField
(
IOobject
(
"kGSMean",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
0.5*tr(sqr(U) - sqr(*UmeanPtr))
);
Info<< "Creating field nuEffMean\n" << endl;
nuEffMeanPtr = new volScalarField
(
IOobject
(
"nuEffMean",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
turbulence->nuEff()
);
Info<< "Creating field gammaMean\n" << endl;
gammaMeanPtr = new volScalarField
(
IOobject
(
"gammaMean",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
gamma
);
Info<< "Creating field sigmaMean\n" << endl;
sigmaMeanPtr = new volScalarField
(
IOobject
(
"sigmaMean",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mag(fvc::grad(gamma))
);
Info<< "Creating field pMean\n" << endl;
pMeanPtr = new volScalarField
(
IOobject
(
"pMean",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
pd
);
Info<< "Creating field pPrime2Mean\n" << endl;
pPrime2MeanPtr = new volScalarField
(
IOobject
(
"pPrime2Mean",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
sqr(pd) - sqr(*pMeanPtr)
);
}
volVectorField& Umean = *UmeanPtr;
//volTensorField& R = *RPtr;
//volTensorField& Bmean = *BmeanPtr;
volScalarField& kMean = *kMeanPtr;
volScalarField& kGSMean = *kGSMeanPtr;
volScalarField& nuEffMean = *nuEffMeanPtr;
volScalarField& gammaMean = *gammaMeanPtr;
volScalarField& sigmaMean = *sigmaMeanPtr;
volScalarField& pMean = *pMeanPtr;
volScalarField& pPrime2Mean = *pPrime2MeanPtr;
if (runTime.outputTime())
{
OFstream nAveragingStepsFile
(
runTime.path()/runTime.timeName()/"uniform"/"nAveragingSteps.raw"
);
if (nAveragingStepsFile.good())
{
nAveragingStepsFile << nAveragingSteps << endl;
}
else
{
FatalErrorIn(args.executable())
<< "Cannot open file " << nAveragingStepsFile.name()
<< abort(FatalError);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment