CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF DEFINE_ADJUST for pseudo-sinusoidal motion

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By aerospain

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 2, 2010, 05:26
Default UDF DEFINE_ADJUST for pseudo-sinusoidal motion
  #1
Senior Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 149
Rep Power: 16
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Hi guys,

I would like to know (1) how I could model into an UDF an oscillatory motion which is not quite sinusoidal. Imagine a sinusoidal signal with the peaks and valleys flatten out, and between them a steep ramp. So, something between sinusoidal and a series of step functions.

I have been using a UDF until now for a sinusoidal function that feeds the rotational speed into fluent. (2) Do you know how I could translate translation data into an analytical function of speed for this case?

Many thanks.

C.
aerospain is offline   Reply With Quote

Old   July 2, 2010, 17:26
Default
  #2
TDi
Member
 
Tim Diller
Join Date: Mar 2010
Location: Austin, TX
Posts: 32
Rep Power: 16
TDi is on a distinguished road
Quote:
Originally Posted by aerospain View Post
Hi guys,

I would like to know (1) how I could model into an UDF an oscillatory motion which is not quite sinusoidal. Imagine a sinusoidal signal with the peaks and valleys flatten out, and between them a steep ramp. So, something between sinusoidal and a series of step functions.

I have been using a UDF until now for a sinusoidal function that feeds the rotational speed into fluent. (2) Do you know how I could translate translation data into an analytical function of speed for this case?

Many thanks.

C.
Have you tried using the DEFINE_GRID_MOTION macro? You set it up by defining a dynamic mesh zone and setting the zone motion with a compiled UDF. There are some good examples in the documentation, and I can provide an example if you need.
TDi is offline   Reply With Quote

Old   July 2, 2010, 17:56
Default
  #3
Senior Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 149
Rep Power: 16
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Thanks TDI,

I haven't tried that function you menntioned, I'll take a look at it during the weekend. In the mean time,
I would really appreciate it if you let me take a look at that example of yours.

Regards
aerospain is offline   Reply With Quote

Old   July 5, 2010, 08:05
Default
  #4
Senior Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 149
Rep Power: 16
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Hello again TDI,

I have read a bit about that macro you mentioned. I must apologise if I didn't express myself clearly, I am not looking into grid deformation, actually, I am avoiding it by all means.

I have three circular domains, the largest and medium are concentric, and the smallest one, inside the medium size, can be concentric as well or some distance away from the center. And, I would like to be able to set different motions to the medium and smalles domains by one or two UDF, and be able to define time frames for different motions.

My input data could be in terms of velocity or position at specific times.

Regards
aerospain is offline   Reply With Quote

Old   July 5, 2010, 11:43
Default
  #5
TDi
Member
 
Tim Diller
Join Date: Mar 2010
Location: Austin, TX
Posts: 32
Rep Power: 16
TDi is on a distinguished road
OK, I see.
This would require a DEFINE_PROFILE macro. You write the macro and compile it. Then you link that function to the boundary in question using the BC setup dialog. You can use this to set a parabolic velocity profile, for instance, or to add swirl, etc.
I think there are some examples in the documentation of a DEFINE_PROFILE that do exactly the kind of thing you are trying to do.
The programming generally goes like this. Fluent passes your function a thread variable. You use that thread variable to start a loop over the nodes of face in question. For each node, you can look up the coordinates and assign the velocity based on the coordinates.
Hope this helps.
TDi is offline   Reply With Quote

Old   July 5, 2010, 12:15
Default
  #6
Senior Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 149
Rep Power: 16
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Thans for following my threads TDI,

I think I have misslead you one more time. The flow has a constant horizontal velocity, defined at the most outer boundary as a velocity_inlet. I want the inner domains, which are circles, to rotate by a motion passed from the UDF. I have been using DEFINE_ADJUST for the rotational speed (omega) of the cell zone containing the aerofoil. This was done for a purely sinusoidal motion. Now, I want to define different motions at different lengths of time during the same calculation. For example, it will start at a "resting position" to ramp up at a given pitching speed towards an angle that will keep constant for some time, during which the medium domain that I mentioned before, will rotate at an approximated rotational speed proportional to the force generated by the aerofoil until it reachs a maximum, at which the medium domain will stop, the aerofoil will pitch down at a given ramp speed, and the whole motion will repeat itself in this way for a few cycles.

regards
aerospain is offline   Reply With Quote

Old   July 5, 2010, 12:38
Default
  #7
TDi
Member
 
Tim Diller
Join Date: Mar 2010
Location: Austin, TX
Posts: 32
Rep Power: 16
TDi is on a distinguished road
Would access to the flow-time variable be helpful?
Code:
real flow_time = RP_Get_Real("flow-time");
Then your current approach could make use of the current time in the simulation.
TDi is offline   Reply With Quote

Old   July 5, 2010, 12:52
Default
  #8
Senior Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 149
Rep Power: 16
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Thanks TDI,

Yes, it is most helpful. I can use the "flow-time" as the independent variable in my analytical expressions.

I was wondering how I could define the pitching motion of the aerofoil if its center of pitching rotation is away from the "main" rotation axis of the system. Imaging the "main" rotation point is your elbow and the pitching rotation is your wrist. The elbow remains fixed throughout the whole motion and the wrist moves up and down along an arc. The aerofoil will pitch down or up when the arm is at the top or bottom of that arc. How could I define implicitly those two positions for the aerofoil ramping pitch?

Regards
m.r_khani likes this.
aerospain is offline   Reply With Quote

Old   July 5, 2010, 13:06
Default
  #9
TDi
Member
 
Tim Diller
Join Date: Mar 2010
Location: Austin, TX
Posts: 32
Rep Power: 16
TDi is on a distinguished road
You just left my comfort zone. Perhaps some others know of numerical trick to do what you are talking about.
TDi is offline   Reply With Quote

Old   July 5, 2010, 13:16
Default
  #10
Senior Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 149
Rep Power: 16
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Thanks for all your help TDI,

Hopefully somebody will read this tread and fell compassionate

Kind regards
aerospain is offline   Reply With Quote

Old   July 11, 2010, 12:00
Default Dynamic meshing
  #11
New Member
 
Dave Smith
Join Date: Jul 2010
Posts: 27
Rep Power: 15
davesmith_01 is on a distinguished road
Hi

I want to learn about dynamic mechsing and need the file cyl3d.msh, does anyone have this file and if possible could you please email it to me at
davesmith_01@hotmail.co.uk.

I wanted to try and example problem before I try and do my own dynamic meshing

Thanks

Dave
davesmith_01 is offline   Reply With Quote

Old   May 6, 2011, 23:22
Default
  #12
New Member
 
zhang guoqing
Join Date: May 2011
Posts: 10
Rep Power: 14
qing123 is on a distinguished road
Hello,aerospain:
Do you have solved your problem now?
qing123 is offline   Reply With Quote

Old   June 19, 2011, 09:30
Default
  #13
Member
 
Alberto Pellegrino
Join Date: Jan 2011
Posts: 32
Rep Power: 15
AlbertoP is on a distinguished road
Hi Aerospain,

I'm trying to do your previous step, I mean a purely sinusoidal motion of a circular grid that contains the airfoil (pitching). And the circular grid (quad) is inside a tri-grid supposed to remain static.

Reading on cfd-online I have not figured out yet if I need to use DEFINE_CG_MOTION or DEFINE_GRID_MOTION...or even DEFINE_ADJUST as you mentioned above.

- Please can you explain what you did?

- Must the node at the interface (between rotating quad-mesh and static tri-mesh) be merged or not?

- What setting did you use on Fluent about dynamic mesh? I mean, smoothing, layering, remeshing, or nothing?

- Could you kindly show me your UDF? I would really appreciate your help.


Many thanks!
Kind regards,

Alberto
AlbertoP is offline   Reply With Quote

Old   November 29, 2011, 05:55
Default 3D dynamic mesh tutorial
  #14
New Member
 
Darren Cam
Join Date: Nov 2011
Posts: 8
Rep Power: 14
darren_camilleri is on a distinguished road
Hi people,

I was attempting the 3D dynamic mesh tutorial however I haven't got the cyl3d_new.msh file. If anyone can send me the file please it will be greatly appreciated. Thanks.

My email: darren.camilleri90@gmail.com
darren_camilleri is offline   Reply With Quote

Old   November 15, 2016, 06:55
Default Rgarding motion of tank
  #15
New Member
 
classified
Join Date: Oct 2016
Posts: 10
Rep Power: 9
classified is on a distinguished road
Hi...
I am working on a problem of tank sloshing. I have a tank which is half filled and subjected to rolling and pitching motion. I want to simulate it using fluent. I tried it a lot but I could not make it. I have used define CG_MOTION macro. will anyone suggest me which macro has to be used?
classified is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF problem: incorrect grid motion Fil FLUENT 5 December 19, 2020 09:16
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
UDF for non sinusoidal or varying amplitude motion with respect to time lalit kumar FLUENT 1 November 13, 2010 16:58
Sinusoidal motion udf urmazda Fluent UDF and Scheme Programming 6 July 30, 2010 11:44
UDF error CG Motion Alex FLUENT 0 March 22, 2006 17:40


All times are GMT -4. The time now is 01:19.