Fluids

Fluids

Accessing Cell Variables on moving “velocity-inlet” in a Dynamic Mesh

    • gsabhishek
      Subscriber

      I am solving a problem where a molten liquid is filling a cylindrical cavity. The molten liquid has a temperature profile along the radial direction.

      I use dynamic meshed axisymmetric cylinder with the following boundaries,

      1) "bottom" - wall

      2) "radial_surface"- wall + deformable in dynamic mesh

      3) "axis" - axis + deformable in dynamic mesh

      4) "top" - velocity-inlet + UDF in dynamic mesh


      DEFINE_GRID_MOTION(topMotion,domain,dt,time,dtime)

      {

         #if !RP_HOST

         Thread *tf = DT_THREAD(dt);

         face_t f;

         Node *v;

         real NV_VEC(vel);

         NV_D(vel,=,0.000313,0,0);

         int n;

         if(time<1614.0)

         {

            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);

                     NV_S(vel,*=,dtime);

                     NV_V(NODE_COORD(v),+=,vel);

                  }

               }

            }

            end_f_loop(f,tf);

         }

         #endif /*!RP_HOST*/

      }


      Here I would like to set a inlet profile for temperature. For that I can add the following

      1) To get the cell thread adjacent to the face,

      Thread *tc = THREAD_T0(tf);

      2)Inside "begin_f_loop(f,tf)", we can get the cell index by

      cell_t c = F_C0(f,tf);

      3) This is where I am stuck as I can neither set C_T(c,tc) or F_T(f,tf). Accessing either gives segmentation fault. How do I proceed here?


      thanks

      Abhishek

    • Karthik R
      Administrator
      Hello I'm not sure I completely understand your question - but can you not use Fluent expressions for defining an Inlet Velocity profile?
      Karthik
Viewing 1 reply thread
  • You must be logged in to reply to this topic.