|
[Sponsors] |
September 26, 2019, 05:16 |
viscous Force in UDF-File
|
#1 |
New Member
jens meier
Join Date: Sep 2019
Posts: 28
Rep Power: 7 |
Hi everyone,
I've got a problem with my UDF File. I want to simulate two bubbles moving against each other. Between the bubbles should be water as continous phase. I wrote a UDF for one bubble. The other bubble cant move. The speed of the moving bubble should depend on the force that the fluid water acts on the bubble. When I'm trying to simulate, I immediatly receive a negative mesh error because the force and speed grow up very strongly. I think that the UDF uses the wrong pressure in order to calculate the force. I guess I need only the the viscous force . Here s my UDF (0.3 m/s is the take-off speed and should decrease slowly) #include "udf.h" static real v_prev = 0.3; DEFINE_CG_MOTION(bubble, dt, vel, omega, time, dtime) { Thread *t; face_t f; real NV_VEC (A); real force, dv; /* reset velocities */ NV_S (vel, =, 0.0); NV_S (omega, =, 0.0); if (!Data_Valid_P ()) return; /* get the thread pointer for which this motion is defined */ t = DT_THREAD (dt); /* compute pressure force on body by looping through all faces */ force = 0.0; begin_f_loop (f, t) { F_AREA (A, f, t); force += F_P (f, t) * NV_MAG (A); } end_f_loop (f, t) /* compute change in velocity, i.e., dv = F * dt / mass velocity update using explicit Euler formula */ dv = dtime * force / 0.000055; v_prev += dv; Message ("time = %f, x_vel = %f, force = %f\n", time, v_prev, force); /* set x-component of velocity */ vel[0] = v_prev; } Hope somebody can help me. Thank you |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom Thermophysical Properties | wsmith02 | OpenFOAM | 4 | June 1, 2023 15:30 |
[swak4Foam] funkyDoCalc with OF2.3 massflow | NiFl | OpenFOAM Community Contributions | 14 | November 25, 2020 04:30 |
what is swap4foam ?? | AB08 | OpenFOAM | 28 | February 2, 2016 02:22 |
[swak4Foam] Error bulding swak4Foam | sfigato | OpenFOAM Community Contributions | 18 | August 22, 2013 13:41 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 18:51 |