|
[Sponsors] |
December 7, 2023, 10:54 |
C2059/C2143 errors
|
#1 |
New Member
amina
Join Date: Feb 2020
Posts: 9
Rep Power: 6 |
hi, everyone
i'm trying to compile an udf but i'm surprised by this error: ..\..\src\em_wt_calcul_2bandenv_7_12.c(7): error C2143: erreur de syntaxe�: absence de ')' avant 'constante' ..\..\src\em_wt_calcul_2bandenv_7_12.c(7): error C2143: erreur de syntaxe�: absence de '{' avant 'constante' ..\..\src\em_wt_calcul_2bandenv_7_12.c(7): error C2059: erreur de syntaxe�: 'constante' ..\..\src\em_wt_calcul_2bandenv_7_12.c(7): error C2059: erreur de syntaxe�: ')' i cheked my udf several times , i dont found where is the problem exactly :confused : #include "udf.h" #define NGG 2 #define Cmin 3e-5 #define Cmax 60 #define T0 555 #define Y 0.25 double ALBDF(cell_t c,double Cabs,double Tg,double Tb,double Y) { int j,ii,gg,xi,P1,dgg; double Tb,Tg; double csup[NGG + 1],Cabs[NGG]; double b[64],p[64],xi,xip,P,P2,F; int i, l, m, n; Tb = C_T(c, ct); Tg = T0; for (gg = 0; gg < NGG + 1; gg++) { dgg = gg; csup[gg] = Cmin * pow((Cmax / Cmin), (dgg / NGG)); } for (gg = 1; gg < NGG + 1; gg++) { Cabs[gg] = pow(csup[gg] * csup[gg - 1], .5); } please , can anyone help me! |
|
December 8, 2023, 05:00 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Code:
#include "udf.h" #define NGG 2 #define Cmin 3e-5 #define Cmax 60 #define T0 555 DEFINE_ADJUST(nothing_adjust,d) { Message0("nothing\n"); } double ALBDF(cell_t c, Thread *ct) { int j,ii,gg,xi,P1,dgg; double Tb,Tg; double csup[NGG + 1],Cabs[NGG]; double b[64],p[64]; int i, l, m, n; Tb = C_T(c, ct); Tg = T0; for (gg = 0; gg < NGG + 1; gg++) { dgg = gg; csup[gg] = Cmin * pow((Cmax / Cmin), (dgg / NGG)); } for (gg = 1; gg < NGG + 1; gg++) { Cabs[gg] = pow(csup[gg] * csup[gg - 1], .5); } }
__________________
best regards ****************************** press LIKE if this message was helpful |
|
December 8, 2023, 19:03 |
|
#3 |
New Member
amina
Join Date: Feb 2020
Posts: 9
Rep Power: 6 |
[QUOTE=AlexanderZ;861258]
thank you alexanderZ for reply , but when add your suggestions i got other errors on my code(how to call ALBDF function)( the ALBDF need Tb,Tg,Cabs and Y) , Last edited by aminalaouti; December 11, 2023 at 04:42. |
|
December 10, 2023, 19:00 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
you should spend some time to learn how to define functions in C
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Building OpenFOAM1.7.0 from source | ata | OpenFOAM Installation | 46 | March 6, 2022 14:21 |
pimpleDyMFoam computation randomly stops | babapeti | OpenFOAM Running, Solving & CFD | 5 | January 24, 2018 06:28 |
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 | bookie56 | OpenFOAM Installation | 8 | August 13, 2011 05:03 |
IcoFoam parallel woes | msrinath80 | OpenFOAM Running, Solving & CFD | 9 | July 22, 2007 03:58 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 19:07 |