|
[Sponsors] |
Get position of a moving wall every time step in UDF |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 20, 2011, 06:48 |
Get position of a moving wall every time step in UDF
|
#1 |
New Member
Join Date: Jan 2011
Posts: 8
Rep Power: 15 |
Hey everyone,
I defined a DEFINE_ADJUST function, where I patch water every time step to a wall. This should simulate raindrops on a windshield. This works up to this point. The problem is, that there is also a wiper that moves left and right along the windshield wall. I want to patch the water always just on the right hand side of this wiper. Now, my question is, if there is a possibility to get the position of the wiper. I already tried to do it with begin_f_loop(face, tf) /* get position of blade */ { F_CENTROID(xf, face, tf); xblade = xf[0]; } end_f_loop(face, tf) , but this doesn't seem to work in the DEFINE_ADJUST environment. Maybe there is a special command, I havn't found in the manual, yet? I use the following settings: 2D, Dynamic Mesh, VOF, Transient Thanks a lot for your help! |
|
August 9, 2011, 11:57 |
|
#2 |
Member
Pranab N Jha
Join Date: Nov 2009
Location: Houston, TX
Posts: 86
Rep Power: 17 |
Did you use a different subdomain and corresponding thread pointer for the thread "tf" here. I think you will have to use the subdomain for the wiper and then define the thread for that.
|
|
August 10, 2011, 03:41 |
|
#3 |
New Member
Join Date: Jan 2011
Posts: 8
Rep Power: 15 |
Now, I solved the problem by defining a function in the UDf that gets the F_CENTROID of the blade. This is the function that works finally:
Code:
void Get_Thread_Face_Centroids(Domain *domain, int id) { real FC[2]; face_t f; Thread *t = Lookup_Thread(domain, id); begin_f_loop(f,t) { F_CENTROID(FC,f,t); xblade=FC[0]; } end_f_loop(f,t) } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Extrusion with OpenFoam problem No. Iterations 0 | Lord Kelvin | OpenFOAM Running, Solving & CFD | 8 | March 28, 2016 12:08 |
UDF for wall slipping | HFLUENT | Fluent UDF and Scheme Programming | 0 | April 27, 2011 13:03 |
Time step in transient simulation | shib | FLUENT | 0 | June 17, 2010 14:07 |
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug | unoder | OpenFOAM Installation | 11 | January 30, 2008 21:30 |
Deal with wall boundary with moving mesh by FVM? | aiya | Main CFD Forum | 6 | May 10, 2007 12:33 |