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

Programming a duty cycle in CFX

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 2, 2013, 17:17
Default Programming a duty cycle in CFX
  #1
New Member
 
Anon
Join Date: Oct 2013
Posts: 5
Rep Power: 3
merper is on a distinguished road
Ok, I'm guessing this is probably a simple thing to implement, but I've spent all morning searching and can only jury rig a solution so far. How do I use a loop or create and expression to turn a boundary condition on and off for 10, 20, 30...% of the time.

Right now, I'm using a simple if statement to create the cycle:

.6253 [V] - if(atstep >(DutyCyclePercentage*.8[s]/10)/TimestepSize, .6253 [V], 0 [V]) +if(atstep > 8[s]/TimestepSize,.6253[V],0[V])- if(atstep >(8[s]+DutyCyclePercentage*.8[s]/10)/TimestepSize, .6253 [V], 0 [V]) + if(atstep >16[s]/TimestepSize,.6253[V],0[V])-.....


but I basically have to repeat this over and over for the length of my simulation. How do I simplify this with a loop? I can't find the syntax.
merper is offline   Reply With Quote

Old   October 2, 2013, 18:10
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 10,824
Rep Power: 85
ghorrocks has a spectacular aura aboutghorrocks has a spectacular aura aboutghorrocks has a spectacular aura about
Use the mod function to work out where in the current cycle you are. Then do a single if statement on that value to get a repeating duty cycle signal.
ghorrocks is offline   Reply With Quote

Old   October 2, 2013, 18:34
Default
  #3
New Member
 
Anon
Join Date: Oct 2013
Posts: 5
Rep Power: 3
merper is on a distinguished road
Ah, so simple. Yeah thanks.

if(mod(atstep,cyclelength),true,false)
merper 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
CFX Treatment of Laminar and Turbulent Flows Jade M CFX 6 January 26, 2013 11:11
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 15:45
Different flow pattern between OpenFOAM and CFX AirS OpenFOAM 0 January 12, 2010 08:08
CFX 10's solutions differ from CFX 5.7's Atit Koonsrisuk CFX 4 July 26, 2006 11:59
CFX 4.4 installation problem Pandu Sattvika CFX 1 December 1, 2001 05:07


All times are GMT -4. The time now is 00:18.