|
[Sponsors] |
June 12, 2020, 09:24 |
UDF: wick-vapor interface error
|
#1 |
Senior Member
Arun raj.S
Join Date: Jul 2011
Posts: 207
Rep Power: 16 |
Hello EVERYONE, I have prepared this UDF based on the thesis "Numerical Analysis Of Phase Change, Heat Transfer And Fluid Flow Within Miniature Heat Pipes". I have tried to prepare the first part of the UDF in his thesis. However I am receiving the following error when i compile. Could anyone help me with resolving the issue. Thank you
..\..\src\INITIAL_SETTINGS.c(14): error C2059: syntax error: 'constant' ..\..\src\INITIAL_SETTINGS.c(38): error C2143: syntax error: missing ')' before 'string' ..\..\src\INITIAL_SETTINGS.c(38): error C2371: 'RP_Get_Integer': redefinition; different basic types C:\PROGRA~1\ANSYSI~1\ANSYSS~1\v201\fluent\fluent20 .1.0\src\storage\var.h(16): note: see declaration of 'RP_Get_Integer' ..\..\src\INITIAL_SETTINGS.c(38): error C2059: syntax error: ')' ..\..\src\INITIAL_SETTINGS.c(103): error C2106: '=': left operand must be l-value ..\..\src\INITIAL_SETTINGS.c(104): error C2106: '=': left operand must be l-value ..\..\src\INITIAL_SETTINGS.c(105): error C2106: '=': left operand must be l-value ..\..\src\INITIAL_SETTINGS.c(110): error C2106: '=': left operand must be l-value ..\..\src\INITIAL_SETTINGS.c(117): error C2143: syntax error: missing ';' before '{' ..\..\src\INITIAL_SETTINGS.c(119): error C2143: syntax error: missing ';' before '{' ..\..\src\INITIAL_SETTINGS.c(123): error C2143: syntax error: missing ';' before '}' ..\..\src\INITIAL_SETTINGS.c(130): error C2143: syntax error: missing ';' before '{' ..\..\src\INITIAL_SETTINGS.c(137): error C2146: syntax error: missing ';' before identifier 'MASS_VAPOR1' ..\..\src\INITIAL_SETTINGS.c(144): error C2143: syntax error: missing ';' before '{' ..\..\src\INITIAL_SETTINGS.c(153): error C2146: syntax error: missing ';' before identifier 'MASS_LIQUID_1' #include "udf.h" #include "math.h" #include "sg_udms.h" #include "sg.h" #include "stdio.h" #include "mem.h" #include "dpm.h" #include "surf.h" double TOTAL_LENGHT; double HEAT_FLUX, HTC, TEMP_COOLING; double HFG, ZIGMA; double MOLAR_MASS, PI_num, R_UNIVERSAL, R_R; double T_REF, P_REF; double TEMP_INITIAL; double P_OP_1, P_OP_2; double MASS_VAPOR1, MASS_VAPOR2, MASS_LIQUID_1, MASS_LIQUID_2; double WICK_VOLUME, LIQUID_DENSITY_INITIAL; double CP_L, CP_S,RO_L,RO_S; double Y_WICK_1, Y_WICK_2; double K_WICK_1; double D_WICK_1; double POROSITY1; double VISCOUS_RES_1; double INERTIAL_RES_1; double PRESSURE_VAPOR_0; double URF_VEL, URF_TEMP; double M_DOT[1000],VEL_INTERFACE_VAPOR[1000]; double VEL_INTERFACE_WICK[1000],TEMP_INTERFACE[1000]; double aa1; double x[ND_ND]; int MARZ_WALL_WICK_ID = 215; int MARZ_WICK_WALL_ID = 213; int VAPOR_Core_ID = 8; int WICK_Core_ID = 14; int zone_ID, N_ITERATION,N_TIME; int N_print,N_print_time,N_print_iter,iii; Domain *dd; face_t ff; Thread *tt, *t0; cell_t c0; DEFINE_INIT(INITIAL_SETTINGS, domain) { FILE *fp0; FILE *fp1; FILE *fp2; fp0 = fopen ("Data_0Transient.txt", "w"); fp1 = fopen ("Data_1Interface.txt", "w"); fp2 = fopen ("Data_2WALL.txt", "w"); fclose (fp0); fclose (fp1); fclose (fp2); zone_ID = MARZ_WALL_WICK_ID; tt = Lookup_Thread(domain,zone_ID); begin_f_loop (ff,tt) { c0 = F_C0(ff,tt); t0 = F_C0_THREAD(ff,tt); RO_S = C_R_M1(c0,t0); CP_S = C_CP(c0,t0); } end_f_loop (ff,tt) zone_ID = MARZ_WICK_WALL_ID; tt = Lookup_Thread(domain,zone_ID); begin_f_loop (ff,tt) { c0 = F_C0(ff,tt); t0 = F_C0_THREAD(ff,tt); RO_L = C_R_M1(c0,t0); CP_L = C_CP(c0,t0); } end_f_loop (ff,tt) TOTAL_LENGHT = 0.370; HEAT_FLUX = 84.03031263; HTC = 928.83; TEMP_COOLING = 21+273.15; TEMP_INITIAL = TEMP_COOLING; HFG = 2406*1.0E3; ZIGMA = 0.03; MOLAR_MASS = 18.015; PI_num = 3.141592653589; R_UNIVERSAL = 8314.40; R_R = R_UNIVERSAL/MOLAR_MASS; LIQUID_DENSITY_INITIAL = 992.45; Y_WICK_1 = (5.55)*0.001; Y_WICK_2 = (5.55-0.28)*0.001; K_WICK_1 = 1.72; D_WICK_1 = K_WICK_1/CP_L; POROSITY1 = 0.713; VISCOUS_RES_1 = 3.331E+08; INERTIAL_RES_1 = 8.663E+03; P_OP_1 = 2490; P_REF = P_OP_1; T_REF = TEMP_INITIAL; P_REF = P_OP_1; URF_VEL = 0.1; URF_TEMP = 0.1; N_ITERATION = 0; N_TIME = 1; N_print = 1; N_print_time = 1; N_print_iter = 100; PRESSURE_VAPOR_0 = 0.0; thread_loop_C (t0,domain) { begin_C_loop_all (c0,t0) { C_UDSI(c0,t0,0) = TEMP_INITIAL; } end_C_loop_all (c0,t0) } zone_ID = VAPOR_Core_ID; t0 = Lookup_Thread(domain,zone_ID); aa1=0.0; iii=0; begin_C_loop (c0,t0) { iii=iii+1; C_CENTROID(x,c0,t0); aa1=aa1+C_VOLUME(c0,t0)/C_UDSI(c0,t0,0); } end_C_loop (c0,t0) MASS_VAPOR1=aa1*P_OP_1/R_R; zone_ID = WICK_Core_ID; t0 = Lookup_Thread(domain,zone_ID); WICK_VOLUME = 0.0; begin_C_loop (c0,t0) { C_CENTROID(x,c0,t0); if ((x[1] <= Y_WICK_1) && (x[1] >= Y_WICK_2)) { WICK_VOLUME = WICK_VOLUME + C_VOLUME(c0,t0)*POROSITY1; } } end_C_loop (c0,t0) MASS_LIQUID_1=LIQUID_DENSITY_INITIAL*WICK_VOLUME; P_OP_2 = P_OP_1; MASS_VAPOR2 = MASS_VAPOR1; MASS_LIQUID_2 = MASS_LIQUID_1; iii = 0; while (iii<1000) { M_DOT[iii] = 0; TEMP_INTERFACE[iii] = TEMP_INITIAL; VEL_INTERFACE_VAPOR[iii] = 0.0; VEL_INTERFACE_WICK[iii] = 0.0; iii = iii+1; } Message("P_OP=%e MASS_VAPOR=%e MASS_LIQUID=%e\n",P_OP_1,MASS_VAPOR1,MASS_LIQUID_1 ); } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF for DPM particle deposition modelingpa | haghshenasfard | Fluent UDF and Scheme Programming | 10 | September 15, 2019 03:03 |
Undeclared Identifier Errof UDF | SteveGoat | Fluent UDF and Scheme Programming | 7 | October 15, 2014 08:11 |
ParaView for OF-1.6-ext | Chrisi1984 | OpenFOAM Installation | 0 | December 31, 2010 07:42 |
Installation OF1.5-dev | ttdtud | OpenFOAM Installation | 46 | May 5, 2009 03:32 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |