CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

heat source vary with time

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 26, 2015, 21:44
Default heat source vary with time
  #1
Member
 
Join Date: Jun 2011
Posts: 32
Rep Power: 14
mariconeagles96 is on a distinguished road
HI there!

I have a problem with which I would like to do in cfx. I have 2 chips having high power (10W) at a certain time say for 2 sec and then after that it will shut off (0W) for 20 sec. How can I input this as an expression in my Heat source using transient simulation? I also wanted my time to be short like say .... for 1.5 sec i will divide it by 0.1s (15 timestep) and then 10sec by 1s (10 timesteps) and lastly 10sec by 2s (5 timesteps). All have 5 coefficient loops.

Thanks guys! =)
mariconeagles96 is offline   Reply With Quote

Old   July 27, 2015, 06:29
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,700
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
You can do this easily, by at least 2 methods:
1) Use a 1D interpolation function
2) Use a CEL expression. Something like timestep = if(t<1.5[s],0.1[s],if(t<11.5[s],1[s],2[s])) will do your time step function.
ghorrocks is offline   Reply With Quote

Old   July 27, 2015, 21:30
Default
  #3
Member
 
Join Date: Jun 2011
Posts: 32
Rep Power: 14
mariconeagles96 is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
You can do this easily, by at least 2 methods:
1) Use a 1D interpolation function
2) Use a CEL expression. Something like timestep = if(t<1.5[s],0.1[s],if(t<11.5[s],1[s],2[s])) will do your time step function.
Thanks as usual for your support @ghorrocks! =)

anyway, if i do 5 cycles (total time is 125s) how can i do this? My statement is something like this:

Q=0
Q1=10W

So if at 1.5sec my power is Q1 then run it until 25 sec for Q. My formulated heat source expression should be something like this?

heat source = if (t<1.5, Q1, Q, if (t<26.5, Q1, Q)) and soon...

can you teach me on how to properly write my code? Thanks a lot! =)

btw, my timestep on 1 cycle is something like this: Timesteps = 10*0.1, 4*0.25, 6*0.5, 10*1, 5*2 [s]
mariconeagles96 is offline   Reply With Quote

Old   July 27, 2015, 21:56
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,700
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Doing it using if statements gets pretty horrible pretty quickly. Two options come to mind:
1) Do it using a 1D interpolation function and generate the function you wish.
2) Use the mod function to work out where in the cycle you are. I think mod(t,25[s]) will give you the time into the current 25 second cycle. Then you only need to define the function for one cycle.
ghorrocks is offline   Reply With Quote

Old   July 28, 2015, 02:21
Default
  #5
Member
 
Join Date: Jun 2011
Posts: 32
Rep Power: 14
mariconeagles96 is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
Doing it using if statements gets pretty horrible pretty quickly. Two options come to mind:
1) Do it using a 1D interpolation function and generate the function you wish.
2) Use the mod function to work out where in the cycle you are. I think mod(t,25[s]) will give you the time into the current 25 second cycle. Then you only need to define the function for one cycle.
I totally agree with this! =)

But can you help me creating the function? Sorry coz Im new to this CEL thing...

User Function:
For #1) Argument Units = [s]; Result Units = [kg m^2 s^-3] <--- watts

Since this have 5 cycles, I will just input conditions on 1 cycle where:

Coordinate = 1.5 ; Value = 16
Coordinate = 25 ; Value = 0

Is this correct?

As for the mod function on my transient timestep... sorry I have no idea how to formulate. Hope you can help me out. Will try to read and study more so that I can understand deeply on what you are trying to teach.

I apologize for the time and thanks for being patient.
mariconeagles96 is offline   Reply With Quote

Old   July 28, 2015, 05:50
Default
  #6
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,700
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Here's some CEL which will turn the power on for 1s and off for 10s forever:

Cycletime = mod(t,11[s])
HeaterPower = if(Cycletime<1[s],100[W],0[W])

If you use a CEL function to control time step size then you have to validate that every bit of your time step function is OK - a nightmare. A much better approach is just to use adaptive time stepping, homing in on 3-5 coeff loops per iteration and with a min and max time step size wide enough that you never hit them.
ghorrocks is offline   Reply With Quote

Old   July 29, 2015, 02:03
Default
  #7
Member
 
Join Date: Jun 2011
Posts: 32
Rep Power: 14
mariconeagles96 is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
Here's some CEL which will turn the power on for 1s and off for 10s forever:

Cycletime = mod(t,11[s])
HeaterPower = if(Cycletime<1[s],100[W],0[W])

If you use a CEL function to control time step size then you have to validate that every bit of your time step function is OK - a nightmare. A much better approach is just to use adaptive time stepping, homing in on 3-5 coeff loops per iteration and with a min and max time step size wide enough that you never hit them.
i see...so to make it simple if i only make 2 cycles what wil be my cycletime?

my conditions are these:
Heat ON ---> 2s, 27s
Heat OFF --> 2s to 25s and 27s to 50s

These are already 2 cycles. How can I simply this using adaptive time stepping?

For the heat source my CEL should be: heaterPower = if(Cycletime<1[s],100[W],0[W])

For the transient adaptive panel:
Total time = 50sec
Option: Adaptive
First Update Time = ?
Timestep Update Freq = ?
Initial timestep = ?
Num of Coeff Loops; Max Time Step =? ; Min Time Step =?
Target max Loops = 5 (default)
Target min Loops = 2 (default)
Timestep Dec Fac = 0.8 (default)
Timestep Inc Fac = 1.06 (default)

Thanks again @ghorrocks! I found little success on these adaptive transient examples on the web and so Im here. =)
mariconeagles96 is offline   Reply With Quote

Old   July 29, 2015, 06:13
Default
  #8
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,700
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
I will let you sort out the details of the CEL expression. I think you get the idea.

For adaptive time stepping:
Total time = 50sec (Whatever you want the total time to be)
Option: Adaptive
First Update Time = ? (a small number so it starts updating on the first time step).
Timestep Update Freq = ? (Use 1 so it updates every time step)
Initial timestep = ? (Your best guess for the initial time step. If you run it and it quickly makes the time step bigger or smaller then stop the run, change the initial time step to the value it wants to use and restart)
Num of Coeff Loops;
Max Time Step =? ; (use 1e10 so it never hits it)
Min Time Step =? (use 1e-10 so it never hits it)
Target max Loops = 5 (default)
Target min Loops = 2 (default)
Timestep Dec Fac = 0.8 (default)
Timestep Inc Fac = 1.06 (default)
ghorrocks is offline   Reply With Quote

Old   July 31, 2015, 04:33
Default
  #9
Member
 
Join Date: Jun 2011
Posts: 32
Rep Power: 14
mariconeagles96 is on a distinguished road
thanks @ghorrocks! will try my best and hopefully I could get this done.
mariconeagles96 is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 16:02
Compressor Simulation using rhoPimpleDyMFoam Jetfire OpenFOAM Running, Solving & CFD 107 December 9, 2014 13:38
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 10:57
time dependent source using DEFINE_SOURCE T81 Fluent UDF and Scheme Programming 5 February 28, 2011 17:23
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


All times are GMT -4. The time now is 07:15.