CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Change BC during the run? (http://www.cfd-online.com/Forums/fluent/32457-change-bc-during-run.html)

jx November 6, 2003 08:14

Change BC during the run?
 
Hi, all,

Is it possible for me to use some kind of BC seetings to get an initial flow field after certain iterations, and then change the BC and continue the run untill converged?

For example, I use a guessed temperature level at a wall to get an initial solution, and then change the temperature condition for that wall to constant heat flux condition and hope to get the real solution.

I don't know how fluent saves case information, but I feel if I continue the iterations from previous saved .cas and .dat files, fluent always picks up the previous boundary condition seetings and does not take the newly modified BC.

How can I do this?

Thanks,

jx

ap November 6, 2003 09:45

Re: Change BC during the run?
 
If you want to change a BC during calculation, just stop it where you want, open the Boundary Conditions panel and set the new boundary condition. Save the case file and start the calculation again.

Hi :)

ap

Ajay Rao November 6, 2003 11:40

Re: Change BC during the run?
 
You could use a UDF , and while iterating you have a choice of updating your UDF after every iteration where in you could set the new coundary condition. You could check for the time and also apply it after a time step. Using UDF's allows this to be done. Regards, Ajay

eric November 6, 2003 12:28

Re: Change BC during the run?
 
Hi jx,

You say

"For example, I use a guessed temperature level at a wall to get an initial solution, and then change the temperature condition for that wall to constant heat flux condition and hope to get the real solution".

This seems like a good idea, does it work?

Eric

David November 6, 2003 12:30

Re: Change BC during the run?
 
hi,

all these comments are quite interesting!

Ajay, would it be possible to give us the UDF that would set the new boundary conditions with time?

thank you

regards

David

jx November 6, 2003 17:49

Re: Change BC during the run?
 
So the critical step here is to "save the case file" and then restart the calculations, right? I previously just didn't save the case file after changing BC settings.

I'll try what you said. Thanks, ap!

jx

ap November 6, 2003 20:22

Re: Change BC during the run?
 
Dear jx, to clarify, I'll do an example. Let's say I have a pipe: velocity inlet and outflow boudary conditions.

I run my calculation for a while, then I decide to change the outflow BC to a pressure outlet.

I stop the calculation where I need to, I open the Boundary condition panel, and then change the BC and set it's new parameters.

Saving the case file just allows me to have all calculated data before the change, but it doesn't affect the BC change. This way I can go back, if I did something wrong in the change, without starting the calculation from scratch.

However, if I don't save and immediatly start iterations after the change, FLUENT will immediatly use the new BC anyway.

Hi :)

ap

Ajay Rao November 6, 2003 21:45

Re: Change BC during the run?
 
define time ,T as global variable real time, told;

DEFINE_PROFILE(set_Temp,tf,nv)

{

begin_f_loop (face,tf)

{

if (time != told)

{

T = new_temperature;

told=time;

}

F_PROFILE(face,tf,nv)= T

}

end_f_loop (face,tf)

UDF is updated every iteration. First time when the UDF runs oldtime=0; time=0.0001 ( deltat=0.0001) since times are different T=new_temperature and is applied to all the faces of the boundary. nxt iteration UDF is updated but now both times are same , new_temperature is not calculated and thus the F_PROFILE applies the "old_temperature(calculated at previous time step )" .Thus temperature can be changed at every time interval.


All times are GMT -4. The time now is 11:55.