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

Use autoCreateOmega in new solver

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 12, 2018, 23:05
Default Use autoCreateOmega in new solver
  #1
Member
 
Jack
Join Date: May 2015
Posts: 98
Rep Power: 10
Jack001 is on a distinguished road
Hi all,


I am trying to use the function autoCreateOmega which can be found in



Code:
foam-extend-4.0/src/turbulenceModels/incompressible/RAS/lnInclude/backwardsCompatibilityWallFunctions.H
In my solver.C file I have the following at the top:


Code:
#include "fvCFD.H"
#include "simpleControl.H"
#include "wallDist.H"
#include "backwardsCompatibilityWallFunctions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

int main(int argc, char *argv[])
{
#   include "setRootCase.H"
#   include "createTime.H"
#   include "createMesh.H"

    simpleControl simple(mesh);

#   include "createFields.H"
And part of my createFields.H looks like this:



Code:
Info<< "Reading field U\n" << endl;

    volVectorField U
    (
        IOobject
        (
            "U",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    );

    Info<< "Reading field k\n" << endl;

    volScalarField k
    (
        IOobject
        (
            "k",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    );

    Info<< "Reading field omega\n" << endl;



    //tmp<volScalarField> autoCreateOmega
    //volScalarField autoCreateOmega

    volScalarField omega
    (
        IOobject
        (
            "omega",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        //mesh
        autoCreateOmega("omega", mesh, U.db())
    );
When I try to compile this solver I get the following error:


Code:
In file included from solver.C:48:0:
 createFields.H: In function ‘int main(int, char**)’:
createFields.H:50:46: error: ‘autoCreateOmega’ was not declared in this scope
         autoCreateOmega("omega", mesh, U.db())
                                              ^
createFields.H:50:46: note: suggested alternative:
In file included from solver.C:37:0:
/home/foam/foam-extend-4.0/src/turbulenceModels/incompressible/RAS/lnInclude/backwardsCompatibilityWallFunctions.H:98:25: note:   ‘Foam::incompressible::autoCreateOmega’
     tmp<volScalarField> autoCreateOmega
                         ^
solver.dep:714: recipe for target 'Make/linux64GccDPOpt/solver.o' failed
make: *** [Make/linux64GccDPOpt/solver.o] Error 1
This is probably a basic C++ question, but why doesnt including "backwardsCompatibilityWallFunctions.H" allow me to use autoCreateOmega in my program? Any help is much appreciated.

Last edited by Jack001; August 13, 2018 at 19:08.
Jack001 is offline   Reply With Quote

Reply

Tags
c++, openfoam


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fluent Adjoint Solver? ex10148 FLUENT 16 September 28, 2018 08:11
thobois class engineTopoChangerMesh error Peter_600 OpenFOAM 4 August 2, 2014 09:52
Divergence problem Smaras FLUENT 13 February 21, 2013 05:03
3d vof Smaras FLUENT 2 February 19, 2013 06:58
why the solver reject it? Anyone with experience? bearcat CFX 6 April 28, 2008 14:08


All times are GMT -4. The time now is 13:24.