-
-
October 16, 2024 at 1:12 amyf70512Subscriber
Hello all,
I am writing UDF to modify the energy source term (changing the temperature power index from 1 to 4) of non-equibrilium model in porous media.
The problems are how to link the primary fluid cell and the corresponding auxiliary solid cell, and how to access the auxiliary solid temperature in primary fluid zone when I wirte the UDF to modify the energy source in fluid zone.Â
I checked the file "storage.h". and found the Svar for the dual cell as following. But these Svar index do not specify the temperature, which means the C_STORAGE_R can not be used to access the temperature. Does anyone encounter the same problem? Many thanks.
"'''
 SV_DC_SOURCE, /*Dual Cell Heat Exchanger source*/
 SV_DC_NBR_ID,/*Dual Cell Hxc connectivity info*/
 SV_DC_NBR_DATA,/*Dual Cell Hxc nbr svar value*/ SV_DC_NBR,/*Dual Cell id (local)*/
 SV_DC_FLUID_POR,/*Dual Cell Zone porosity profile*/"
Best regards,
Fan
-
October 16, 2024 at 3:04 amyf70512Subscriber
I found this "#define C_DHX_NBR_T(c,t) ((real *)THREAD_STORAGE(t,SV_DC_NBR_DATA))[9*(c)+sv_t]" in the file "dual_cell.h". I used C_DHX_NBR_T(c,t) to access the temperature of auxiliary cell. But the interpreting said the "sv_t" was undeclared varibles. Could anyone know what the sv_t is and how to assign this varible?Â
-
October 16, 2024 at 8:59 amRobForum Moderator
We can't comment on undocumented macros. But.... Have you told Fluent to retain all data during the iteration process? There's a TUI command in the documentation.Â
-
October 17, 2024 at 12:48 amyf70512Subscriber
Hello Rob,
The code can not run and the fluent crashed with error "999999: mpt_accept: error: accept failed : No such file or directory". My UDF was following:
DEFINE_SOURCE(Solid_source,c,t,dS,eqn)Â{  real Tf, Ts;  real hfs = HFS_CONSTANT; // Placeholder value for heat transfer coefficient  real Afs = AFS_CONSTANT;  // Placeholder value for interfacial area density  real source;  const char sv_t;  // Obtain fluid and solid temperatures  Ts = C_T(c, t); //  Tf = C_DHX_NBR_T(c,t);  // Calculate the source term based on the modified expression  source = hfs * Afs * (pow(Tf, 4.0) - pow(Ts, 4.0));  // Set the derivative of the source term with respect to Tf  dS[eqn] = - 4.0 * hfs * Afs * pow(Ts, 3.0);  return source;}The maro "C_DHX_NBR_T(c,t)" is in the header file "dual_cell.h". But the fluent also crashed with the same error. I am not sure if it is able to modify the energy source of the non-equibrilium model. The error "999999" always occurred.
-
-
- You must be logged in to reply to this topic.
- Non-Intersected faces found for matching interface periodic-walls
- Script error Code: 800a000d
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Fluent fails with Intel MPI protocol on 2 nodes
- Cyclone (Stairmand) simulation using RSM
- error udf
- Diesel with Ammonia/Hydrogen blend combustion
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
-
1301
-
591
-
544
-
524
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.