February 1, 2022, 09:33
|
IOobject only retrieves field data at writeInterval
|
#1
|
New Member
Carl Dahmen
Join Date: Jan 2022
Posts: 6
Rep Power: 3
|
Hello Foamer!
I work with CFDEM but my question is purely OpenFOAM.
I have modified the Smagorinsky turbulence model to create a subgrid viscosity depending on the field voidfraction (Vgas/Vsolid). My problem is after the first timestep "0" I get the error message:
Quote:
--> FOAM FATAL ERROR:
cannot find file "/home/carl/CFDEM/carl-PUBLIC-5.x/run/viscosityTest_BG/CFD/processorX/1.25e-06/voidfraction"
|
I believe this is because in this folder only the data at the writeInterval is saved. How do I retrieve the data at time 1.25e-6 and so on?
Code:
template<class BasicTurbulenceModel>
tmp<volScalarField> BatchelorGreen<BasicTurbulenceModel>::k
(
const tmp<volScalarField>& voidfrac
) const
{
volScalarField solidfrac(scalar(1)-voidfrac);
volScalarField c1(a_*solidfrac+b_*sqr(solidfrac));
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
IOobject::groupName("k", this->U_.group()),
this->runTime_.timeName(),
this->mesh_
),
c1
)
);
}
template<class BasicTurbulenceModel>
void BatchelorGreen<BasicTurbulenceModel>::correctNut()
{
new volScalarField
(
IOobject
(
"voidfraction",
this->runTime_.timeName(),
this->mesh_,
IOobject::MUST_READ_IF_MODIFIED
),
this->mesh_
);
volScalarField k(this->k(voidfraction_));
this->nut_ = this->nu()*k;
fv::options::New(this->mesh_).correct(this->nut_);
BasicTurbulenceModel::correctNut();
}
|
|
|