CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Dynamic Mesh Preview Error in simulation of undulation motion using UDF! (https://www.cfd-online.com/Forums/fluent-udf/193235-dynamic-mesh-preview-error-simulation-undulation-motion-using-udf.html)

h04581803 September 19, 2017 23:09

Dynamic Mesh Preview Error in simulation of undulation motion using UDF!
 
2 Attachment(s)
hi,moring everyone:
i am now implementing the simulation on sinusoidal undulation of fish with dynamic mesh technology in ANSYS FLUENT, the undulation function is imported into FLUENT with the macro DEFINE_CG_MOTION, and the udf can be successfully built and loaded.
Now the problem is that the preview of dynamic mesh cann‘t be accomplished smoothly , the error dialogue box pops up once i click the "preview" botton, and at the same time ,the profile of fish changes in a very strange way: the two lines(white solid lines in the figure below) merge into a single line after previewing, and the error dialogue box is always poping up again after i click the OK botton, and i can still see the motion of fish (a singe line), i was so puzzled , is there any problem with my mesh or with my code? i will be really appreciated if anyone can provide some information, thanks again.
appendixes are the initial status of hydrofoil and the status after clicking preview botton, respectively:

h04581803 September 20, 2017 03:44

:):)can anyone help me?

h04581803 September 21, 2017 21:06

hi everyone, now the error problem is solved by setting the interface circle and the corresponding internal domain as ""deforming" boundaries, and the mesh can be previewed , but the hydrofoil (two white solid lines) still merge into one single line once they start to undulate. DOES this imply that sth is wrong with my UDF:)?

AlexanderZ September 22, 2017 00:28

Hello

how in your opinion people can help you if you do not show any data. no case settings, no udf?


Best regards

h04581803 September 23, 2017 08:55

Quote:

Originally Posted by AlexanderZ (Post 665211)
Hello

how in your opinion people can help you if you do not show any data. no case settings, no udf?


Best regards

Thanks for your kind advice:), i will post my UDF and the settings of dynamic mesh.
the undulation.c, a program of hydrofoil , can be expressed as follows:
//
#include "udf.h"
#include "dynamesh_tools.h"
#include "math.h"
#define U 40.05
#define L 1.00
#define a0 0.02
#define a1 0.08
#define a2 0.16

DEFINE_GRID_MOTION(undulation005_fish, domain, dt, time, dtime)
{
Thread *tf = DT_THREAD(dt); /* pointer to a thread*/
face_t f;
int n;
Node *node_p;
real A, x, y, wave, sign;
real St = 0.05;

/* set deforming flags */

SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf));

begin_f_loop(f, tf)
{
f_node_loop(f, tf, n)
{
node_p = F_NODE(f, tf, n);

if (NODE_POS_NEED_UPDATE(node_p))
{
NODE_POS_UPDATED(node_p);
x = NODE_X(node_p);
A = a0 - a1*x + a2*x*x;
wave = 2 * M_PI / L;
sign = x - St * U * time;
y = A * sin(wave*sign);
NODE_Y(node_p) = y;


}
}
}
end_f_loop(f, tf);
}

h04581803 September 23, 2017 09:05

1 Attachment(s)
and chose "Smoothing and Remeshing" as the mesh update methods, the corresponding settings are displayed below:

h04581803 September 26, 2017 05:42

:):)can anybody help me, please?

Mohamed_Ayman February 3, 2021 00:10

Hello!...Did you solved your problem?....I am simulating the same case of you

CFDavatar February 4, 2021 09:31

They answered already. You have to use DEFINE_GRID_MOTION() macro, you can find the code in early replies

Mohamed_Ayman March 17, 2021 01:58

I have compiled the same UDF and it worked!....But still facing the same problem of two lines merging....If anyone solved this problem can suggest me a solution?

Thanks in advance

fadoobaba July 27, 2021 15:22

:confused:I have the lines merging problem as well.


All times are GMT -4. The time now is 15:50.