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/)
-   -   Get position of a moving wall every time step in UDF (https://www.cfd-online.com/Forums/fluent-udf/90766-get-position-moving-wall-every-time-step-udf.html)

schemer July 20, 2011 05:48

Get position of a moving wall every time step in UDF
 
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!

pranab_jha August 9, 2011 10:57

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.

schemer August 10, 2011 02:41

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!


All times are GMT -4. The time now is 15:45.