|
[Sponsors] |
August 6, 2010, 15:01 |
Write out temp object during simulation
|
#1 |
Senior Member
n/a
Join Date: Sep 2009
Posts: 199
Rep Power: 17 |
I would like to write out a temporary volScalarField object:
virtual tmp<volScalarField> alphaEff during simulation. Is this possible to do in OpenFOAM somehow? Best regards Deji |
|
August 6, 2010, 15:51 |
|
#2 |
Senior Member
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23 |
Why make it temporary if you want to write it out?
And I've never seen a virtual variable before. However, I see what you're getting at. You can use .write() to write that object to file at any point in a simulation. Or you can create an IOobject with AUTO_WRITE, and assign alphaEff to it. Then it will be output every writeInterval (in controlDict).
__________________
Laurence R. McGlashan :: Website |
|
August 7, 2010, 06:11 |
|
#3 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
||
August 7, 2010, 06:19 |
|
#4 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
Since the alphaEff method returns a tmp<volScalarField> you'll either need to dereference it, or create a volScalarField from it. Option 1 (not particularly elegant), create a volScalarField: Code:
{ volScalarField alphaEff = turb.alphaEff(); alphaEff.write(); } Code:
{ tmp<volScalarField> talphaEff = turb.alphaEff(); talphaEff().write(); } Code:
turb.alphaEff()().write(); |
||
August 7, 2010, 08:23 |
|
#5 |
Senior Member
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23 |
Although you may not want to write out the file evey time step. Perhaps enclose it in this?
Code:
if(runTime.outputTime()) { turb.alphaEff()().write(); }
__________________
Laurence R. McGlashan :: Website |
|
August 7, 2010, 19:01 |
|
#6 |
Senior Member
n/a
Join Date: Sep 2009
Posts: 199
Rep Power: 17 |
Thank you very much guys. I will try your suggestions in my computation.
Best regards Deji |
|
June 4, 2013, 10:39 |
|
#7 |
Member
Saba Saeb
Join Date: Dec 2010
Location: Erlangen, Germany
Posts: 32
Rep Power: 16 |
Anyone happen to know how I can output nuTilda field calculated in SpalartAllmaras model?
Cheers, Saba |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mesh file for flow over a circular cylinder | Ardalan | Main CFD Forum | 7 | December 15, 2020 14:06 |
Simulation doesn't meet reality | Hans | FloEFD, FloWorks & FloTHERM | 1 | June 9, 2010 09:59 |
Replacing mesh while running a simulation | akultane | CFX | 1 | November 15, 2009 14:46 |
What's the best order to run this simulation in? | siw | CFX | 1 | November 4, 2009 20:42 |
Overflow problem in steady simulation | ReeKo | CFX | 11 | October 8, 2008 18:57 |