Fluids

Fluids

Define a vector

    • jmt714
      Subscriber

      I want to declare a vector, but the problem is that has the dimensions 1x106. So I cannot use NV_D because it is says that is to much arguments. Do you know how I can declare the vector instead?


       


      Many thanks, 


       


      Jordi 

    • Rob
      Ansys Employee

      Have a look at the Documentation, vectors are defined like that, but you'll need to define each component. 

    • jmt714
      Subscriber

      Thank you very much for you message. I understand but then if I want to define an array. How I have to do it? because if I follow the documentation (there is not an example exactly what i want to do (I understand; https://www.sharcnet.ca/Software/Fluent6/html/udf/node248.htm). I got an error with the sintaxis. Sorry, the vector is not very well-looking but i needed since, each value of the vector will be the displacement value in the current time step (the simulation have 105 time steps).


       


      Many thanks,


       


      real displ[1][105];


      displ = [-2.31110880000000e-05,-5.78353680747664e-05,-5.87595468992113e-05,-6.46174026334990e-05,-0.000103825859674563,-0.000217079075525136,-0.000256401435192825,-0.000275866756577904,-0.000358596163999863,-0.000308366495539297,-0.000319002682794429,-0.000349618421760680,-0.000349129134802423,-0.000300145791513366,-0.000314688030776492,-0.000344275931036111,-0.000314687932121784,-0.000314656644654236,-0.000314656753976871,-0.000322590075194713,-0.000308334554732122,-0.000326125198519708,-0.000307366719488318,-0.000308929159594051,-0.000329482076917630,-0.000338576347580837,-0.000299061755676187,-0.000300230079537407,-0.000253449986499882,-0.000198312769317913,-0.000180340556903472,-0.000112397338561133,-8.40003618339527e-05,-7.77792472565544e-05,-7.88121189048852e-05,-0.000104891305927779,-0.000119703840000000,-0.000104687803423177,-5.93107999770712e-05,-2.91863885997525e-05,1.21481359999986e-05,7.89120094802929e-05,0.000151316152702385,0.000284436240311541,0.000359121893179136,0.000314656460656127,0.000299841953976870,0.000251261035685624,0.000255425054236490,0.000289177263771537,0.000318807335756432,0.000315266920243571,0.000380260120398392,0.000421821689890560,0.000590536034702553,0.000763826675008497,0.000607407407999999,0.000575424127331443,0.000466356689754228,0.000179550340995987,4.74094579183375e-05,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3.00247079537410e-05,3.49618091102193e-05,9.08748293603945e-06,0,0,4.91856954448908e-05,0.000100144131885768,0.000161188712669342,0.000235867164603402,0.000330651455396601,0.000412044074505546,0.000294341911446777,0.000247095542047674,0.000125480123400247,1.43715885997522e-05,-4.85880332094179e-05,-0.000104893294790583,-0.000159999839999999,-0.000138667891727386,-7.52536644170562e-05,-9.24489918555579e-05,-5.52571190150475e-05,-6.97790502339493e-05,-6.87452874203444e-05,-0.000101185005521489,0.000796299778190831,0,0,0,0];


       

    • jmt714
      Subscriber

      NV_V_VV(NODE_COORD(v), =, NODE_COORD(v), +, axis,*,displ[1,dtime-1]);

    • Keyur Kanade
      Ansys Employee

      Please have a look at customization manual for NV macros. 


Viewing 4 reply threads
  • You must be logged in to reply to this topic.