CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

IOobject only retrieves field data at writeInterval

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 1, 2022, 09:33
Default IOobject only retrieves field data at writeInterval
  #1
New Member
 
Carl Dahmen
Join Date: Jan 2022
Posts: 6
Rep Power: 4
carlDahmen is on a distinguished road
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();
}
carlDahmen is offline   Reply With Quote

Reply

Tags
cfdem, ioobject, runtime, smagorinsky, subgrid


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 91 December 21, 2022 04:50
[OpenFOAM] How to get the coordinates of velocity data at all cells and at all times vidyadhar ParaView 9 May 20, 2020 20:06
[swak4Foam] swakExpression not writing to log alexfells OpenFOAM Community Contributions 3 March 16, 2020 18:19
External magnetic field data Richard Lee FLUENT 7 January 11, 2019 04:43
UDF value to large for defined data type Anna73 Fluent UDF and Scheme Programming 9 September 30, 2018 22:18


All times are GMT -4. The time now is 22:55.