CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Siemens (https://www.cfd-online.com/Forums/siemens/)
-   -   Gravity is not constant in my case (https://www.cfd-online.com/Forums/siemens/56930-gravity-not-constant-my-case.html)

bastien January 6, 2009 07:48

Gravity is not constant in my case
 
Hi,

I am trying to simulate a reservoir under variable acceleration (sloshing case). It is well known that it is equivalent to a variable gravity.

However in star-ccm++ I do not find how to made the gravity variable (user function).

Any idea?

Regards

steve January 6, 2009 10:53

Re: Gravity is not constant in my case
 
Hi,

Your best bet here is a java macro to update the value of gravity before each timestep.

To do this, record a macro of you setting the gravity and then taking a timestep. Afterwards open the .java file and wrap the commands in some sort of java for or do loop and then modify the gravity function as required.

Regards

Steve


bastien January 6, 2009 14:11

Re: Gravity is not constant in my case
 
Hi

Thank you it work like a charm :)

I need to track the altitude of the free surface, any means simpler then adding all the volume against the vertical and dividing by the length?

waterheight=sum(vof(x=cst,y=cst,z))/(length*volumebase)

Regards

Bastien

steve January 6, 2009 16:18

Re: Gravity is not constant in my case
 
Hi Bastien,

What about a field function

($VolumeFraction0>0.5)?$$Centroid[2]:-1e12

Then create a maximum report of this field function for where ever you are interested (plane section, fluid domain etc.).

Is this perhaps what you are after?

Steve


bastien January 7, 2009 12:39

Re: Gravity is not constant in my case
 
It works thank you.

Bastien

mahi January 22, 2009 23:41

Re: Gravity is not constant in my case
 
Hi,

Can you send me the macro for the variable gravity case? I am also working on a similar case.


All times are GMT -4. The time now is 05:55.