CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Get position of a moving wall every time step in UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 20, 2011, 06:48
Default Get position of a moving wall every time step in UDF
  #1
New Member
 
Join Date: Jan 2011
Posts: 8
Rep Power: 15
schemer is on a distinguished road
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!
schemer is offline   Reply With Quote

Old   August 9, 2011, 11:57
Default
  #2
Member
 
pranab_jha's Avatar
 
Pranab N Jha
Join Date: Nov 2009
Location: Houston, TX
Posts: 86
Rep Power: 17
pranab_jha is on a distinguished road
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.
pranab_jha is offline   Reply With Quote

Old   August 10, 2011, 03:41
Default
  #3
New Member
 
Join Date: Jan 2011
Posts: 8
Rep Power: 15
schemer is on a distinguished road
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)
}
Thanks for your help anyway!
schemer is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 21:40.