CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

C2059/C2143 errors

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 7, 2023, 10:54
Default C2059/C2143 errors
  #1
New Member
 
amina
Join Date: Feb 2020
Posts: 9
Rep Power: 6
aminalaouti is on a distinguished road
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!
aminalaouti is offline   Reply With Quote

Old   December 8, 2023, 05:00
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
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);
}
}
aminalaouti likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   December 8, 2023, 19:03
Default
  #3
New Member
 
amina
Join Date: Feb 2020
Posts: 9
Rep Power: 6
aminalaouti is on a distinguished road
[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.
aminalaouti is offline   Reply With Quote

Old   December 10, 2023, 19:00
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
you should spend some time to learn how to define functions in C
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 14:59.