# 2d Dynamic Mesh with udf

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Search this Thread Display Modes
 August 12, 2017, 14:09 #41 New Member   flanag Join Date: Jun 2017 Posts: 12 Rep Power: 6 Hi Samcfd, I am doing something similar i have applied the udf to the airfoil with a 20deg pitching amplitude and set the fluid as deforming but i keep getting negative volume detected and i have changed some of the settings but problem persists, did you eventually sort out the problem you were having?

September 14, 2017, 08:23
#42
New Member

leo
Join Date: Sep 2017
Posts: 15
Rep Power: 5
hi, dear cheaklapomme.
maby your udf work now? i want to do the same case of that,and i have the same code of you ,could you give me any guide.thanks a lot.

Quote:
 Originally Posted by cheaklapomme Hi guys, I'v read all your posts, I tried everything you've said, but (yes there is always a 'but') I always have the best answer in the world 'Update dynamic mesh failed. Negative cell volume detected' My project is blood simulation in artery, and what I want to do now is a simulation of the movement of the artery. First of all I'll try to do that with an easy one, that's mean with a pipe. Here is my UDF : # include "udf.h" # include "dynamesh_tools.h" # define D 0.2e-2 /* diameter of the pipe */ # define H 0.03e-2 /* amplitude of the wave */ # define L 1e-2 /* length of the wave */ # define l 2e-2 /* lenght of the pipe */ # define speed_wave 1 /* speed of the wave */ static real F(real x) { if (x>=0 && x=L && x<=(L+l)) { return 0.5*D; } else { Message0("x = %12.4e Wrong range of x-aborting", x); exit(1); } } static real f_top(real x) { real x1; double tmp; x1 = modf(x/(L+l), &tmp); if (x1>=0) { return F(x1*(L+l)); } else { return F((1+x1)*(L+l)); } } static real f_bottom(real x) { return -f_top(x); } DEFINE_GRID_MOTION(grid_top, domain, dt, time, dtime) { face_t f; Thread *tf = DT_THREAD ((Dynamic_Thread *)dt); int n; Node *v; /* Activate the deforming flag on adjacent cell zone, which means that the cell adjacent to the deforming wall will also be deformed in order to avoid skewness. */ SET_DEFORMING_THREAD_FLAG (THREAD_T0(tf)); /* Loop over the deforming boundary zone's faces; inner loop loops over all nodes of a given face; */ begin_f_loop(f, tf) f_node_loop(f, tf, n) { v = F_NODE(f, tf, n); { /* Update the current node only if it has not been previously visited to avoid to visit the same nodes multiple times */ if (NODE_POS_NEED_UPDATE(v)) { /* Set flag to indicate that the current node's position has been updated, so that it will not be updated during a future pass through the loop */ NODE_POS_UPDATED(v); real x; x = NODE_X(v); /* f_top(x-ct) defines the wave equation */ NODE_Y(v) = f_top(x-speed_wave*time); } } Update_Face_Metrics (f, tf); } end_f_loop (f, tf); } /* Similar udf for the bottom wall */ DEFINE_GRID_MOTION(grid_bot, domain, dt, time, dtime) { face_t f; Thread *tf = DT_THREAD ((Dynamic_Thread *)dt); int n; Node *v; SET_DEFORMING_THREAD_FLAG (THREAD_T0(tf)); begin_f_loop(f, tf) { f_node_loop(f, tf, n) { v = F_NODE(f, tf, n); if (NODE_POS_NEED_UPDATE(v)) { NODE_POS_UPDATED(v); real x; x = NODE_X(v); NODE_Y(v) = f_bottom(x-speed_wave*time); } } Update_Face_Metrics (f, tf); } end_f_loop (f, tf); } I'm waiting for your possibilities and advices. Thanks a lot in advance. Christophe

February 15, 2021, 04:12
Help
#43
New Member

Mohammed
Join Date: Sep 2018
Posts: 12
Rep Power: 4
Quote:
 Originally Posted by cheaklapomme Hi guys, I'v read all your posts, I tried everything you've said, but (yes there is always a 'but') I always have the best answer in the world 'Update dynamic mesh failed. Negative cell volume detected' My project is blood simulation in artery, and what I want to do now is a simulation of the movement of the artery. First of all I'll try to do that with an easy one, that's mean with a pipe. Here is my UDF : # include "udf.h" # include "dynamesh_tools.h" # define D 0.2e-2 /* diameter of the pipe */ # define H 0.03e-2 /* amplitude of the wave */ # define L 1e-2 /* length of the wave */ # define l 2e-2 /* lenght of the pipe */ # define speed_wave 1 /* speed of the wave */ static real F(real x) { if (x>=0 && x=L && x<=(L+l)) { return 0.5*D; } else { Message0("x = %12.4e Wrong range of x-aborting", x); exit(1); } } static real f_top(real x) { real x1; double tmp; x1 = modf(x/(L+l), &tmp); if (x1>=0) { return F(x1*(L+l)); } else { return F((1+x1)*(L+l)); } } static real f_bottom(real x) { return -f_top(x); } DEFINE_GRID_MOTION(grid_top, domain, dt, time, dtime) { face_t f; Thread *tf = DT_THREAD ((Dynamic_Thread *)dt); int n; Node *v; /* Activate the deforming flag on adjacent cell zone, which means that the cell adjacent to the deforming wall will also be deformed in order to avoid skewness. */ SET_DEFORMING_THREAD_FLAG (THREAD_T0(tf)); /* Loop over the deforming boundary zone's faces; inner loop loops over all nodes of a given face; */ begin_f_loop(f, tf) f_node_loop(f, tf, n) { v = F_NODE(f, tf, n); { /* Update the current node only if it has not been previously visited to avoid to visit the same nodes multiple times */ if (NODE_POS_NEED_UPDATE(v)) { /* Set flag to indicate that the current node's position has been updated, so that it will not be updated during a future pass through the loop */ NODE_POS_UPDATED(v); real x; x = NODE_X(v); /* f_top(x-ct) defines the wave equation */ NODE_Y(v) = f_top(x-speed_wave*time); } } Update_Face_Metrics (f, tf); } end_f_loop (f, tf); } /* Similar udf for the bottom wall */ DEFINE_GRID_MOTION(grid_bot, domain, dt, time, dtime) { face_t f; Thread *tf = DT_THREAD ((Dynamic_Thread *)dt); int n; Node *v; SET_DEFORMING_THREAD_FLAG (THREAD_T0(tf)); begin_f_loop(f, tf) { f_node_loop(f, tf, n) { v = F_NODE(f, tf, n); if (NODE_POS_NEED_UPDATE(v)) { NODE_POS_UPDATED(v); real x; x = NODE_X(v); NODE_Y(v) = f_bottom(x-speed_wave*time); } } Update_Face_Metrics (f, tf); } end_f_loop (f, tf); } I'm waiting for your possibilities and advices. Thanks a lot in advance. Christophe
Dear Sir
I am looking to find a solution to my problem. So I found your response to some student and I hope to help me.
I want to simulate an elbow artery by using dynamic mesh. I need to apply eq Ra(t)=0.4+20sin 7.89*t
That can apply it on the wall and it will expand and converge according to the eq..
Please could you help me to write the right code as a UDF?
Thank you very much

Note: I have attached some file refer to the geometry and derivatives eqs

Best regards

Attached Images
 Artery .PNG (16.3 KB, 1 views) eq2.jpg (42.9 KB, 3 views)
Attached Files
 Sin Flow .pdf (138.3 KB, 4 views)

February 20, 2021, 19:09
Excuse me sir.
#44
New Member

sittisak
Join Date: Feb 2021
Posts: 3
Rep Power: 2
Quote:
 Originally Posted by arunraj Hi everyone, I am simulating flapping wing of aerofoil. I have created three zones, zone 1, 2 and 3. Zone 1 has aerofoil with structured mesh around the aerofoil. Zone 2 and 3 has unstructured gird. My problem is I have properly followed all the steps. But I am not able to achieve what I want. Because the shadow of the interface is taking as wall and is not moving along with the domain. Kindly someone help in sorting out this issue. I have attached my UDF alos. Please have a look. Thank you so much https://drive.google.com/file/d/0B7L...ew?usp=sharing https://drive.google.com/file/d/0B7L...ew?usp=sharing

I would like some advice about this problem I would like to use moving mesh or dynamic mesh with UDF for Morphing Airfoil I don't know how to use it. Please give me some advice. I'm student and leaning to this project I don't look your link on sharing would you please to sent to me at my E-mail? : agisan.r@gmail.com

Sittisak. Thank you very much.

Last edited by Sittisak; February 20, 2021 at 19:23. Reason: miss out some word.

 May 19, 2021, 18:10 #45 New Member   sittisak Join Date: Feb 2021 Posts: 3 Rep Power: 2 I would like some advice about this problem I would like to use moving mesh or dynamic mesh with UDF for Morphing Airfoil I don't know how to use it. Please give me some advice. I'm student and leaning to this project I don't look your link on sharing would you please to sent to me at my E-mail? : agisan.r@gmail.com Sittisak. Thank you very much.

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 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 OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20 Peter FLUENT 2 November 12, 2007 02:10 ALPER ALBAYRAQ FLUENT 0 October 24, 2005 08:41 Ryan FLUENT 6 April 29, 2004 09:29 lyf FLUENT 1 April 19, 2004 06:43

All times are GMT -4. The time now is 09:48.

 Contact Us - CFD Online - Privacy Statement - Top