|
[Sponsors] |
July 17, 2019, 15:00 |
Accessing turbulence variables in fvOptions
|
#1 |
Senior Member
Andrea
Join Date: Feb 2012
Location: Leeds, UK
Posts: 179
Rep Power: 16 |
Hello,
I am trying to define a source term for the epsilon equation using a scalarCodedSource in fvOptions. I am using OF v6 and my solver is simpleFoam. In my code I can easily access attributes of my mesh as, for instance: Code:
const vectorField& C = mesh_.C(); The source term I am trying to implement depends also on k and epsilon. Any idea on how I can access the turbulence variable fields from fvOptions? I have tried both Code:
const scalarField& eps = epsilon_; Code:
const scalarField& eps = turbulence->epsilon(); Any help would be greatly appreciated. Andrea |
|
July 18, 2019, 08:25 |
|
#2 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
Try something like (see https://github.com/OpenFOAM/OpenFOAM...nsfer.C#L105):
Code:
const compressible::turbulenceModel &turb = mesh_.lookupObject<compressible::turbulenceModel> ( turbulenceModel::propertiesName ); const volScalarField &eps = turb.epsion(); Perhaps you have to change it to a non-compressible turbulence class depending on your solver. |
|
July 19, 2019, 11:51 |
|
#3 |
Senior Member
Andrea
Join Date: Feb 2012
Location: Leeds, UK
Posts: 179
Rep Power: 16 |
Hi Joachim
thanks for your reply. I have tested your approach but it does not work because compressible::turbulenceModel (or incompressible::turbulenceModel for incompressible cases) is not a valid type to declare within fvOptions. Maybe this can be fixed with a few include statements but I could not find a quick fix. However, I have discovered that the following syntax does the trick: Code:
const scalarField& eps = mesh_.lookupObject<volScalarField>("epsilon"); Andrea |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Turbulence postprocessing | Mohsin | FLUENT | 2 | October 3, 2016 15:18 |
Question on Turbulence Intensity | Eric | FLUENT | 1 | March 7, 2012 05:30 |
UDF to calculate phase-averaged turbulence variables in a periodic flow | ShuangqingXu | Fluent UDF and Scheme Programming | 0 | October 27, 2011 00:48 |
Accessing private variables | robertmaier9 | OpenFOAM Programming & Development | 4 | May 30, 2011 08:06 |
turbulence modeling questions | llowen | Main CFD Forum | 3 | September 11, 1998 05:24 |