|
[Sponsors] |
June 16, 2014, 07:11 |
Output of tmp<volScalarField> data
|
#1 |
New Member
Christoph Wenzel
Join Date: May 2014
Location: Germany
Posts: 21
Rep Power: 11 |
I'm doing DDES calculation in OpenFoam and want to show me the gridcells, that are calculated with RANS and those that are calculated with LES.
Therefore I created a new turbulenceModel called mySpalartAllmarasDDES that is a simple copy of the standard SpalartAllmarasDDES. There are the following lines in the mySpalartAllmarasDDES.C file: Code:
volScalarField mySpalartAllmarasDDES::dTilda(const volScalarField& S) const { return max ( y_ - fd(S) *max(y_ - CDES_*delta(), dimensionedScalar("zero", dimLength, 0)), dimensionedScalar("small", dimLength, SMALL) ); } So my Question is: is there any possibility, to write out tmp-datas? For example anything like Code:
volScalarField dTilda_output... ( NO_READ MUST_WRITE... ) dTilda_output = dTilda; |
|
November 30, 2018, 10:46 |
|
#2 | |
New Member
Terrence Nguyen
Join Date: Jan 2012
Posts: 13
Rep Power: 14 |
Quote:
Does anyone have the answer for this problem?? |
||
November 30, 2018, 11:56 |
|
#3 |
Senior Member
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 21 |
Hi, cant you just use the following method? I use it for temperature dependent density to be written during simulation...
Code:
tmp<volScalarField> incompressibleTwoPhaseThermoMixture::rho1() const { return tmp<volScalarField> ( new volScalarField ( IOobject ( "rho1", mesh_.time().timeName(), mesh_, IOobject::NO_READ, IOobject::AUTO_WRITE ), rho1_ + linearCoeff1_ * (T().oldTime() - TRef1_) + polyCoeff1_ * sqr(T().oldTime() - TRef1_) ) ); } second method would be to define dTilda as volScalarField globally (don't define it in local scope of your function as you are not allowed to return local variable) and do the calculation in your function and then return it: in your header file define dTilda_ as private variable: Code:
volScalarField dTilda_; Code:
dTilda_ ( IOobject ( "dTilda", U.time().timeName(), U.mesh(), IOobject::NO_READ, IOobject::AUTO_WRITE ), U.mesh(), dimensiondScalar("zero", dimension, scalar(0)) ) Last edited by Daniel_Khazaei; December 1, 2018 at 08:44. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[ICEM] Data structure of output file from ICEM for my own code | openfoammaofnepo | ANSYS Meshing & Geometry | 0 | July 1, 2013 17:24 |
help for data output | aki_yafuji | OpenFOAM Running, Solving & CFD | 0 | September 12, 2010 07:15 |
How to output data from stationary part only? | Aerolex | FLUENT | 0 | November 16, 2009 22:46 |
output data for unsteady flow case | wieke | Main CFD Forum | 0 | September 30, 2003 04:40 |
Data output collection | simon | Main CFD Forum | 0 | September 29, 2003 09:03 |