View Issue Details

IDProjectCategoryView StatusLast Update
0003986OpenFOAMBugpublic2023-06-16 11:10
Reportercgoessni Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
Product Versiondev 
Summary0003986: CourantNo and pressure function objects fail in case of compressible flow
DescriptionRunning CourantNo and pressure function objects for compressible flow simulations fail because the function objects do not request the rho_ field in the fields() function.

They would need a similar implementation of fields() function as the age functionObject.
Steps To ReproduceAll crashes are reproducible e.g. with the tutorials/fluid/pitzDaily case. Run the tutorial as-is until the first time step is written. Then:

For CourantNo functionObject:
1.) Run "foamPostProcess -func CourantNo -time 0.001"

It would crash with:

--> FOAM FATAL ERROR:

    request for volScalarField rho from objectRegistry region0 failed
    available objects of type volScalarField are
0()

    From function const Type& Foam::objectRegistry::lookupObject(const Foam::word&) const [with Type = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>]
    in file /opt/OpenFOAM/OpenFOAM-dev/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 211.

For pressure functionObject:
1.) Ensure that rho_ field is required by setting the following in the controlDict/functions:

    pressure
    {
       type pressure;
       libs ("libfieldFunctionObjects.so");
       calcTotal yes;
       calcCoeff no;
       pRef 1e5;
    }

2.) run "foamPostProcess -time 0.001"

--> FOAM FATAL ERROR:

    request for volScalarField rho from objectRegistry region0 failed
    available objects of type volScalarField are

5
(
pMean
pPrime2Mean
p
p_0
p_0_0
)


    From function const Type& Foam::objectRegistry::lookupObject(const Foam::word&) const [with Type = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>]
    in file /opt/OpenFOAM/OpenFOAM-dev/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 211.
TagsNo tags attached.

Activities

henry

2023-06-16 11:05

manager   ~0013048

> They would need a similar implementation of fields() function as the age functionObject.

This would cause them to fail for incompressible cases.

Try using the -solver option:

    foamPostProcess -solver fluid -func CourantNo

henry

2023-06-16 11:09

manager   ~0013049

or

    foamPostProcess -field rho -func CourantNo

henry

2023-06-16 11:10

manager   ~0013050

User support request.

Issue History

Date Modified Username Field Change
2023-06-16 07:31 cgoessni New Issue
2023-06-16 11:05 henry Note Added: 0013048
2023-06-16 11:09 henry Note Added: 0013049
2023-06-16 11:10 henry Assigned To => henry
2023-06-16 11:10 henry Status new => resolved
2023-06-16 11:10 henry Resolution open => no change required
2023-06-16 11:10 henry Note Added: 0013050