CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CD-adapco (http://www.cfd-online.com/Forums/cd-adapco/)
-   -   Gravity is not constant in my case (http://www.cfd-online.com/Forums/cd-adapco/56930-gravity-not-constant-my-case.html)

bastien January 6, 2009 08: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 11: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 15: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 17: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 13:39

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

Bastien

mahi January 23, 2009 00: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 04:15.