|
[Sponsors] |
June 11, 2018, 03:30 |
Fixed velocity UDF not working
|
#1 |
New Member
Enrique Pérez Heredia
Join Date: May 2018
Location: Madrid, Spain.
Posts: 16
Rep Power: 7 |
Hello, I'm trying to simulate a fixed velocity fall of a body into a fluid, I am setting up the domain and introducing this UDF.
DEFINE_CG_MOTION(OW_fall, dt, vel, omega, time, dtime) { vel[1] = -5; } It is as simple as that but it does not work, when I start the simulation the body does not move at all and remains like that for any time. Thank you in advance. Enrique P. __
__________________
Loading signature... |
|
June 11, 2018, 11:43 |
|
#2 |
Senior Member
Join Date: Sep 2017
Posts: 246
Rep Power: 11 |
Hi Enrique,
Please could you sketch out how you have set up the Dynamic Mesh Zones? (I think you need a deforming cell zone plus a Rigid Body for the moving face zones. The Rigid Body is where you hook in the UDF.) Also describe the type of Dynamic Mesh that you have set up -- layering, smoothing, or whatever -- and summarise the settings there. Thanks, Ed |
|
June 12, 2018, 02:25 |
Thanks
|
#3 |
New Member
Enrique Pérez Heredia
Join Date: May 2018
Location: Madrid, Spain.
Posts: 16
Rep Power: 7 |
Hi Obscureed, thanks for the answer.
I have my rigid body which is a cylinder, surrounded by another zone made by an inflation which moves with the cylinder. I have layering and remeshing that work nice because I have already used them to study the free fall under gravity of the same cylinder. I attach some images with the setting of the dynamic mesh. Cylinder_6DOF.PNG Cylinder_inflation.PNG Remeshing.PNG Smoothing.PNG
__________________
Loading signature... |
|
June 12, 2018, 04:57 |
|
#4 |
Senior Member
Join Date: Sep 2017
Posts: 246
Rep Power: 11 |
Hi Enrique,
Thanks for those images. A couple of thoughts come to mind: -- Is 6DOF what you want in this model? I think if you want to impose a fixed motion, 6DOF should be off. I am actually confused about how the motion is currently defined: the UDF, the specified velocity in the Dynamic Mesh Zones window, or 6DOF. I think you need a setup where the UDF is more clearly in control. You also want a setup where a UDF of type DEFINE_CG_MOTION is called for -- currently, your UDF of this type is hooked in where DEFINE_SDOF_PROPERTIES would be appropriate. -- You seem to have given the same motion settings to the cylinder and to the fluid. (Although, as in my previous point, I am not entirely sure what those motion settings are.) So perhaps you would not expect to see relative motion. I think a correct setup would have the cylinder (boundary face zone) being given rigid-body motion, and the moving_fluid (surrounding cell zone) deforming without motion. By the way, I would recommend following the example in the help files to set the other velocities to zero: Code:
/* reset velocities */ NV_S(vel, =, 0.0); NV_S(omega, =, 0.0); if (!Data_Valid_P()) return; Good luck! Ed |
|
June 12, 2018, 05:12 |
|
#5 |
New Member
Enrique Pérez Heredia
Join Date: May 2018
Location: Madrid, Spain.
Posts: 16
Rep Power: 7 |
Thank you again Obscureed
You are right, I don't reallt want 6DOF but I didn't know where to introduce the UDF function. I tried in the same way as the free fall simulation (I did the free fall case with DEFINE_SDOF_PROPERTIES and it works properly). The "moving_fluid" zone that is in the simulation is only the portion of fluid with fixed mesh wich moves along with the body not the whole domain. Sorry about that, I should have uploaded an image of the mesh setup. To be clear, the only motion that I want is the one of the cylinder falling at constant velocity (and the surrounding zone aswell). Where shall I hook up the DEFINE_CG_MOTION UDF?
__________________
Loading signature... |
|
June 13, 2018, 04:01 |
It worked
|
#6 |
New Member
Enrique Pérez Heredia
Join Date: May 2018
Location: Madrid, Spain.
Posts: 16
Rep Power: 7 |
Thansk for the help.
My error was to enable the 6DOF solver as obscureed pointed out I'm using the UDF in the help manual as you suggested and it is working fine. The setup is the one uploaded before but disabling the 6DOF solver. Now I get to the point of obtaining results of pressures and forces. I'll update you or ask for more help. Enrique P. __
__________________
Loading signature... |
|
June 18, 2018, 06:09 |
|
#7 |
New Member
Enrique Pérez Heredia
Join Date: May 2018
Location: Madrid, Spain.
Posts: 16
Rep Power: 7 |
Im having some trouble again trying to impose the movement in two directions.
My UDF is the following: DEFINE_CG_MOTION(OW_fall, dt, vel, omega, time, dtime) { /* reset velocities */ NV_S(vel[0], =, 40.0); NV_S(vel[1], =, -1.5); NV_S(omega, =, 0.0); if (!Data_Valid_P()) return; } I get an error of the type "error: subscripted value is neither array nor pointer". Apparently it is related with the definition of the array vel which I think is defined by default as a 3-d array. Any suggestions? Thnaks.
__________________
Loading signature... |
|
June 18, 2018, 06:10 |
|
#8 |
New Member
Enrique Pérez Heredia
Join Date: May 2018
Location: Madrid, Spain.
Posts: 16
Rep Power: 7 |
Im having some trouble again trying to impose the movement in two directions.
My UDF is the following: DEFINE_CG_MOTION(OW_fall, dt, vel, omega, time, dtime) { /* reset velocities */ NV_S(vel[0], =, 40.0); NV_S(vel[1], =, -1.5); NV_S(omega, =, 0.0); if (!Data_Valid_P()) return; } I get an error of the type "error: subscripted value is neither array nor pointer". Apparently it is related with the definition of the array vel which I think is defined by default as a 3-d array. Any suggestions? Thnaks.
__________________
Loading signature... |
|
Tags |
body, fixed velocity, udf |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help with UDF to calculate the bubble velocity for 2 phase gas | enass massoud | Fluent UDF and Scheme Programming | 0 | October 18, 2016 06:11 |
Having trouble adapting serial UDF to work in parallel | muyuntao | Fluent UDF and Scheme Programming | 1 | November 10, 2015 13:42 |
How to define a fixed velocity for a given mass flow rate on inlet | mqasimali | FLUENT | 2 | April 12, 2013 17:24 |
DPM UDF particle position using the macro P_POS(p)[i] | dm2747 | FLUENT | 0 | April 17, 2009 01:29 |
Variables Definition in CFX Solver 5.6 | R P | CFX | 2 | October 26, 2004 02:13 |