CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent Multiphase (https://www.cfd-online.com/Forums/fluent-multiphase/)
-   -   Dynamic mesh for Piston type wave maker in NWT simulation (https://www.cfd-online.com/Forums/fluent-multiphase/250749-dynamic-mesh-piston-type-wave-maker-nwt-simulation.html)

Chakra July 6, 2023 20:51

Dynamic mesh for Piston type wave maker in NWT simulation
 
Hello friends,
I am new in this forum,
I am trying to simulate the piston type wave maker for water tank. I have generated the code for the sinusoidal motion for the left wall of the tank. But while I interpret the code in ansys fluent I am getting some parse error in line 10. I Tried but failed. Please can you help me to resolve my issue.
Thanks in advance

#include<stdio.h>
#include“udf.h”
#define A 0.07
#define pi M_PI
#define LW 8
#define g 9.81
#define h 6
#define L0 40.0
#define L1 60.0
DEFINE_CG_MOTION(piston_moving, dt, cg_vel, cg_omega, time, dtime)
{
real u = 0;
real ww = 0;
real kk = 0;
real S = 0;
real cc = 0;
real T = 0;
kk = 2.0*pi/LW;
cc = sqrt(g*tanh(kk*h)/kk); /*wave velocity*/
ww = kk*cc; /*circle frequency*/
T = 2.0*pi/ww;
S = 0.5*A*(2*kk*h+sinh(2*kk*h))/pow(sinh(kk*h),2);
if(time <= T)
{
u = ww*S*time*cos(ww*time)/(2*T);
cg_vel[0] = u;
}
else
{
u = ww*S*cos(ww*time)/2;
cg_vel[0] = u;
}
}

Debayan July 14, 2023 06:42

Similar query
 
I'm also working on something similar. I wanted to know how you're adding the mass of the plunger and whether you're using overset meshing. Would be of great help if you could let me know.


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