CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   autoPtr<incompressible::RASModel> (https://www.cfd-online.com/Forums/openfoam/80932-autoptr-incompressible-rasmodel.html)

ubaid October 11, 2010 13:48

autoPtr<incompressible::RASModel>
 
Hello everybody,
I am trying to declare RASModel outside main function but its giving me some errors.

I compiled the code, there were no errors but i run the code then i get following error.

-->Foam FATAL ERROR
lookup of RASProperties from object Registry region0 successful but it is not a RASModel, it is a dictionary.

How can i get rid of this fatal error. I am trying but still failed to get rid of it.

What I did is the following.

autoPtr<incompressible::RASModel> RASModel
(
incompressible::RASModel::New(U,phi,laminarTranspo rt)
);

This is the same way as done in buoyanBoussinesqSimpleFoam. What I am doing is that i am trying to initialize it in some class.

Thanks in advance.

Best Regards,

val46 October 19, 2010 02:36

Hi,

I have no experience with your problem but just found this:

Code:

autoPtr<incompressible::RASModel> turbulence
            (
                incompressible::RASModel::New(U, phi, laminarTransport)
            );

Maybe this helps.


Regards,
Toni

herbert October 19, 2010 08:23

Quote:

Originally Posted by val46 (Post 279720)
Code:

autoPtr<incompressible::RASModel> turbulence
            (
                incompressible::RASModel::New(U, phi, laminarTransport)
            );


That's exactly the answer. "RASModel" is the name of a class and can therefor not be used as name of the variable (here the name is "turbulence").

Regards,
Stefan

val46 October 19, 2010 08:46

Hi Stefan,

but then how is it possible I found the following code in yPlusRAS.C ?

Code:

singlePhaseTransportModel laminarTransport(U, phi);

    autoPtr<incompressible::RASModel> RASModel
    (
        incompressible::RASModel::New(U, phi, laminarTransport)
    );


Regards,
Toni


All times are GMT -4. The time now is 12:41.