HenanCui
Subscriber
I made a mistake when I paste the content of my udf_name.c in the beginning.
besides the line 46 also has an error, which is called C2065
The correct code of line 18-46 is list below
extern DEFINE_SOURCE(JouleHeat2,c,ct,dS,eqn);
extern DEFINE_PROFILE(CathCurrJ1_LittlePoint_test,ft,i);
extern DEFINE_PROFILE(CathCurrJ2_LittlePoint_test,ft,i);
extern DEFINE_PROFILE(CathCurrJ3_LittlePoint_test,ft,i);
extern DEFINE_PROFILE(AY_DIRICHLET_CLOSE,ft,i);
extern DEFINE_EXECUTE_AT_END(Calc1); 
extern DEFINE_EXECUTE_AT_END(Calc2); 
__declspec(dllexport) UDF_Data udf_data[] = { 
{"Loading", (void (*)(void))Loading, UDF_TYPE_EXECUTE_ON_LOADING},
{"Initialize", (void (*)(void))Initialize, UDF_TYPE_INIT},
{"B_calc", (void (*)(void))B_calc, UDF_TYPE_ADJUST}, /*to adjust or modify ANSYS FLUENT variables that are not passed as arguments.*/
{"conductivity", (void (*)(void))conductivity, UDF_TYPE_DIFFUSIVITY},
{"xLorentz", (void (*)(void))xLorentz, UDF_TYPE_SOURCE},
{"yLorentz", (void (*)(void))yLorentz, UDF_TYPE_SOURCE},
{"zLorentz", (void (*)(void))zLorentz, UDF_TYPE_SOURCE},
{"phiSource", (void (*)(void))phiSource, UDF_TYPE_SOURCE},
{"Ax", (void (*)(void))Ax, UDF_TYPE_SOURCE},
{"Ay", (void (*)(void))Ay, UDF_TYPE_SOURCE},
{"Az", (void (*)(void))Az, UDF_TYPE_SOURCE},
{"JouleHeat1", (void (*)(void))JouleHeat1, UDF_TYPE_SOURCE},
{"JouleHeat2", (void (*)(void))JouleHeat2, UDF_TYPE_SOURCE},  //Q=j^2/conductivity 对温度求导得到dS[eqn]=0
{"CathCurrJ1_LittlePoint_test", (void (*)(void))CathCurrJ1_LittlePoint_test, UDF_TYPE_PROFILE},
{"CathCurrJ2_LittlePoint_test", (void (*)(void))CathCurrJ2_LittlePoint_test, UDF_TYPE_PROFILE},
{"CathCurrJ3_LittlePoint_test", (void (*)(void))CathCurrJ3_LittlePoint_test, UDF_TYPE_PROFILE},
{"AY_DIRICHLET_CLOSE", (void (*)(void))AY_DIRICHLET_CLOSE, UDF_TYPE_PROFILE},
{"Calc1", (void (*)(void))Calc1, UDF_TYPE_EXECUTE_AT_END}, 
{"Calc2", (void (*)(void))Calc2, UDF_TYPE_EXECUTE_AT_END}, 
}; 
__declspec(dllexport) int n_udf_data = sizeof(udf_data)/sizeof(UDF_Data); 
Sorry about the mistake!