CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   DEFINE_ADJUST & Domain... (https://www.cfd-online.com/Forums/fluent/47812-define_adjust-domain.html)

Corentin April 4, 2008 10:02

DEFINE_ADJUST & Domain...
 
Hi!

I am doing an instationnary simulation and I have several iterations per time step.

There are some variables that I would like to reset at each time step but also at each iteration.

I am of course working with a UDF.

To reset after a time step, I am using the DEFINE_EXECUTE_AT_END fuction, and it's working well.

But I do not succeed to reset my variables at each iteration.

To do so, I am trying to use the DEFINE_ADJUST function, but it need some domain, and I don't know what to do.

First : why does it need a domain? The function that reset after each time step doesn't need one...

Anyway, I don't know which domain I should put in.

I am working on someone else code, how could I get the domain, I don't see it?

All I know is that the variables that I want to reset are in a Define_Source which is working on a (c,thread).

I thought my domain would be 'thread', but...

When I put 'thread' or 'domain', I have no errors, but it's not working.

Thank you!

RE13 April 4, 2008 10:36

Re: DEFINE_ADJUST & Domain...
 
The domain pointer is automatically passed to the DEFINE_ADJUST macro from the solver

Corentin April 7, 2008 03:35

Re: DEFINE_ADJUST & Domain...
 
You mean that it should be done automatically?

What should I type, then?

DEFINE_ADJUST(name,domain) ?

I tried, it didn't work...


RE13 April 7, 2008 09:57

Re: DEFINE_ADJUST & Domain...
 
paste your DEFINE_ADJUST code here so we can see if there are any mistakes

Corentin April 8, 2008 02:57

Re: DEFINE_ADJUST & Domain...
 
Ok, thanks.

I just type this:

DEFINE_ADJUST(name,domain) { x=0; }

There is no error at compilation, but the variable x is not reset to zero.

What's wrong?

RE13 April 8, 2008 17:50

Re: DEFINE_ADJUST & Domain...
 
how are you checking the value of x? The define source macro is also called every iteration (but after define adjust), if the value of the variable isn't checked before it is reset than that could be the cause

Corentin April 9, 2008 02:28

Re: DEFINE_ADJUST & Domain...
 
I am sure the DEFINE_ADJUST isn't done because I put some printf command in it, but this printing is never done.

max April 9, 2008 02:58

Re: DEFINE_ADJUST & Domain...
 
Are you sure that you have hooked your Adjust-Function:

Define/User-Defined/Function-Hooks?

Max

RE13 April 9, 2008 10:37

Re: DEFINE_ADJUST & Domain...
 
I was thinking the same thing...

Corentin April 9, 2008 11:30

Re: DEFINE_ADJUST & Domain...
 
Yes, I hooked it. I had forgotten, but now it is done, and still not working :(


All times are GMT -4. The time now is 06:52.