CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   heat source UDF error (https://www.cfd-online.com/Forums/fluent/33723-heat-source-udf-error.html)

co2 May 13, 2004 12:02

heat source UDF error
 
Hi,

I interprete a UDF for heat source in tank walls ( Solid zone) -- The udf reads a file for heat source data.

When I try to select the udf as the heat source term in the solid zone I get the following error -- My simulation is running ok, but I am wondering if the radiation UDF is gettting properly hooked up. Please let me know as soon possible.

Error: GENERAL-CAR-CDR: invalid argument [1]: improper list Error Object: #f


FJ May 14, 2004 01:19

Re: heat source UDF error
 
Hi,

Did you do including radiation in a solid region? and is the radiation model discrete ordinates?.

If it is, did you check the check box "Participates in Radiation" in the panel of BC?.

FJ

co2 May 14, 2004 10:47

Re: heat source UDF error
 
well, i am not using radiation model. the udf only specifies heat source terms that have been calculated outside fluent. They are all constant values changing with time. thus the udf just reads these values from a file and specifies them as heat source terms W/m3


FJ May 17, 2004 01:06

Re: heat source UDF error
 
Hi,co2

Is it used only DEFINE_SOURCE?.

FJ

kethireddy May 17, 2004 07:16

Re: heat source UDF error
 
hi... check out the udf function once again.If the solver dont have the values eg c_vof etc it may also give error.check whether all the where the variables from ur udf are being catched etc. ok ......... kethireddy

co2 May 17, 2004 11:20

Re: heat source UDF error
 
my udf is very simple. It is as follows. It is very repetative as I have to write the same code for 2 different zones.

#include "udf.h" /*#include "stdio.h" */

FILE *streamtank; FILE *streamtankslant;

real arrayqvoltank[2929]; real arrayqvoltankslant[2929];

DEFINE_INIT(my_init_func, domain) /* read the data */ {

int i;

real valuetank;

real valuetankslant;

streamtank = fopen( "filetank.txt", "r" );

streamtankslant = fopen( "filetankslant.txt", "r" );

for(i=0;i<2929;i++)

{

fscanf( streamtank, "%f", &valuetank);

fscanf( streamtankslant, "%f", &valuetankslant);

arrayqvoltank[i]=valuetank;

arrayqvoltankslant[i]=valuetankslant;

}

/* thus in the end arrays qvol will have the W/m3 value */

fclose( streamtank );

fclose( streamtankslant ); }

DEFINE_SOURCE(heattank, c, t, dS, eqn) {

real stdtime = RP_Get_Real("flow-time"); /* this data will be obtained from fluent solver */

int hourint;

real qvoltank;

hourint = ((int)stdtime)/3600;

qvoltank = arrayqvoltank[hourint+1];

return qvoltank; }

DEFINE_SOURCE(heattankslant, c, t, dS, eqn) {

real stdtime = RP_Get_Real("flow-time"); /* this data will be obtained from fluent solver */

int hourint;

real qvoltankslant;

hourint = ((int)stdtime)/3600;

qvoltankslant = arrayqvoltankslant[hourint+1];

return qvoltankslant; }


co2 May 17, 2004 11:21

Re: heat source UDF error
 
thus although my simulation is running fine, does this mean that results can be possibly incorrect if i dont make sure that the error is removed.

- Co2

FJ May 18, 2004 05:06

Re: heat source UDF error
 
Hi,

I've tried to reproduce the error with my UDF like yours and I've got it. This error has sometimes occurred by the sequence of solver settings. If a certain sequence is changed, there is no error. Whether this error is occurred or not, both results are the same.

You maybe don't need to take serious this error if the calculation is running fine.

FJ

co2 May 18, 2004 07:47

Re: heat source UDF error
 
FJ:

Thank you very much. I have also contacted fluent inc. about this error, they have not gotten back with me for almost 5 days now. So this error has to be unusual and unknown to them.

I will let you know once I hear from them.


All times are GMT -4. The time now is 05:42.