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 06: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 09: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 05:02.