CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Modifying gravity vector and MRFomega a run time (https://www.cfd-online.com/Forums/openfoam-solving/59270-modifying-gravity-vector-mrfomega-run-time.html)

nico765 December 10, 2007 13:17

Hello, I am trying to do tw
 
Hello,

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.

Regards,

Nicolas

nico765 December 12, 2007 06:45

anyone? Please
 
anyone?

Please

girogirozakk December 12, 2007 18: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... ).
http://members.jcom.home.ne.jp/issa_.../sloshing.html

If I made misstake , please teach me.


modify omega
Sorry,I never try.


Giro

jaswi December 22, 2007 10: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.

Example:

MRFZone myzone(mesh);

and then at runtime you can access it with

myzone.getOmega();

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
Jaswinder


All times are GMT -4. The time now is 02:28.