-
-
October 16, 2024 at 1:12 am
yf70512
SubscriberHello 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 am
yf70512
SubscriberI 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 am
Rob
Forum ModeratorWe 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 am
yf70512
SubscriberHello 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 coefficientreal Afs = AFS_CONSTANT; // Placeholder value for interfacial area densityreal source;const char sv_t;// Obtain fluid and solid temperaturesTs = C_T(c, t); //Tf = C_DHX_NBR_T(c,t);// Calculate the source term based on the modified expressionsource = hfs * Afs * (pow(Tf, 4.0) - pow(Ts, 4.0));// Set the derivative of the source term with respect to TfdS[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.
- How do I get my hands on Ansys Rocky DEM
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- convergence issue for transonic flow
- Facing trouble regarding setting up boundary conditions for SOEC Modeling
- Point exception in erosion calculation
- Script Error Ansys
- Errors with multi-connected bodies using AQWA
-
2577
-
933
-
792
-
599
-
591
© 2025 Copyright ANSYS, Inc. All rights reserved.