CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

n_uds error

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 4, 2006, 09:39
Default n_uds error
  #1
Nathan
Guest
 
Posts: n/a
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
  Reply With Quote

Old   May 4, 2006, 15:28
Default Re: n_uds error
  #2
Aidan
Guest
 
Posts: n/a
did you use N_UDS in capital letters?
  Reply With Quote

Old   May 5, 2006, 04:37
Default Re: n_uds error
  #3
Nathan Molyneaux
Guest
 
Posts: n/a
Hi Aidan,

I have tried both the lower case and higher case versions and there does not seem to be a change.

Nathan
  Reply With Quote

Old   September 16, 2015, 10:56
Default
  #4
Member
 
Join Date: Nov 2014
Posts: 42
Rep Power: 3
Maryam-A is on a distinguished road
How did you solve the problem.
I have the same problem.
I would appreciate if you can help me.
Maryam-A is offline   Reply With Quote

Old   September 16, 2015, 11:03
Default
  #5
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 224
Rep Power: 5
Bruno Machado is on a distinguished road
Quote:
Originally Posted by Maryam-A View Post
How did you solve the problem.
I have the same problem.
I would appreciate if you can help me.
First you need to enumerate them.

enum
{
... your UDS...
NUM_UDS
};

Then later you can use NUM_UDS.
Bruno Machado is offline   Reply With Quote

Old   September 16, 2015, 13:32
Default
  #6
Member
 
Join Date: Nov 2014
Posts: 42
Rep Power: 3
Maryam-A is on a distinguished road
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?
Maryam-A is offline   Reply With Quote

Old   September 16, 2015, 13:48
Default
  #7
Member
 
Join Date: Nov 2014
Posts: 42
Rep Power: 3
Maryam-A is on a distinguished road
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).
Maryam-A is offline   Reply With Quote

Old   September 16, 2015, 15:24
Default
  #8
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 224
Rep Power: 5
Bruno Machado is on a distinguished road
Quote:
Originally Posted by Maryam-A View Post
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).
Got this piece of code in the internet. Try to use DEFINE_ON_DEMAND or DEFINE_INIT instead of DEFINE_ADJUST.


#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");
}
Bruno Machado is offline   Reply With Quote

Old   September 17, 2015, 01:38
Default
  #9
Member
 
Join Date: Nov 2014
Posts: 42
Rep Power: 3
Maryam-A is on a distinguished road
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.
Maryam-A is offline   Reply With Quote

Old   September 17, 2015, 01:46
Default
  #10
Member
 
Join Date: Nov 2014
Posts: 42
Rep Power: 3
Maryam-A is on a distinguished road
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.
Maryam-A is offline   Reply With Quote

Old   September 17, 2015, 05:01
Default
  #11
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 224
Rep Power: 5
Bruno Machado is on a distinguished road
Quote:
Originally Posted by Maryam-A View Post
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.
I tested and the code worked. Did you set the scalars in the Fluent menu? I mean, Define... User define... Scalar... Try it in the DEFINE_INIT instead of the EXECUTE_ON_DEMAND and hook it.
Bruno Machado is offline   Reply With Quote

Old   September 17, 2015, 09:23
Default
  #12
Member
 
Join Date: Nov 2014
Posts: 42
Rep Power: 3
Maryam-A is on a distinguished road
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.
Maryam-A is offline   Reply With Quote

Old   September 17, 2015, 09:33
Default
  #13
Member
 
Join Date: Nov 2014
Posts: 42
Rep Power: 3
Maryam-A is on a distinguished road
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?
Maryam-A is offline   Reply With Quote

Old   September 17, 2015, 09:57
Default
  #14
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 224
Rep Power: 5
Bruno Machado is on a distinguished road
Quote:
Originally Posted by Maryam-A View Post
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.
This part of the code should not be placed in the ADJUST macro. Put it in the INIT macro.

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.
Bruno Machado is offline   Reply With Quote

Old   September 18, 2015, 00:27
Default
  #15
Member
 
Join Date: Nov 2014
Posts: 42
Rep Power: 3
Maryam-A is on a distinguished road
Thank you for all your responses.
I did it and have this error "Divergence detected AMG solver-Temperature"
Maryam-A is offline   Reply With Quote

Old   September 18, 2015, 05:25
Default
  #16
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 224
Rep Power: 5
Bruno Machado is on a distinguished road
Quote:
Originally Posted by Maryam-A View Post
Thank you for all your responses.
I did it and have this error "Divergence detected AMG solver-Temperature"
well, this is something else. Not related with this part of the code at all. Check your under relaxation factor to see if your problem can get convergence.
Bruno Machado is offline   Reply With Quote

Old   September 20, 2015, 11:57
Default
  #17
Member
 
Join Date: Nov 2014
Posts: 42
Rep Power: 3
Maryam-A is on a distinguished road
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.
Maryam-A is offline   Reply With Quote

Old   September 20, 2015, 12:21
Default
  #18
Member
 
Join Date: Nov 2014
Posts: 42
Rep Power: 3
Maryam-A is on a distinguished road
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)
}
Maryam-A is offline   Reply With Quote

Old   September 20, 2015, 12:28
Default
  #19
Member
 
Join Date: Nov 2014
Posts: 42
Rep Power: 3
Maryam-A is on a distinguished road
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?
Maryam-A is offline   Reply With Quote

Old   September 21, 2015, 04:41
Default
  #20
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 224
Rep Power: 5
Bruno Machado is on a distinguished road
Quote:
Originally Posted by Maryam-A View Post
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)
}
here you did not initialized the face_t f.
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.
Bruno Machado is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM 300 October 29, 2014 19:00
c++ libraries and solver compiling vaina74 OpenFOAM Installation 13 February 3, 2012 18:43
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 21:30
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51
user defined function cfduser CFX 0 April 29, 2006 10:58


All times are GMT -4. The time now is 23:56.