CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   Viscosity model - Compressible flow (

Aurelien Thinat November 19, 2013 12:50

Viscosity model - Compressible flow
Hi everyone,

I have some problems developping a viscosity model in OpenFoam-2.2.2. This model is quite simple : for a given value of the strain rate, I have a viscosity value.

So this is what I'm trying :

1) copy paste "src/thermophysicalModels/specie/transport/sutherland" to "src/thermophysicalModels/specie/transport/myTotalTransport"
2) renamed everything, and cleaned the constructors and operators.
3) created a createFields.H file :

#include "interpolationTable.H"

interpolationTable<scalar> timeSeriesViscosity

4) I included the createFields.H file in the others .C and .H files.
5) Modified the function mu in the file "~I.H"

template<class Thermo>
inline Foam::scalar Foam::myTotalTransport<Thermo>::mu
volScalarField sr = strainRate();
return timeSeriesViscosity(sr.value());

6) Modify the thermoPhysicsTypes.C to add my new model.
7) Compiled : these are the errors
- strainRate : working with incompressible models, but not here

error : there are no arguments to 'strainRate' that depend on a template parameter, so a declaration of 'strainRate' must be available
- interpolationTable : I have included "interpolationTable.H", so I don't understand this one :

error: 'interpolationTable' does not name a type
Any help would be greatly appreciated.

Aurelien Thinat November 20, 2013 05:33

I'll start fixing the problem with the strainRate first. It seems it's not defined for compressible flow : as far as I understand the code, there is no volScalarFields defined at this level.

So I need to compute manually the value of the strain rate at the current cell. How can I get an access to
- the velocity ?
- symm() ?
- fvc::grad() ?

Aurelien Thinat November 21, 2013 05:14

Hello everyone,

I did it with incompressible fluids. Then I compiled another thermo model for compressible fluids.
And now I'm stuck with the selection table. Where is the file I need to modify to enable the choice ?

heRhoThermo -
pureMixture -
myTransportModel -
hconst -
perfectFluid -
specie -

I tried to modify the file /src/thermoPhysicalModels/specie/include/thermoPhysicsTypes.H, but there is no mention of perfectFluid in this file, I guess it's the wrong place.

Thank you.

EDIT : It seems it's the file rhoTermos.C.

All times are GMT -4. The time now is 23:27.