-
-
November 1, 2023 at 6:41 pmll00023Subscriber
Dear staff,
I tried to find ways to export different injections's data into one file.
Define_DPM_output seems available to do this work.
Now I have dozens of injections. how to specify the code to an injection like inj-100-single?
I only found the UDF in DPM model. where I can make the pointer in the code point to the injection I want? like tp pointing to the particles from inj-100-single.
plane here is for 2d case. Mine is 3d, so it is null.
is the output file name melting_output?
Thank you.
Lei
-
November 1, 2023 at 6:53 pm
-
November 1, 2023 at 6:57 pmll00023Subscriber
Previously when I encounter the malloc() error, I assume the code update all the particles in the system about 40 million. so I tried to just update a very small number, like 10 particles from certain injection.
-
November 1, 2023 at 7:03 pm
-
November 1, 2023 at 10:47 pm
-
November 1, 2023 at 11:45 pmll00023Subscriber
Â
test initial section:
#include "udf.h"
DEFINE_INIT(melt_setup,domain)
{
  /* if memory for the particle variable titles has not been
  * allocated yet, do it now */
  if (NULLP(user_particle_vars)) Init_User_Particle_Vars();
  /* now set the name and label */
  strcpy(user_particle_vars[0].name,"melting-index");
  strcpy(user_particle_vars[0].label,"Melting Index");
  strcpy(user_particle_vars[1].name,"melting-index-0");
  strcpy(user_particle_vars[1].label,"Melting Index 0");
}No error.
add Define_DPM_scapar_update,Â
/* update the user scalar variables */
DEFINE_DPM_SCALAR_UPDATE(melting_index,cell,thread,initialize,tp)
{
  cphase_state_t *c = &(tp->cphase[0]);
  if (initialize)
  {
  /* this is the initialization call, set:
  * TP_USER_REAL(tp,0) contains the melting index, initialize to 0
  * TP_USER_REAL(tp,1) contains the viscosity at the start of a time step*/
  TP_USER_REAL(tp,0) = 0.;
  TP_USER_REAL(tp,1) = c->mu;
  }
  else
  {
  /* use a trapezoidal rule to integrate the melting index */
  TP_USER_REAL(tp,0) += TP_DT(tp) * .5 * (1/TP_USER_REAL(tp,1) + 1/c->mu);
  /* save current fluid viscosity for start of next step */
  TP_USER_REAL(tp,1) = c->mu;
  }
}switch RANS to URANS since this code is for 2D transient case. thenÂ
Then I got this error.
Â
-
- The topic ‘write particle date in a output file by using example 2.5.10.3 in UDF manual’ is closed to new replies.
- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Script error Code: 800a000d
- Cyclone (Stairmand) simulation using RSM
- Fluent fails with Intel MPI protocol on 2 nodes
- error udf
- Diesel with Ammonia/Hydrogen blend combustion
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
-
1236
-
543
-
523
-
225
-
209
© 2024 Copyright ANSYS, Inc. All rights reserved.