n_uds error
Hi all,
I have included the header file 'models.h' into my UDF and am using n_uds to check that the scalar has been defined. Every time have interpreted the file I get this response: Error: C:\models\anode.c: line 172: label "n_uds" not found (pc=8768) I'm baffled by this one! Cheers, Nathan |
Re: n_uds error
did you use N_UDS in capital letters?
|
Re: n_uds error
Hi Aidan,
I have tried both the lower case and higher case versions and there does not seem to be a change. Nathan |
How did you solve the problem.
I have the same problem. I would appreciate if you can help me. |
Quote:
enum { ... your UDS... NUM_UDS }; Then later you can use NUM_UDS. |
Thank you for your reply.
But I used enum for specifying my user scalar,too. enum { alpha, N_REQUIRED_UDS }; do you have any other idea for me? |
Actuly these are my program's error after a part of my udf:
enum { alpha, A, B, N_REQUIRED_UDS }; /************************************************** *********************************/ DEFINE_ADJUST(alpha_adjust,d) { Thread *t; cell_t c; if(N_UDS<N_REQUIRED_UDS) Internal_Error("not enough user-defined scalars allocated"); /************************************************** line 316: label "n_uds" not found (pc=18). line 316: function "internal_Error" not found (pc=50). |
Quote:
#include "udf.h" enum { VORT_Z, /* Index of UDS: VORT_Z=0 */ N_REQUIRED_UDS /* # of UDS variables: N_REQUIRED_UDS=1 */ }; DEFINE_ON_DEMAND(vortz_on_demand) { Domain d; /* domain is not passed in */ Thread t; cell_t c; face_t f; /* Make sure there are enough user-defined scalars. */ if (n_uds < N_REQUIRED_UDS) { Internal_Error("not enough UDSs allocated"); } |
Hi
Thanks for your response. I tried this function but still doesn't work.:( I 'm wondering if I have mistake about using UDS. I have 3 uds, 1 is for volume fraction transport equation of nanoparticle, and 2 others I use only for calculating temperature gradient and consequently calculation Laplacian. I want to use them as scalars. I would appreciate if you can help me. |
Hi
Thanks for your response. I tried this function but still doesn't work.:( I 'm wondering if I have mistake about using UDS. I have 3 uds, 1 is for volume fraction transport equation of nanoparticle, and 2 others I use only for calculating temperature gradient and consequently calculation Laplacian. I want to use them as scalars.:confused: I would appreciate if you can help me. |
Quote:
|
Yes I set it and checked the number of scalars in fluent by export-solution data,too.
my English is weak that's because I cant explain my code enough:(. At first I used property of material like viscosity and ... and then I used enum and adjust for udsi. all the macross are in 1 udf by #include"udf.h" and #include "sg.h" headers. |
As you said alpha is index of my first UDSI(C_UDSI(c,t,0)),
so I have only one Adjust function (Adjust_alpha), but I have 3 scalars, Is it true? |
Quote:
if(N_UDS<N_REQUIRED_UDS) Internal_Error("not enough user-defined scalars allocated"); But to be honest with you, for the small piece of your problem I know, this is something that does not affect your code at all. If you are not sure how to implement it now, make your code work and later you try to implement this part. |
Thank you for all your responses.
I did it and have this error "Divergence detected AMG solver-Temperature" |
Quote:
|
I changed one part of my code but this time I face this error
" received a fatal signal error" I even can not initialize my code any more!!!!!!!!!! I need help:( If you give me some advice , I would appreciate it. |
I found the error is because of wrong boundary condition UDS on the wall.
This is my B.C udf: DEFINE_PROFILE(alpha_bc1,thread,position) { Thread *t; cell_t c; . . . begin_f_loop(f,thread) { C_UDSI_G(c,t,0)[0]=-(D_T/D_B)*C_T_G(c,t)[0]; F_PROFILE(f,thread,position)=C_UDSI_G(c,t,0)[0]; } end_f_loop(f,t) } |
As you see I wanted to return C_UDSI_G(c,t,0)[0] .
It means I wanted to return derivative of UDS as wall boundary value.(volume fraction) Is it right? |
Quote:
I think the way you are defining the gradient is not the best way to do it. create a profile that returns the value you want for the gradient and in the boundary condition panel in fluent, you can set as a gradient profile using the profile you created. Be careful once you are working with faces and not cells, your macros should not contain cells. |
All times are GMT -4. The time now is 15:19. |