Fluids

Fluids

Topics relate to Fluent, CFX, Turbogrid and more

Dynamic mesh for heart wall motion

    • Paolo Melidoro
      Subscriber

      Hi,

      I am currently simulating blood flow in the left atrium using Fluent and have coordinates from imaging data for the position of each node on the wall at every time step. So far I have tried prescribing these coordinates (done in 2D for now) using the define_grid_motion macro  however when I preview mesh motion there seems to be no change to the mesh. 

      //credit to Matt Fig for code

      #include "udf.h"
      #include "unsteady.h"
      #include "dynamesh_tools.h"
      DEFINE_GRID_MOTION(UFD_MOV_WALL, domain, dt, time, dtime)
      {
          Thread *tf = DT_THREAD(dt);
          face_t f;
          Node *v;
          int n,ii;
          double Vx1[500] = { node position at every time step} //done for all x and y nodes

      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))
                  {
                      for (ii=0; ii<302;ii++)
                      {
                          if (fabs(NODE_X(v) - Vx1[ii]) < (1e-12) && fabs(NODE_Y(v) - Vy1[ii]) < (1e-12))
                          {
                              NODE_X(v) = Vx1[N_TIME % 302];
                              NODE_Y(v) = Vy1[N_TIME % 302];
                              NODE_POS_UPDATED(v);
                              break;
                          }

      }
                  }
              }
          }
          end_f_loop(f,tf);
      }

       

    • Prashanth
      Ansys Employee

      Hi,

      Double check the remeshing settings, smoothing methods etc.

      • Paolo Melidoro
        Subscriber

        I worked out that the problem may have been that I was using the built-in compiler when compiling the UDF which was giving me a warning about not finding visual studio compiler. I am now not using the built-in compiler however now I get this error message 'fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj'. This is because I need to include a large number of arrays with all the coordinates at each time step in the UDF. 

        I found a solution for this here - https://social.msdn.microsoft.com/Forums/vstudio/en-US/5043c081-a317-4528-a02d-d4b6e6d21543/problem-with-bigobj-when-compiled-by-other-software?forum=msbuild however when I try to include /bigobj in the makefile_nt.udf file I cannot save it as it gives me an error message about permissions. 

        This thread https://www.researchgate.net/post/Is-there-any-FLUENT-UDF-macro-to-replace-the-new-mesh-in-each-time-step summarises quite thoroughly what I'm aiming to do with prescribing the node position at each time step, 

         

         

Viewing 1 reply thread
  • You must be logged in to reply to this topic.