CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   CEL on Timesteps (repetitive) (https://www.cfd-online.com/Forums/cfx/250384-cel-timesteps-repetitive.html)

mariconeagles96 June 13, 2023 04:47

CEL on Timesteps (repetitive)
 
HI Sirs/madam,

I wanted to use an expression to make a repetitive use of my timestep.

Total time = 150 [min]

Then for every 50min I have this set of timesteps:

Timestep = 10*2, 15*1.5, 15*0.5 <----- this is 50min. I want to repeat this time step 3 times so that I could reach the total time of 150min.

The output of these is like... 2 [min], 2 [min], ... up to 10x, 1.5 [min], 1.5 [min], ... up to 15x and 0.5 [min], 0.5 [min], ... up to 15x and so forth.

Thanks for the help! =)

ghorrocks June 13, 2023 07:07

1) Use a 1D interpolation function, with time step size versus time. It will have three repeats but that is manageable.

2) Use a mod() function to convert time to a periodic signal going from 0 to 50s, so something like: CycleTime = mod(time,50[s]). Then use CycleTime as the x variable for the 1D interpolation function (or if() statements or whatever you are using).

Also: Sudden large changes in time steps are generally best avoided as they massively reduce the accuracy of your time discretisation. You can also have problems with convergence. Most of the time you are better off to just use the finest time step for the entire thing so you can keep a constant time step size. You should try a constant time step of 0.5[s], I bet it is not much slower than your variable time step size and it will be a lot more accurate.

Opaque June 13, 2023 17:09

I agree with Glenn. Unless you know the timesteps you are using will produce a timestep-independent solution, it seems to be looking for problems that are not there.

For the quickest solution, I will just copy the 2 additional steps. That is

Timestep = 10*2, 15*1.5, 15*0.5, 10*2, 15*1.5, 15*0.5, 10*2, 15*1.5, 15*0.5

Done!!

mariconeagles96 June 13, 2023 21:48

Quote:

Originally Posted by Opaque (Post 851798)
I agree with Glenn. Unless you know the timesteps you are using will produce a timestep-independent solution, it seems to be looking for problems that are not there.

For the quickest solution, I will just copy the 2 additional steps. That is

Timestep = 10*2, 15*1.5, 15*0.5, 10*2, 15*1.5, 15*0.5, 10*2, 15*1.5, 15*0.5

Done!!

Thanks OPAQUE! =) Actually my problem is quite complicated for me and I just wanted to make my inquiry simple.

Just to share, my problem is that with a given timestep (for example 10*2 [min]) there is a certain heat load applied to this and so on. But then at the 3rd set of timestep (for example 15*0.5 [min]) there will be a 200% heat load spike and goes back to the 1st load step until the 2nd to reach 50min. So basically its 5 set of timesteps for say 50 min. The actual total test time is about 24 hours. So in a span of 24 hours (1440 min), the number of cycle is about 1440/50min = 28.8 or 29 cycles. 1 cycle is about 5 sets of timesteps with 1 load spike at the middle (3rd timestep).

Example:
load1 = 0.5W ; t1=2min * 10
load2 = 1.0W ; t2=1.5min * 14
load3 = 3.0W ; t3=1.5min * 1 <--- load spike
load4 = 0.5W ; t4=0.5min * 3
load5 = 1.0W ; t5=0.5min * 2

load 1 to 5 is 50min and wanted to do this for 12 or 24 hours.

My objective is to check how long does this mosFET survive with the current test condition.

Thanks again for the help!

mariconeagles96 June 13, 2023 21:52

Quote:

Originally Posted by ghorrocks (Post 851773)
1) Use a 1D interpolation function, with time step size versus time. It will have three repeats but that is manageable.

2) Use a mod() function to convert time to a periodic signal going from 0 to 50s, so something like: CycleTime = mod(time,50[s]). Then use CycleTime as the x variable for the 1D interpolation function (or if() statements or whatever you are using).

Also: Sudden large changes in time steps are generally best avoided as they massively reduce the accuracy of your time discretisation. You can also have problems with convergence. Most of the time you are better off to just use the finest time step for the entire thing so you can keep a constant time step size. You should try a constant time step of 0.5[s], I bet it is not much slower than your variable time step size and it will be a lot more accurate.

Thanks ghorrocks! I'll try my best to learn and apply this method on my current problem. As what I've mentioned to OPAQUE, I will be doing the cycles for 24 hours to check the condition of my mosFET. Anyway, hope you can help too or further give me insights on how to deal with my current simulation setup. =)

Opaque June 14, 2023 09:58

Quote:

Originally Posted by mariconeagles96 (Post 851804)
Thanks OPAQUE! =) Actually my problem is quite complicated for me and I just wanted to make my inquiry simple.

Just to share, my problem is that with a given timestep (for example 10*2 [min]) there is a certain heat load applied to this and so on. But then at the 3rd set of timestep (for example 15*0.5 [min]) there will be a 200% heat load spike and goes back to the 1st load step until the 2nd to reach 50min. So basically its 5 set of timesteps for say 50 min. The actual total test time is about 24 hours. So in a span of 24 hours (1440 min), the number of cycle is about 1440/50min = 28.8 or 29 cycles. 1 cycle is about 5 sets of timesteps with 1 load spike at the middle (3rd timestep).

Example:
load1 = 0.5W ; t1=2min * 10
load2 = 1.0W ; t2=1.5min * 14
load3 = 3.0W ; t3=1.5min * 1 <--- load spike
load4 = 0.5W ; t4=0.5min * 3
load5 = 1.0W ; t5=0.5min * 2

load 1 to 5 is 50min and wanted to do this for 12 or 24 hours.

My objective is to check how long does this mosFET survive with the current test condition.

Thanks again for the help!

I think, then, Glenn's suggestion is the one to follow.


All times are GMT -4. The time now is 01:39.