Fluids

Fluids

2d/3d array transport to nodes

    • m.shafiee1374
      Subscriber
      Hello,
      I'm working on a udf which has to read a couple of aerodynamic coefficient tables from files and I will use this udf in a simulation running in parallel mode on a linux hpc cluster. I use the host process to read the coefficient from a text file and then save them in a multi-dimensional array. Now I have to send these arrays to node processes so that they can access the coefficients. The problem is that, according to the Fluent udf manual, commands like "host_to_node_real(name,size)" can only send 1d arrays. And since these arrays are large, I prefer not to split them in multiple 1d arrays. Is there a straightforward way to do this?

      Thanks ūüôā
    • Rob
      Ansys Employee
      What data are you actually working with? Just trying to work out why you'd be sending aerodynamic data to Fluent rather than calculating in Fluent and reporting it. 
    • m.shafiee1374
      Subscriber
      They are tabulated Cl/Cd coefficients of an airfoil. I want to model a turbine blade in a simple domain without the need to actually mesh the turbine geometry (by using momentum source terms). 
      I figured that the following code works fine except that it gives me a warning while compiling it:
      real data[2][3] ;
      host_to_node_real (data,6) ;

      The warning:
      warning C4047: 'function': 'double *' differs in levels of indirection from 'real [2][3]'
      warning C4047: 'mphost_to_node_double': different types for formal and actual parameter 1
    • m.shafiee1374
      Subscriber

      Hi,

      I've encountered another problem with data transfer from the host to the nodes. Lets assume my code looks something like this:

       

      DEFINE_ADJUST(name,libname)
      {
         real a[4], b[4], c[4], V ;
         #if !RP_HOST
         /*I use nodes to calculate V*/
         #endif /*!RP_HOST*/
         node_to_host_real_1(V) ;
         #if !RP_NODE
         /* I use V to calculate a & b on the host process*/
         #endif /*!RP_NODE*/
         host_to_node_real(a,4) ;         /*solution is stuck here*/
         host_to_node_real(b,4) ;
         Message0("\n a[1] = %f\n", a[1]) ;      /*This line is not executed*/
         #if !RP_HOST
         /*Use a & b to calculate c on the nodes*/
         #endif /*!RP_HOST*/
      }
      All of the above works fine (a and b are filled with real numbers), until it reaches the first line with red comment and the solver gets stuck there without giving any errors whatsoever (I have to actually end the fluent process to force it to exit). Also, I'm not getting any errors during compilation. Whats wrong here? or how can I debug this since I'm not getting any errors?
Viewing 3 reply threads
  • You must be logged in to reply to this topic.