|
[Sponsors] |
December 8, 2009, 11:06 |
non-constant blending function
|
#1 |
Member
Sven Degner
Join Date: Mar 2009
Location: Zürich
Posts: 55
Rep Power: 17 |
Dear Foamers,
for my Simulation I will calculate a non-constant blending factor between upwind and CDS. The definition of this factor contains turbulence parameters like epsilon. And this is my problem, where can I implemented the code part 1. in the solver.C, but how its possible to use the turbulence describe parameters in e.g. simpleFoam.C 2. calculate the blending factor in my turbulence modell.C e.g kEpsilon in a return function, but there is the problem how its possible to link this return function to my solver.C Thanks, for any help and I'm really hope anybody got a idea for me Thanks a lot! Sven |
|
December 9, 2009, 07:45 |
|
#2 |
Senior Member
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21 |
Hi Sven,
Your best course of action is the following. 1. Use the localBlended scheme for convections, e.g. divSchemes { div(phi,U) Gauss localBlended linear upwind; } 2. Define a surfaceScalarField called UBlendingFactor in you top level code. If this field is 1 it will use linear (CD), if this field is 0, the localBlended scheme will use the upwind. You can blend any two schemes this way. The name of the blending field is important and should be <field>BlendingFactor. The localBlended scheme will search the database for this field to use as its blending indicator. 3. To do this in you turbulence model is a bit more tricky. I strongly suggest you try to do it in the top level code. You can access most of the turbulence fields via lookups: mesh.lookupObjectvolScalarField>("epsilon") or via calls to the turbulence model base class: turbulence->epsilon()() turbulence->k()() To perform this stuff in the turbulence model is possible. The UBlendingFactor field has to be defined before U is solved for the first time. You could do it by adding the following type of code to your turbulence model constructor: autoPtr<surfaceScalarField> UBlendingFactor (constructor stuff); UBlendingFactor->store(UBlendingFactor); This will switch the ownership of the BlendingFactor object to the central database, from which you can access the object via a lookup: mesh.lookupObject<surfaceScalarField>("UBlendingFa ctor"); Hope this helps. |
|
December 12, 2009, 07:34 |
|
#3 |
Member
Sven Degner
Join Date: Mar 2009
Location: Zürich
Posts: 55
Rep Power: 17 |
thanks eugene,
" turbulence->epsilon()() turbulence->k()() " this is the correct link for me, sven |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compile problem | ivanyao | OpenFOAM Running, Solving & CFD | 1 | October 12, 2012 10:31 |
[blockMesh] BlockMesh FOAM warning | gaottino | OpenFOAM Meshing & Mesh Conversion | 7 | July 19, 2010 15:11 |
Error with Wmake | skabilan | OpenFOAM Installation | 3 | July 28, 2009 01:35 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |