CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM

non-constant blending function

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By eugene

LinkBack Thread Tools Display Modes
Old   December 8, 2009, 11:06
Default non-constant blending function
Sven Degner
Join Date: Mar 2009
Location: Zürich
Posts: 55
Rep Power: 10
sven82 is on a distinguished road
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!
sven82 is offline   Reply With Quote

Old   December 9, 2009, 07:45
Senior Member
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 14
eugene is on a distinguished road
Hi Sven,

Your best course of action is the following.

1. Use the localBlended scheme for convections, e.g.

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:


or via calls to the turbulence model base class:


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);


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.
nimasam likes this.
eugene is offline   Reply With Quote

Old   December 12, 2009, 07:34
Sven Degner
Join Date: Mar 2009
Location: Zürich
Posts: 55
Rep Power: 10
sven82 is on a distinguished road
thanks eugene,

" turbulence->epsilon()()
turbulence->k()() "

this is the correct link for me,

sven82 is offline   Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 09:31
BlockMesh FOAM warning gaottino OpenFOAM Native Meshers: blockMesh 7 July 19, 2010 14:11
Error with Wmake skabilan OpenFOAM Installation 3 July 28, 2009 00:35
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50
Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00

All times are GMT -4. The time now is 16:13.