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

Divide a time-step to some intervals

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 6, 2012, 15:51
Default Divide a time-step to some intervals
  #1
New Member
 
yes
Join Date: Nov 2012
Posts: 12
Rep Power: 4
Sarah.Tiani is on a distinguished road
Hello guys,
I have started to write a UDF to divide a time step to control the boundary conditions. SO, I want to have some intervals during a time step and change my boundary conditions at each interval during each time-step. Please note that my time-step is fixed.
Can anybody help me?
Thanks
Sarah.Tiani is offline   Reply With Quote

Old   November 6, 2012, 15:57
Default
  #2
Senior Member
 
Syavash
Join Date: Apr 2010
Location: Tehran, Karaj
Posts: 216
Rep Power: 8
syavash is on a distinguished road
Quote:
Originally Posted by Sarah.Tiani View Post
Hello guys,
I have started to write a UDF to divide a time step to control the boundary conditions. SO, I want to have some intervals during a time step and change my boundary conditions at each interval during each time-step. Please note that my time-step is fixed.
Can anybody help me?
Thanks
Hi,
Why you don't try to decrease time step size as small as you need, instead of breaking current time step?!
syavash is offline   Reply With Quote

Old   November 6, 2012, 16:00
Default
  #3
Member
 
vicarious's Avatar
 
Pedram Mojtabavi
Join Date: Apr 2011
Location: Iran
Posts: 66
Rep Power: 6
vicarious is on a distinguished road
Send a message via Yahoo to vicarious
Hello Sarah,
You can use the default UDF in FLUENT user guide for changing a boundary with respect to time. You can add different functions to produce the desired values in each boundary, but if you want to setup a boundary with irregularity, you need to develop the functions.

Best.
vicarious is offline   Reply With Quote

Old   November 6, 2012, 16:09
Default
  #4
New Member
 
yes
Join Date: Nov 2012
Posts: 12
Rep Power: 4
Sarah.Tiani is on a distinguished road
Quote:
Originally Posted by syavash View Post
Hi,
Why you don't try to decrease time step size as small as you need, instead of breaking current time step?!
syavash,
I don't want to decrease the time-step because the boundary conditions must change at each time-step. I mean I have to change the flow conditions at each time-step.
Sarah.Tiani is offline   Reply With Quote

Old   November 6, 2012, 16:10
Default
  #5
New Member
 
yes
Join Date: Nov 2012
Posts: 12
Rep Power: 4
Sarah.Tiani is on a distinguished road
Hello vicarious,
can you specify more? what do you mean with irregularity?
Sarah.Tiani is offline   Reply With Quote

Old   November 6, 2012, 16:20
Default
  #6
Member
 
vicarious's Avatar
 
Pedram Mojtabavi
Join Date: Apr 2011
Location: Iran
Posts: 66
Rep Power: 6
vicarious is on a distinguished road
Send a message via Yahoo to vicarious
Quote:
Originally Posted by Sarah.Tiani View Post
Hello vicarious,
can you specify more? what do you mean with irregularity?
For example I used to work with a pulsed injection boundary and I defined a step function to produce 0 and 1 to inject a high pressure jet pulse in each time step. What kind of conditions do you need? Is it periodic or could be specified by a function?
vicarious is offline   Reply With Quote

Old   November 6, 2012, 16:28
Default
  #7
New Member
 
yes
Join Date: Nov 2012
Posts: 12
Rep Power: 4
Sarah.Tiani is on a distinguished road
Quote:
Originally Posted by vicarious View Post
For example I used to work with a pulsed injection boundary and I defined a step function to produce 0 and 1 to inject a high pressure jet pulse in each time step. What kind of conditions do you need? Is it periodic or could be specified by a function?
That's awesome vicarious,
seems exactly what I need. I want to set the inlet pressure a constant for a specific time-interval in a time-step and change the pressure to another fix value for the remaining times of the time-step. This pattern must be repeated till the end of simulation.
What do you think?
Sarah.Tiani is offline   Reply With Quote

Old   November 6, 2012, 16:32
Default
  #8
Senior Member
 
Syavash
Join Date: Apr 2010
Location: Tehran, Karaj
Posts: 216
Rep Power: 8
syavash is on a distinguished road
Quote:
Originally Posted by Sarah.Tiani View Post
syavash,
I don't want to decrease the time-step because the boundary conditions must change at each time-step. I mean I have to change the flow conditions at each time-step.
You are right, actually dividing time step makes no sense. I think you are going to solve the flow in transient mode. Well, what exactly you need to know?!
syavash is offline   Reply With Quote

Old   November 6, 2012, 16:35
Default
  #9
Senior Member
 
Syavash
Join Date: Apr 2010
Location: Tehran, Karaj
Posts: 216
Rep Power: 8
syavash is on a distinguished road
Quote:
Originally Posted by Sarah.Tiani View Post
That's awesome vicarious,
seems exactly what I need. I want to set the inlet pressure a constant for a specific time-interval in a time-step and change the pressure to another fix value for the remaining times of the time-step. This pattern must be repeated till the end of simulation.
What do you think?
You should use Define_Profile macro to specify a transient B.C.
syavash is offline   Reply With Quote

Old   November 6, 2012, 16:36
Default
  #10
New Member
 
yes
Join Date: Nov 2012
Posts: 12
Rep Power: 4
Sarah.Tiani is on a distinguished road
Quote:
Originally Posted by syavash View Post
You are right, actually dividing time step makes no sense. I think you are going to solve the flow in transient mode. Well, what exactly you need to know?!
Thanks dear siavash,
In fact in my problem (unsteady) the inlet pressure changes twice at each time step. so suppose that each time step takes 3 seconds. the pressure is 0 till the 1st second of the time step and the pressure changes to 100 from 1st to the end of time step. this pattern must be repeated till the end of simulation.
I am really stuck at this one
Sarah.Tiani is offline   Reply With Quote

Old   November 6, 2012, 16:37
Default
  #11
New Member
 
yes
Join Date: Nov 2012
Posts: 12
Rep Power: 4
Sarah.Tiani is on a distinguished road
Quote:
Originally Posted by syavash View Post
You should use Define_Profile macro to specify a transient B.C.
exactly,
but I didn't see any macro to split a time-step.
Sarah.Tiani is offline   Reply With Quote

Old   November 6, 2012, 16:44
Default
  #12
Senior Member
 
Syavash
Join Date: Apr 2010
Location: Tehran, Karaj
Posts: 216
Rep Power: 8
syavash is on a distinguished road
Quote:
Originally Posted by Sarah.Tiani View Post
exactly,
but I didn't see any macro to split a time-step.
It seems that I can't get what you mean. Time step is a physical parameter and you may change it depending on the problem.
Why you just don't define time step size as 1 second?! Then specify b.c. to each time step and don't bother yourself!
syavash is offline   Reply With Quote

Old   November 6, 2012, 16:45
Default
  #13
Member
 
vicarious's Avatar
 
Pedram Mojtabavi
Join Date: Apr 2011
Location: Iran
Posts: 66
Rep Power: 6
vicarious is on a distinguished road
Send a message via Yahoo to vicarious
Look at this profile and see if it helps:
**********************************
#include "udf.h"
DEFINE_PROFILE(injection_pulsed_flux, thread, position)
{
face_t f;
real t = CURRENT_TIME;
int n;
real pi;
n = 1000000.*t/1.7;
pi = 1.570796;
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) = fabs(sin(pi*n));
}
end_f_loop(f, thread)
}
************************************************** **
You see the SIN function used in this udf periodically produces 0 & 1 with each time step (1000000=1/(time step)). I'm afraid I do not realize what you mean by "a specific time-interval in a time-step", But if you consider to have a specific value for boundary in a periodic form (in this case 0 and 1 constantly), then you can organize this code as you want. Let me know if it works out.
vicarious is offline   Reply With Quote

Old   November 6, 2012, 16:47
Default
  #14
New Member
 
yes
Join Date: Nov 2012
Posts: 12
Rep Power: 4
Sarah.Tiani is on a distinguished road
Siavash,
the type of problem that I solving depends on each time step. If I wanna set each time step equal to 1 second, I have to set pressure equal to zero from beginning to 0.03th second of time step and set to 100 till the end of time step.
Sarah.Tiani is offline   Reply With Quote

Old   November 6, 2012, 16:55
Default
  #15
Senior Member
 
Syavash
Join Date: Apr 2010
Location: Tehran, Karaj
Posts: 216
Rep Power: 8
syavash is on a distinguished road
Quote:
Originally Posted by Sarah.Tiani View Post
Siavash,
the type of problem that I solving depends on each time step. If I wanna set each time step equal to 1 second, I have to set pressure equal to zero from beginning to 0.03th second of time step and set to 100 till the end of time step.
I am not sure but thinking it is not possible since at each time step fluent does not march on time. Unsteady term is like a source term which is added to N-S equations and is solved iterative.
syavash is offline   Reply With Quote

Old   November 6, 2012, 16:56
Default
  #16
New Member
 
yes
Join Date: Nov 2012
Posts: 12
Rep Power: 4
Sarah.Tiani is on a distinguished road
Let me make it simpler,
Is it possible I write a UDF that repeats at each time-step?
Sarah.Tiani is offline   Reply With Quote

Old   November 6, 2012, 17:00
Default
  #17
Senior Member
 
Syavash
Join Date: Apr 2010
Location: Tehran, Karaj
Posts: 216
Rep Power: 8
syavash is on a distinguished road
Quote:
Originally Posted by Sarah.Tiani View Post
Let me make it simpler,
Is it possible I write a UDF that repeats at each time-step?
I can't be sure what you mean from "repeating at each time step" but you may write a udf which could be executed at each iteration.
syavash is offline   Reply With Quote

Old   November 6, 2012, 17:04
Default
  #18
New Member
 
yes
Join Date: Nov 2012
Posts: 12
Rep Power: 4
Sarah.Tiani is on a distinguished road
syavash,
suppose I wanna execute a problem only for 5 seconds. I change the boundary conditions twice at two time intervals at this time step. OK? it is easy and I wrote the UDF.
Right now I wanna repeat this process for the next 5 seconds. Again I wanna repeat for the next 5 seconds. Again .....
my bad, maybe I couldn't convey myself correctly. Hope this works
Sarah.Tiani 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
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
Hydrostatic Pressure and Gravity miliante OpenFOAM Running, Solving & CFD 132 October 7, 2012 22:50
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 9 January 3, 2012 09:06
Time step, Number of time step, Maxximum Iterations per time step sandisk FLUENT 0 July 18, 2011 02:57
unsteady calcs in FLUENT Sanjay Padhiar Main CFD Forum 1 March 31, 1999 12:32


All times are GMT -4. The time now is 10:24.