CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   new compressibility model (https://www.cfd-online.com/Forums/openfoam/98070-new-compressibility-model.html)

jml March 2, 2012 07:36

new compressibility model
 
Hi everyone,

I would like to create a new compressibility model (called nuevo_linear) for using with rasCavitatingFoam. I have used the linear model as a template, modifiying the files .C and .H. to define the compressibility as a function of gamma and pressure.

In the nuevo_linear.C file I have added the new equation, and the lines " const volScalarField& p " to take into account the pressure in the equation:

Foam::compressibilityModels::nuevo_linear::nuevo_l inear
(
const dictionary& compressibilityProperties,
const volScalarField& gamma,
const volScalarField& p
)

Furthermore, I have added a line to take into account also the pressure in the nuevo_linear.H file :

// Constructors

//- construct from components
nuevo_linear
(
const dictionary& compressibilityProperties,
const volScalarField& gamma,
const volScalarField& p
);

However, when I compile, I obtain the following error:

nuevo_linear.C: In constructor ‚Foam::compressibilityModels::nuevo_linear::nuevo_ linear(const Foam::dictionary&, const Foam::volScalarField&, const Foam::volScalarField&)‚:
nuevo_linear.C:54: error: no matching function for call to ‚Foam::barotropicCompressibilityModel::barotropicC ompressibilityModel(const Foam::dictionary&, const Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, const Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&)‚
/opt/OpenFOAM/OpenFOAM-1.5/src/thermophysicalModels/barotropicCompressibilityModel/lnInclude/barotropicCompressibilityModel.H:119: note: candidates are: Foam::barotropicCompressibilityModel::barotropicCo mpressibilityModel(const Foam::dictionary&, const Foam::volScalarField&)
/opt/OpenFOAM/OpenFOAM-1.5/src/thermophysicalModels/barotropicCompressibilityModel/lnInclude/barotropicCompressibilityModel.H:79: note: Foam::barotropicCompressibilityModel::barotropicCo mpressibilityModel(const Foam::barotropicCompressibilityModel&)
nuevo_linear.C: In member function ‚virtual void Foam::compressibilityModels::nuevo_linear::correct ()‚:
nuevo_linear.C:66: error: ‚p‚ was not declared in this scope
In file included from nuevo_linear.H:39,
from nuevo_linear.C:27:
/opt/OpenFOAM/OpenFOAM-1.5/src/thermophysicalModels/barotropicCompressibilityModel/lnInclude/barotropicCompressibilityModel.H: In static member function ‚static Foam::autoPtr<Foam::barotropicCompressibilityModel > Foam::barotropicCompressibilityModel::adddictionar yConstructorToTable<barotropicCompressibilityModel Type>::New(const Foam::dictionary&, const Foam::volScalarField&) [with barotropicCompressibilityModelType = Foam::compressibilityModels::nuevo_linear]‚:
/opt/OpenFOAM/OpenFOAM-1.5/src/thermophysicalModels/barotropicCompressibilityModel/lnInclude/barotropicCompressibilityModel.H:103: instantiated from ‚Foam::barotropicCompressibilityModel::adddictiona ryConstructorToTable<barotropicCompressibilityMode lType>::adddictionaryConstructorToTable(const Foam::word&) [with barotropicCompressibilityModelType = Foam::compressibilityModels::nuevo_linear]‚
nuevo_linear.C:38: instantiated from here
/opt/OpenFOAM/OpenFOAM-1.5/src/thermophysicalModels/barotropicCompressibilityModel/lnInclude/barotropicCompressibilityModel.H:93: error: no matching function for call to ‚Foam::compressibilityModels::nuevo_linear::nuevo_ linear(const Foam::dictionary&, const Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&)‚
nuevo_linear.C:45: note: candidates are: Foam::compressibilityModels::nuevo_linear::nuevo_l inear(const Foam::dictionary&, const Foam::volScalarField&, const Foam::volScalarField&)
nuevo_linear.H:56: note: Foam::compressibilityModels::nuevo_linear::nuevo_l inear(const Foam::compressibilityModels::nuevo_linear&)
make: *** [Make/linux64GccDPOpt/nuevo_linear.o] Error 1

Could anyone help me to understand what is my mistake??

calim_cfd March 2, 2012 10:28

if your familiar wich c++, which is not my case, implementing new stuff should be easier.

in your case you got
Code:

nuevo_linear.C:54: error: no matching function for call to  ‚Foam::barotropicCompressibilityModel::barotropicC  ompressibilityModel(const Foam::dictionary&, const  Foam::GeometricField<double, Foam::fvPatchField,  Foam::volMesh>&, const Foam::GeometricField<double,  Foam::fvPatchField, Foam::volMesh>&)‚
this is the first error you gotta debug. at line 54.

and go over .H and .C files to see which other files are involved

try checking the dependencies, classes and members at http://www.openfoam.org/docs/cpp/

hope it helps
sry can't be of more help
/calim


All times are GMT -4. The time now is 08:00.