|
[Sponsors] |
March 14, 2012, 22:03 |
writeControl for certain times ?
|
#1 |
Member
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16 |
Hi all,
Is that possible to write solution out just at specified times? e.g I want solution at just 20*Dt, 40*Dt and 130*Dt. I don't wanna write out anything else, it's both messy and slow down the simulation...I appreciate any help Cheers, |
|
March 16, 2012, 16:05 |
|
#2 |
Member
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16 |
I've not found the solution yet! any idea?
|
|
March 16, 2012, 17:02 |
|
#3 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
You could create a derived class of Time and use that in your solver. Give it the behaviour you want - perhaps extend its "writeInterval" to "writeIntervalList"...
Or if you want to hack it on your top level of your solver, you know how to write conditionals, and runTime.writeNow() forces it to write.
__________________
~~~ Follow me on twitter @DavidGaden |
|
March 16, 2012, 20:22 |
|
#4 |
Member
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16 |
Thank you David, well I'm a newbie in OpenFoam and C++...I'd really appreciate it if you could give me more details on that or maybe a code snippet so I can have a better picture of what I need to do...again thanks for your relpy
|
|
March 16, 2012, 20:28 |
|
#5 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
Sure, at the bottom of the solver you are running, it says "runTime.write();" In place of that, put this:
Code:
if ( mag(runTime.value() - runTime.deltaT().value() * 20) < SMALL) || mag(runTime.value() - runTime.deltaT().value() * 40) < SMALL) || mag(runTime.value() - runTime.deltaT().value() * 130) < SMALL) ) { runTime.writeNow(); } -Dave
__________________
~~~ Follow me on twitter @DavidGaden Last edited by marupio; March 16, 2012 at 20:29. Reason: Oops, changed && to or || |
|
March 18, 2012, 16:33 |
|
#6 |
Member
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16 |
Thank you so much Dave, I really appreciate it
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Transient DPM-About Start Stop times | Julie | FLUENT | 3 | January 24, 2014 08:39 |
benchmark: flow over a circular cylinder | goodegg | Main CFD Forum | 12 | January 22, 2013 12:47 |
writeControl and writeInterval | preichl | OpenFOAM | 0 | June 1, 2011 04:34 |
Drag coefficient is 1000 times smaller ! | Cyril | FLUENT | 12 | April 7, 2006 04:04 |
reporting cpu times | jahangir | Main CFD Forum | 3 | March 25, 2004 16:25 |