# non-constant blending function

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

 December 8, 2009, 11:06 non-constant blending function #1 Member   Sven Degner Join Date: Mar 2009 Location: Zürich Posts: 54 Rep Power: 10 Sponsored Links 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: 14 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 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 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("UBlendingFa ctor"); Hope this helps. nimasam likes this.

 December 12, 2009, 07:34 #3 Member   Sven Degner Join Date: Mar 2009 Location: Zürich Posts: 54 Rep Power: 10 thanks eugene, " turbulence->epsilon()() turbulence->k()() " this is the correct link for me, sven

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 09:31 gaottino OpenFOAM Native Meshers: blockMesh 7 July 19, 2010 14:11 skabilan OpenFOAM Installation 3 July 28, 2009 00:35 ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50 Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00