CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Compiling Error - Need help with C++

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   July 8, 2012, 06:38
Default Compiling Error - Need help with C++
  #1
New Member
 
Join Date: Dec 2011
Posts: 12
Rep Power: 5
SiCaRiUs is on a distinguished road
Hi all,

i just need your help in putting an Equation to C++.

The following Code works fine:

Code:
{
    kappat = turbulence->nut()/Prt;
    kappat.correctBoundaryConditions();

    volScalarField kappaEff("kappaEff", turbulence->nu()/Pr + kappat);

    fvScalarMatrix TEqn
    (
        fvm::div(phi, T)
      - fvm::Sp(fvc::div(phi), T)
      - fvm::laplacian(kappaEff, T)
      - ((U & fvc::grad(p)) / Cp)
      - (((turbulence->nuEff() / Cp) * (fvc::grad(U) + fvc::grad(U)().T())) && fvc::grad(U)) 
    );

    TEqn.relax();
    TEqn.solve();

    rhok = 1.0 - beta*(T - TRef);
}
But when i want to enhance the equation with one more term, it doesn't work anymore.
Here is the part of the equation i want to put into c++:



This is my try in the code:

Code:
{
    kappat = turbulence->nut()/Prt;
    kappat.correctBoundaryConditions();

    volScalarField kappaEff("kappaEff", turbulence->nu()/Pr + kappat);

    fvScalarMatrix TEqn
    (
        fvm::div(phi, T)
      - fvm::Sp(fvc::div(phi), T)
      - fvm::laplacian(kappaEff, T)
      - ((U & fvc::grad(p)) / Cp)  
      - (((turbulence->nuEff() / Cp) * (fvc::grad(U) + fvc::grad(U)().T() - (2.0/3.0 * fvm::div(U)))) && fvc::grad(U))
    );

    TEqn.relax();
    TEqn.solve();

    rhok = 1.0 - beta*(T - TRef);
}
But i got the following compiling error:

Quote:
Making dependency list for source file buoyantBoussinesqSimpleFoamVH211_erw.C
SOURCE=buoyantBoussinesqSimpleFoamVH211_erw.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/finiteVolume/lnInclude -I/opt/openfoam211/src/turbulenceModels -I/opt/openfoam211/src/turbulenceModels/incompressible/RAS/lnInclude -I/opt/openfoam211/src/transportModels -I/opt/openfoam211/src/transportModels/incompressible/singlePhaseTransportModel -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/buoyantBoussinesqSimpleFoamVH211_erw.o
In file included from buoyantBoussinesqSimpleFoamVH211_erw.C:77:0:
TEqn.H: In Funktion »int main(int, char**)«:
TEqn.H:13:98: Fehler: keine passende Funktion für Aufruf von »div(Foam::volVectorField&)«
TEqn.H:13:98: Anmerkung: Kandidaten sind:
/opt/openfoam211/src/finiteVolume/lnInclude/fvmDiv.C:45:1: Anmerkung: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::div(const surfaceScalarField&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, const Foam::word&)
/opt/openfoam211/src/finiteVolume/lnInclude/fvmDiv.C:62:1: Anmerkung: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::div(const Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, const Foam::word&)
/opt/openfoam211/src/finiteVolume/lnInclude/fvmDiv.C:77:1: Anmerkung: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::div(const surfaceScalarField&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam211/src/finiteVolume/lnInclude/fvmDiv.C:88:1: Anmerkung: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::div(const Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
make: *** [Make/linux64GccDPOpt/buoyantBoussinesqSimpleFoamVH211_erw.o] Fehler 1
I hope you can help me!
Thanks a lot!

Greetings
Sebastian
SiCaRiUs is offline   Reply With Quote

Old   July 8, 2012, 10:22
Default
  #2
New Member
 
Join Date: Dec 2011
Posts: 12
Rep Power: 5
SiCaRiUs is on a distinguished road
Ok. I think i've got it. Just multiplicated the red term with the identity tensor. Now it works.
SiCaRiUs is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Compiling UDFs in Ansys Fluent 13 (lnx64) Ali.beh Fluent UDF and Scheme Programming 2 April 8, 2013 18:12
paraview 3.10.1 compiling error (1.6-ext) vkrastev OpenFOAM Installation 7 October 28, 2011 03:17
Help with KIVA4 source code compiling geothokar Main CFD Forum 0 September 3, 2010 05:40
error msg when compiling user fortran Ollimarc CFX 0 March 13, 2008 19:16
Discussing UDF and C++ Compiling Big Stone FLUENT 9 April 12, 2004 15:07


All times are GMT -4. The time now is 16:32.