CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Transient simulation in Fluent (https://www.cfd-online.com/Forums/fluent/166423-transient-simulation-fluent.html)

khaham February 9, 2016 06:40

Transient simulation in Fluent
 
Hello CFD Online members.

I am doing a 2D transient simulation in Ansys Fluent 14.0.

physical of the problem: water fluid flow between two plates (plates have a thikness). At time zero the temperature of the two plates is known. At the end of time step 10 the temperature of the two plates decrease by 10K due to extern phenomena (for all cell mean that the temperature field of the two plates change, each cell temperature will decrease by 10K ).

I want to start the time step 11 by this new field to continue the calculation

Is this possible in Fluent ? (since Fluent solver repeat the iteration of the last time step in the begining of the actual time step). We can say what i want to do is a pseudo initialization to start time step 11).

I tried to use EXECUTE_AT_END of time step 10 to modify the two plates field temperature, but when Fluent begin the time step 11 it repeats the last iteration of the time step 10 so the new field is ignored by Fluent.

Thank's in advance (any idea may be useful).

`e` February 9, 2016 15:28

That's strange the temperature is first reduced in time step 10 but then returns to the original temperature in time step 11. What is the UDF you are using and how are you initialising the temperature across the plates (considering they have thickness)?

LuckyTran February 10, 2016 02:28

Fluent doesn't repeat the last iteration of the previous time-step. Make sure you are actually modifying the fields. After doing EXECUTE_AT_END, make some plots or something and make sure the fields are actually correct.

An alternative is to use custom field functions, define it as the current field -10K. And then patch the temperature field using the custom field function.

cikas February 11, 2016 21:41

Transient Inlet Temperature
 
I have a problem in transient model. In my model inlet temperature in a channel changes over time. In addition there is convection boundary condition at the bottom of the channel. Previously I wrote a UDF to calculate heat transfer convection at bottom wall in steady state. Now I want to add transient model to my model, and I add DEFINE_PROFILE(INLET_TEMPRATURE,thread,position) to my previous UDF. My problem is that the result shows that inlet temperature does not change over time. What is your idea?

LuckyTran February 11, 2016 21:49

Quote:

Originally Posted by cikas (Post 584772)
I have a problem in transient model. In my model inlet temperature in a channel changes over time. In addition there is convection boundary condition at the bottom of the channel. Previously I wrote a UDF to calculate heat transfer convection at bottom wall in steady state. Now I want to add transient model to my model, and I add DEFINE_PROFILE(INLET_TEMPRATURE,thread,position) to my previous UDF. My problem is that the result shows that inlet temperature does not change over time. What is your idea?

Make your profile dependent on time.

cikas February 11, 2016 21:59

Quote:

Originally Posted by LuckyTran (Post 584773)
Make your profile dependent on time.

my profile is below. I think that it is time dependent. What do you mean?

DEFINE_PROFILE(INLET_TEMPRATURE,thread,position)
{
real a, b, t;


face_t f;
a=333.15;
b=1/60;
t=CURRENT_TIME;
begin_f_loop(f,thread)
{

F_PROFILE(f,thread,position)=a+b*t;
}

end_f_loop(f,thread)

}

`e` February 11, 2016 23:44

Are your inlet temperatures constantly 333.15 K? You should always use trailing dots on your real numbers to avoid incorrect type casting. For example, 1/60 = 0 (answer is rounded or truncated to zero) whereas 1./60. = 0.0166...

cikas February 12, 2016 15:57

Quote:

Originally Posted by `e` (Post 584779)
Are your inlet temperatures constantly 333.15 K? You should always use trailing dots on your real numbers to avoid incorrect type casting. For example, 1/60 = 0 (answer is rounded or truncated to zero) whereas 1./60. = 0.0166...

Thank you for your response. Yes, my initial temperature is 333.15 along inlet channel (in vertical direction), then this inlet temperature changes linearly by time. There is no other option to make higher precision for the result numbers, because I modified my UDF as your comment, but it seems that the result numbers are rounded too.

`e` February 12, 2016 16:26

How long are your simulations? If t is small then the temperature would have a negligible change over time.

khaham February 13, 2016 11:50

Quote:

Originally Posted by LuckyTran (Post 584469)
Fluent doesn't repeat the last iteration of the previous time-step. Make sure you are actually modifying the fields. After doing EXECUTE_AT_END, make some plots or something and make sure the fields are actually correct.

An alternative is to use custom field functions, define it as the current field -10K. And then patch the temperature field using the custom field function.

Hello;
When I plot the temperature field (i used printf ("%f\n", C_T(c,t)); in side my EXECUETE_AT_END after i have been changed the temperature field at the end of time step 10, Fluent print in TUI console The new field ( the plate has 10000 cells as i want (the fields actually corrected).
But when Fluent start time step 11 it prints in TUI last iteration of time step 10 and perform the calculation without considering my modification.

you said that Fluent doesn't repeat the last iteration of the previous time-step. But Fluent prints always this, suppose the last iteration number of time step 2 is 30 (converged), at the beginning of time step 3 Fluent prints (i will add a picture next time to more explanations)


ite continuity x-velocity... ite/time
30 0.123 E-3 0.00001 .... 00:00
solution is converged
EXECUTE_AT_END(plate-temperature-modify)

time step 2

ite continuity x-velocity...
30 0.123 E-3 0.00001 ..... 00:06
solution is converged
ite
31 (at this point i dont know what is the initial solution that take Fluent to start iterate time step 3 )...... ..............
32
33
..
..
..
..
..
..
45
0 0.3154 E-3 0.000003 ..... 00:00
solution is converged
time step 3

For your proposed alternative, please ,can you give more explanation (example is suitable since i have no idea about it ).
Thank you a lot for your response.

khaham February 13, 2016 12:01

Quote:

Originally Posted by `e` (Post 584411)
That's strange the temperature is first reduced in time step 10 but then returns to the original temperature in time step 11. What is the UDF you are using and how are you initialising the temperature across the plates (considering they have thickness)?

Hello;

The calculation doesn't stop at time step 10 and i initialize the solution with the new field and i will continue the calculation (i do not mean that). But i use the EXECUTE_AT_END time step 10 to tel Fluent to start the time step 11 with the new field automatically.
By the way did you work with first_iteration variable in Fluent (may be we can use it to modify the field at the beginning of time step 11) (any idea my be useful).

thank you for your replay

LuckyTran February 13, 2016 12:30

It's most likely a problem with your EXECUTE_AT_END command.

Quote:

Originally Posted by khaham (Post 585029)
ite continuity x-velocity...
30 0.123 E-3 0.00001 ..... 00:06
solution is converged
ite
31 (at this point i dont know what is the initial solution that take Fluent to start iterate time step 3 )...... ..............

I am hoping that there is also an energy residual... otherwise you are not even solving the energy equation. For some reason your simulation did not iterate the 2nd time-step at all and proceeded to the third iteration.

Check and compare the solution immediately before and immediately after the updating solution at levels n and n-1 message. This line is extremely important if you want to track what's happening during the time-stepping.

If necessary, advance to the time-step manually through TUI commands (but don't do any solve/iterate).

khaham March 15, 2016 08:17

Yes, there is a energy residual, can you more explain how i have to do to check the solution before and immediately after the updating solution at levels n and n-1.

khaham March 15, 2016 08:18

Quote:

Originally Posted by LuckyTran (Post 585032)
It's most likely a problem with your EXECUTE_AT_END command.



I am hoping that there is also an energy residual... otherwise you are not even solving the energy equation. For some reason your simulation did not iterate the 2nd time-step at all and proceeded to the third iteration.

Check and compare the solution immediately before and immediately after the updating solution at levels n and n-1 message. This line is extremely important if you want to track what's happening during the time-stepping.

If necessary, advance to the time-step manually through TUI commands (but don't do any solve/iterate).

Yes, there is a energy residual, can you more explain how i have to do to check the solution before and immediately after the updating solution at levels n and n-1.


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