|
[Sponsors] |
December 18, 2012, 03:00 |
Time dependant gravity
|
#1 |
New Member
Harikrishnan Nayanar
Join Date: Nov 2012
Location: Bangalore
Posts: 4
Rep Power: 13 |
Hi all,
I am simulating sloshing in a fuel tank using VOF. I want to provide time dependant gravity to simulate vibration. Could you please help on this? Thanks and regards, Hari |
|
December 19, 2012, 10:53 |
|
#2 |
New Member
Elias Paez
Join Date: Nov 2011
Location: Madrid
Posts: 25
Rep Power: 14 |
Hi!
1) you have to define an UDF for the time dependant gravity (Source Term). If you know the equation of time, lets say g=sin(pi*t) you can use this UDF: #include "udf.h" #define w 3.141592654 /* Frequency of the vibration in rad/s */ #define A 4.0 /* Maximum aceleration */ #define Durac 5.0 /* Duration of the vibrationin seconds */ DEFINE_SOURCE(GravDin,c,t,dS,eqn) { real time; real source; time=CURRENT_TIME; if(time<Durac) source=A*sin(w*time)*C_R(c,t); else source=0; return source; } 2) Interpret this UDF. 3)In cell zone conditions enable source terms, then go to source terms and select momentum equation -->UDF---> and select GravDin. 4)You can define more than one source terms in the same UDF, just copying and changing the name of the source, for example GravDinX (for gravity in the x direction) Hope it hepls you. |
|
December 24, 2012, 09:09 |
|
#3 |
New Member
Harikrishnan Nayanar
Join Date: Nov 2012
Location: Bangalore
Posts: 4
Rep Power: 13 |
Hello sicfred,
Thanks for your reply. I do not have a proper function for the vibration profile (Random vibration). I was told that Fluent has an option to provide gravity w.r.t time as a table format and could be downloaded from the users portal. I could not get it from the users portal. Please help me if you have a clue on this. Thanks and regards, Hari |
|
May 9, 2021, 17:25 |
|
#4 |
New Member
sa
Join Date: May 2021
Posts: 1
Rep Power: 0 |
hello. you can test this text.
#include "udf.h" #define n 4 DEFINE_SOURCE(gashs,cell,thread,dS,eqn) { double source; double tim[n]={0,.1,.2,.3}; double gra[n]={0,1,3,2}; double time=CURRENT_TIME; int i; while (time>=tim[n-1]) { time=time-tim[n-1]; } for (i=0;n-2;i++) { if (time>=tim[i]&&time<tim[i+1]) { return C_R(cell,thread)* 9.8066502*((time-tim[i])/(tim[i+1]-tim[i])*(gra[i+1]-gra[i])+gra[i]); dS[eqn]=0; } } } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
directMapped problem | panda60 | OpenFOAM Bugs | 4 | July 8, 2010 10:23 |
calculation diverge after continue to run | zhajingjing | OpenFOAM | 0 | April 28, 2010 04:35 |
Differences between serial and parallel runs | carsten | OpenFOAM Bugs | 11 | September 12, 2008 11:16 |
Gravity function of time | arapar | FLUENT | 0 | March 8, 2008 13:49 |
Convergence moving mesh | lr103476 | OpenFOAM Running, Solving & CFD | 30 | November 19, 2007 14:09 |