CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   error 2223 (https://www.cfd-online.com/Forums/fluent-udf/164846-error-2223-a.html)

ehsan105 January 3, 2016 19:04

error 2223
 
..\..\src\DPM.c(124) : error C2223: left of '->stochastic_p' must point to struct/union
-----------------------------
if ( DPM_STOCHASTIC_P(P_INJECTION(p)) )
{
/* Reflect turbulent fluctuations also */
/* Compute normal velocity. */
dum = 0;
for(i=0; i<idim; i++)
dum += p->V_prime[i]*normal[i];
/* Subtract off normal velocity. */
for(i=0; i<idim; i++)
p->V_prime[i] -= 2.*dum*normal[i];
}
return PATH_ACTIVE;
}
-----------------------------

How do I solve this error?

Plz guid me

pakk January 5, 2016 06:32

Is "if ( DPM_STOCHASTIC_P(P_INJECTION(p)) )" line 124?
Why did you use DPM_STOCHASTIC_P? (Copy from the help, from internet, invented yourself...)

What should this line do, according to you?


(You should mention what you want your code to do. Otherwise a pedantic answer could be 'remove your code': if you do that the error will disappear. I understand that such an answer does not help you, because the code will not do what you want it to do, but as long as you don't say what you want the code to do, I can not suggest what you have to type to get it.)

ehsan105 January 5, 2016 09:10

Quote:

Originally Posted by pakk (Post 579607)
Is "if ( DPM_STOCHASTIC_P(P_INJECTION(p)) )" line 124?
Why did you use DPM_STOCHASTIC_P? (Copy from the help, from internet, invented yourself...)

What should this line do, according to you?


(You should mention what you want your code to do. Otherwise a pedantic answer could be 'remove your code': if you do that the error will disappear. I understand that such an answer does not help you, because the code will not do what you want it to do, but as long as you don't say what you want the code to do, I can not suggest what you have to type to get it.)


tank you for reply.

it is macro DEFINE_DPM_BC(BC_wall_jet... Similar to Example 2 DPM_bc of fludf.
i think DPM_STOCHASTIC_P Is related to turbulent models and STOCHASTIC model...
and I want Modeling water jet collision with the wall...

plz guid me

pakk January 5, 2016 09:38

And if you literally copy example 2 from the manual, do you get the same error?

ehsan105 January 5, 2016 12:04

Quote:

Originally Posted by pakk (Post 579619)
And if you literally copy example 2 from the manual, do you get the same error?

Surprisingly, I tested it.

And again the error..!!
In your opinion Where do you think I am wrong??

`e` January 6, 2016 04:04

Are you interpreting this UDF? The manual explicitly states that the "function must be executed as a compiled UDF" within the example.

ehsan105 January 6, 2016 05:09

Quote:

Originally Posted by `e` (Post 579714)
Are you interpreting this UDF? The manual explicitly states that the "function must be executed as a compiled UDF" within the example.

tank for reply

Well, I've compiled!!!!!
and My question was this,

ehsan105 January 6, 2016 05:16

mr pkk ,I removed that part and and this udf is compiled. but my qustion still exists. How the code of fludf wasnt compiled ??

`e` January 6, 2016 15:33

If you're still getting the same error after compiling this UDF then check the version numbers of both your ANSYS Fluent installation and the UDF manual (new features are added at each version of Fluent and may not be backward compatible).

ehsan105 January 6, 2016 17:03

Quote:

Originally Posted by `e` (Post 579818)
If you're still getting the same error after compiling this UDF then check the version numbers of both your ANSYS Fluent installation and the UDF manual (new features are added at each version of Fluent and may not be backward compatible).

tank for reply
i used fluent 6.3. and download fludf6.3 and copmpiled the udf. But this error appeared:
DPM_BC.obj : error LNK2019: unresolved external symbol _DPM_SQR referenced in function _bc_wall_jet
libudf.dll : fatal error LNK1120: 1 unresolved externals

done.
--
Finally, the udf was not loaded!

`e` January 6, 2016 21:48

Sounds like there is an issue with the compiler, what compiler are you using? Could you use Microsoft Visual Studio instead? This FAQ for Fluent might also help you.

pakk January 7, 2016 04:28

Or maybe Fluent 6.3 is too old, and you need a newer version to use the macro's in this UDF?

ehsan105 January 19, 2016 06:46

Thanks, anyway I got to solve the problem by removing this part of the Code


All times are GMT -4. The time now is 04:33.