-
-
September 7, 2018 at 5:05 pm
kfouladi
SubscriberHello,
We are trying to model a fish swimming with undulating motion. Does anyone has a UDF example that we can start with? Thanks.
Kamran
-
September 7, 2018 at 5:23 pm
Karthik Remella
AdministratorHello Kamran,
Please elaborate on how you are attempting to model this problem. What is the purpose of this UDF? Perhaps, we may be able to point you to some resources which can help you get started?
Thank you.
Best Regards,
Karthik
-
September 7, 2018 at 5:24 pm
jmccasli
Ansys EmployeeHi Kamran,
Â
I do not have a UDF to share, but there are some useful examples in the literature for similar studies involving Fluent. See this one for example, in which the use a DEFINE_GRID_MOTION macro to account for the undulation of the fish:
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5375146/
Â
That may be a good place to start.
Â
Regards,
Jeremy
-
September 7, 2018 at 8:24 pm
kfouladi
SubscriberHi Kremella and Jeremy,
Thank you for your quick replies. What I need to do is put the fish in wavy motion. Therefore, I need a UDF so I can put the fish through some lateral or vertical displacement as a function of time. I am not sure what the UDF should look like or more specifically, what parameters it should pass to Fluent. I will provide a picture for more clarity.
Kamran
(I posted this earlier but somehow that post is gone now).
-
September 7, 2018 at 8:24 pm
kfouladi
SubscriberHere is a picture
-
September 10, 2018 at 10:19 am
Rob
Forum ModeratorThanks. As Jeremy says you'll need the DEFINE_GRID_MOTION macro to define change in shape of the object. There's an example in the UDF manual, and as an ASC you should be able to access the Customer Portal for additional resources: I'd suggest looking at the UDF and Moving Mesh materials.Â
-
September 12, 2018 at 10:00 pm
kfouladi
SubscriberThank you all. I will look into DEFINE_GRID_MOTION macro and see if I can make any progress.Â
Kamran
Â
-
March 1, 2019 at 9:36 pm
CatherineIl
SubscriberHello,Â
I would like to ask you if you can post the code here because I am doing something similar for my dissertation but using an airfoil and a wing. I would really appreciate that as I have already wasted a lot of time trying to find a solution and I have never used udf before.Â
Thank you in advance. -
March 12, 2019 at 4:01 pm
kfouladi
SubscriberI modified a UDF file so I can put a flat plate in flapping motion. Here is the file. I wonder if this helps you.
Â
/**********************************************/
/* WingDM.c                 */
/* UDF for specifying a time-varying omega  */
/*Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â */
/* Simulates +/- angFlip deg flapping with a */
/* cycle of FN Hz.              */
/*Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â */
/**********************************************/
Â
#include "udf.h"
#define FN 34.4
#define angFlip 30
#define omegpi 2.0*M_PI*FN
#define omegMx angFlip*M_PI*omegpi/180.0
Â
DEFINE_CG_MOTION(dm, dt, cg_vel, cg_omega, time, dtime)
{
 real omega, tm;
Â
 tm = time - 0.5*dtime;Â
Â
 omega = omegMx*cos(omegpi*tm); /* rotational speed about axis*/Â
 Â
 cg_vel[0] = 0.0;
 cg_vel[1] = 0.0;
 cg_vel[2] = 0.0;
Â
 cg_omega[0] = 0.0;
 cg_omega[1] = 0.0;
 cg_omega[2] = omega;
}
Â
-
January 12, 2020 at 8:32 pm
sanjida
SubscriberHi,
I had used a UDF similar to your UDF, to give a flapping motion to a foil. The UDF worked well. But the problem is that, If I want to know the exact position of the foil at a particular time step and put the values in the equation, It does not give the right value. Here is my UDF,
#include "udf.h"
#define Freq 0.5
#define angular_freq 2.0*M_PI*Freq
#define tetmax 15.0*M_PI/180
DEFINE_CG_MOTION(shm, dt, cg_vel, cg_omega, time, dtime)
{
  real omega;
 omega = tetmax*angular_freq*cos(angular_freq*time);
  cg_vel[0] = 0.0;
  cg_vel[1] = 0.0;
  cg_vel[2] = 0.0;
 Â
  cg_omega[0] = 0.0;
  cg_omega[1] = omega;
  cg_omega[2] = 0.0;
}
Can anyone please help me with this? Thanks in advance.
-
January 13, 2020 at 11:12 am
Rob
Forum ModeratorHow far off are you? Have you converged all of the time steps?
-
January 14, 2020 at 12:24 am
sanjida
SubscriberHi,
Yes, it converged in all of the time steps. Even, if I plot all the data I can see the foil had flapping motion with correct frequency and amplitude in the simulation. The total duration of the simulation is 12 s with time step 0.01. I want to know the position of the foil at the 8th time step (at 0.08 s). If I put the values of all the parameters in the equation, omega = tetmax*angular_freq*cos(angular_freq*time), which I used in the UDF, it gives 0.822 radian, which is not the actual position in the simulation result. If I give a higher value for the time then the value of Omega barely changes. However, the value of omega is 15 degrees (0.2618 radian) at maximum position. How can I know the angular position of the foil manually from that equation? My confusion is mainly how this equation is operating in Fluent w.r.t time.
Thanks.
-
October 19, 2020 at 9:22 am
inshahmedtaray
SubscriberI am trying to emulate the fish like motion as well. I am using UDF DEFINE_GRID_MOTION similar to cantilever beam example in the UDF manual. It does not work on 2D hydrofoil. So, i created a 3D case with symmetry to replicate 2D motion. The UDF works but unfortunately, the dynamic mesh moves outside the domain despite having tried everything by the book. Any insights to solve this will be appreciated. n
-
December 11, 2020 at 12:14 pm
Mawen
SubscriberAs far as I know you must use triangular mesh for dynamic meshing.
-
- The topic ‘UDF for undulating Fish’ is closed to new replies.
- air flow in and out of computer case
- Varying Bond model parameters to mimic soil particle cohesion/stiction
- Eroded Mass due to Erosion of Soil Particles by Fluids
- Centrifugal Fan Analysis for Determination of Characteristic Curve
- Guidance needed for Conjugate Heat Transfer Analysis for a 3s3p Li-ion Battery
- I am doing a corona simulation. But particles are not spreading.
- Issue to compile a UDF in ANSYS Fluent
- JACOBI Convergence Issue in ANSYS AQWA
- affinity not set
- Resuming SAG Mill Simulation with New Particle Batch in Rocky
-
3912
-
1414
-
1256
-
1118
-
1015
© 2025 Copyright ANSYS, Inc. All rights reserved.