CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Modifying gravity vector and MRFomega a run time (

nico765 December 10, 2007 14:17

Hello, I am trying to do tw

I am trying to do two things at run time:
*modify the gravity: g is a dimensionedVector.
something like that: g=vector(Foam::cos(alfa*M_PI/180.0),Foam::sin(alfa*M_PI/180.0),0.0):sin(alfa*M_P I/180.0),0.0);
gives me a problem of dimensions at run time.

*modify omega at run time
which is defined in OpenFOAM-1.4.1/src/finiteVolume/cfdTools/general/MRF/MRFZone.H; i cannot manage to access this omega at run time.



nico765 December 12, 2007 07:45

anyone? Please


girogirozakk December 12, 2007 19:42

Hello, nicolas. I tried to
Hello, nicolas.

I tried to modify the gravity.
And I was up to my URL the sample( sorry, Japanease lang... ).

If I made misstake , please teach me.

modify omega
Sorry,I never try.


jaswi December 22, 2007 11:41

Hi Nicolas A very nice eve
Hi Nicolas

A very nice evening to you

Let me try to answer the second question


*modify omega at run time

As far as my knowledge goes omega is private variable of the class MRFZone. To get access to it you have to add a member function, which returns its value, to the interface.

A inline function named getOmega can be added to the MRFZone.H which returns its value and then whenever you need it you can call it.


MRFZone myzone(mesh);

and then at runtime you can access it with


Please take notice of the fact that the class has a scalar "omega" and vector "Omega". Pick your choice :-).

Hope that helps you.

Kind Regards

All times are GMT -4. The time now is 14:06.