CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   rhoTabulated EOS shows "Not implemented" ERROR (https://www.cfd-online.com/Forums/openfoam-programming-development/248509-rhotabulated-eos-shows-not-implemented-error.html)

sreehahaha March 18, 2023 03:23

rhoTabulated EOS shows "Not implemented" ERROR
 
Hi Foamers,

First of all, thank you for all the support I've been receiving so far. Many suggestions from the forum have been incredibly helpful for me.

To the issue: I'm simulating a compressible system using a solver modified from rhoPimpleFoam on OF9. It ran successfully when I used a "thermophysicalProperties" file like:

Code:


thermoType
{
    type            heRhoThermo;
    mixture        pureMixture;
    transport      const;
    thermo          eConst;
    equationOfState rPolynomial;
    specie          specie;
    energy          sensibleInternalEnergy;
}

mixture                                                                       
{                                                                             
    specie                                                                   
    {                                                                         
        molWeight      18.0;                                                 
    }                                                                         
    thermodynamics                                                           
    {                             
        Cv                4233.7894;                                           
        Sf              0;                                                   
        Hf              0;                                                   
    }                                                                         
    equationOfState                                                           
    {                                                                         
        C (0.001866 -6.186e-06 1.105e-08 5.697e-13 0);             
    }
                                                                       
    transport                                                                 
    {                                                                     
        mu        5.0e-03;
        Pr        26.4; 
    }                                                                         
}

But when I change the equationOfState to rhoTabulated and give rho as a table, it gives me the following error:

Code:


Using dynamicCode for codedBase heRhoThermo_pureMixture_const_eConst_rhoTabulated_specie___sensibleInternalEnergy___ at line 17 in "/desktop/2018/software/OpenFOAM/9-foss-2021b/OpenFOAM-9/etc/codeTemplates/dynamicCode/fluidThermo"
[1]
[1]
[1] --> FOAM FATAL ERROR:
[1] Not implemented
[1]
[1]    From function Foam::scalar Foam::rhoTabulated<Specie>::E(Foam::scalar, Foam::scalar) const [with Specie = Foam::specie; Foam::scalar = double]
[1]    in file /desktop/2018/software/OpenFOAM/9-foss-2021b/OpenFOAM-9/src/thermophysicalModels/specie/lnInclude/rhoTabulatedI.H at line 122.
[1]
FOAM parallel run aborting

Can someone please help me understand what's going on? I'm confused, because rPolynomial gives rho as a function of (p,T), and so does rhoTabulated.

Many thanks,
SP

Tobermory March 18, 2023 03:56

The error message tells you that rhoTabulated<Specie>::E() is not implemented. Sure enough, if you look in the class inline source file (https://www.cfd-online.com/Forums/ne...ote=1&p=846511) you'll see:


Code:

template<class Specie>
inline Foam::scalar Foam::rhoTabulated<Specie>::E
 (
    scalar p,
    scalar T
 ) const
 {
    NotImplemented;
    return 0;
 }

... i.e. E is not implemented in this class. Infact you'll see that a whole bunch of thernodynamic functions are also not implemented, so this is probably not a good EOS for you to use.

sreehahaha March 18, 2023 04:02

Thanks Tobermory for the quick reply.

Could you please suggest how I rectify this issue? I'm new to using OF. I think I have to use rhoTabulated as the rPolynomial I've been using isn't very accurate.

SP

Tobermory March 18, 2023 04:08

Sreehari

The short answer is that you can't use rhoTabulated at the moment - it doesn't do what you need it to do, i.e. solve the energy equation. I think your best bet is to try and improve the polynomial fit as best you can, and continue using rPolynomial.

Otherwise, you could try and implement your own version of the rhoTabulated class, and implement the energy functions ... however, there may be a good reason why they have not been implemented so far (I suspect that it's not just laziness on the Developer's side), and so this may be a dead end - I don't have enough knowledge of these particular EOS's to be able to comment.

Good luck!

sreehahaha March 18, 2023 04:18

Thank you very much, Tobermory.

SP


All times are GMT -4. The time now is 21:09.