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 udf for oscillating wall (https://www.cfd-online.com/Forums/fluent-udf/127566-dynamic-mesh-udf-oscillating-wall.html)

QBeast December 14, 2013 12:00

Dynamic mesh udf for oscillating wall
 
Dear forum users,

I'm working on a case involving flow in a rectangular channel (3D geometry) with the bottom wall oscillating in the normal direction according to a law of the form: dz0=amp*sin(omega*time). After reading the udf manual section on dynamic mesh, I browsed the threads for a while and I picked up a DEFINE_GRID_MOTION udf that I modified:

Code:

#include "udf.h"

DEFINE_GRID_MOTION(eye,domain,dt,time,dtime)
{
Thread *tf = DT_THREAD(dt);
face_t f;
Node *v;
real amp,dz0,omega;
amp=0.005; /*amplitude of the oscillatory motion 5mm*/
omega=5; /*oscillations frequency*/
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);
dz0=amp*sin(omega*time); /*the displacement of the bottom wall in the Z direction*/
NODE_Z(v)=NODE_Z(v)+dz0;
}
}
}
end_f_loop(f,tf);
}

this udf compiles and loads with no errors, but when clicking on draw to preview the motion nothing happens.

Is it a problem with the code or the hooking ?

I noticed when accessing /dynamic mesh/zones panel the availability of all the geometric entities (walls, inlet, outlet, default interior, fluid continuum entity) does this mean that all of the entities affected by the oscillation of the bottom wall needs to be explicitly set?

In /dynamic mesh/zones there is cell height values to set. Could you, please, explain what it is exactly about?

Help greatly appreciated, thanks in advance.

best regards

QBeast December 14, 2013 17:08

update
 
since I posted the issue, I decided to move to tet/tri elements, I meshed a new 3d rectangular channel using triangular elements with no boundary layer refinement (to get things simpler).

when I try to preview mesh motion under solve menu I get systematically negative volumes even contours cells volume show no negative value.

help please

here is a sample output from fluent TUI:



Updating mesh to time 1.10000e-02 (step = 00011)...
Dynamic Mesh Statistics:
Minimum Volume = 2.04203e-11
Maximum Volume = 4.24008e-10
Maximum Cell Skew = 8.75574e-01 (cell zone 2)
Maximum Face Skew = 5.45587e-01 (face zone 5)
done.
Updating mesh to time 1.20000e-02 (step = 00012)...
Dynamic Mesh Statistics:
Minimum Volume = 1.96455e-11
Maximum Volume = 4.24008e-10
Maximum Cell Skew = 9.49990e-01 (cell zone 2)
Maximum Face Skew = 6.84857e-01 (face zone 5)
done.
Updating mesh to time 1.30000e-02 (step = 00013)...
Dynamic Mesh Statistics:
Minimum Volume = 1.50486e-11
Maximum Volume = 4.24008e-10
Maximum Cell Skew = 9.89213e-01 (cell zone 2)
Warning: maximum cell skewness exceeds 0.95.
Maximum Face Skew = 8.24055e-01 (face zone 5)
done.
Updating mesh to time 1.40000e-02 (step = 00014)...
Dynamic Mesh Statistics:
Minimum Volume = 8.05291e-12
Maximum Volume = 4.24008e-10
Maximum Cell Skew = 9.99583e-01 (cell zone 2)
Warning: maximum cell skewness exceeds 0.95.
Maximum Face Skew = 9.35066e-01 (face zone 5)
done.
Updating mesh to time 1.50000e-02 (step = 00015)...

WARNING: non-positive volumes exist.

Dynamic Mesh Statistics:
Minimum Volume =-3.28737e-12
Maximum Volume = 4.24008e-10
Maximum Cell Skew = 1.00113e+00 (cell zone 2)
Warning: maximum cell skewness exceeds 0.95.
Maximum Face Skew = 9.91551e-01 (face zone 5)
Warning: maximum face skewness exceeds 0.95.
Warning: negative cell volume detected!
Error: Update dynamic mesh failed. Negative cell volume detected.
Error Object: #f

razi.me05 May 7, 2014 17:49

1 Attachment(s)
Hi, I've attached the figure I'm getting after few steps of mesh preview. I don't know why the surfaces are shrinking and expanding at top and bottom. Can someone please help me with this.

DnyanMiri December 17, 2020 02:03

Hi razi,

I'm also facing the problem with negative cell volume. My UDF is similar to your with change in velocity equation. Were you able to solve the problem? If yes, could you please help me with it.

Thank you.


All times are GMT -4. The time now is 06:14.