CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] Alternating scalar BC using groovyBC for a super focus mixer

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 3, 2014, 11:01
Default Alternating scalar BC using groovyBC for a super focus mixer
  #1
New Member
 
Dominik Pöltl
Join Date: Jul 2013
Location: Hamburg
Posts: 21
Rep Power: 12
Yeru is on a distinguished road
Hi @ all,

I'm working on simulating a super focus mixer.


Here's the checkmesh.log. All fine.
Since "in real life" the nozzles for fluid A and B shall alternate in the focus inlet in x-direction, I want to assign alternating scalar values for T using scalarTransportFoam with groovyBC.

Below you find the 0/T-file.
Here's the general idea:
-circ is the circumference of the focus inlet
-n is the total number of nozzles
I'm creating the vector vec for calculation
mag(vec)%(circ/n)
If this is <=0.5 I want to assign value A, otherwise value B.

Using scalarTransportFoam works without any warnings (log-file) but in ParaView, the focus inlet is globally assigned my "failsafe" value 0.1.

I'm certain there are no mess-ups due to convertToMeters or anything alike.

Any ideas how to get by this?
Much appreciated,
Dominik

0/T-file:
Code:
internalField   uniform 0;

boundaryField
{
    focus_inlet
    {
    type           groovyBC;
    variables    "n=5;alpha=pi*50/180;b_channel=500e-3;l_focus=1000e-3;r=(b_channel/2+tan(alpha/2)*l_focus)/(sin(alpha/2));circ=r*alpha;vec=vector(pos().x,0,pos().z-l_focus);";
//    condition ? value_if_true : value_if_false 
    valueExpression "mag(vec)%(circ/n)<=0.5    ?    1    :    0.5";
    value         uniform 0.1;
    }

    channel_outlet
    {
        type            zeroGradient;
    }

    walls
    {
        type            zeroGradient;
    }

Last edited by Yeru; July 3, 2014 at 11:03. Reason: looks better :)
Yeru is offline   Reply With Quote

Reply

Tags
alternating bc, groovybc, super focus mixer


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 04:18
Division by zero exception - loop over scalarField Pat84 OpenFOAM Programming & Development 6 February 18, 2017 05:57
Issue symmetryPlane 2.5d extruded airfoil simulation 281419 OpenFOAM Running, Solving & CFD 5 November 28, 2015 13:09
Diverging solution in transonicMRFDyMFoam tsalter OpenFOAM Running, Solving & CFD 30 July 7, 2014 06:20
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 01:47


All times are GMT -4. The time now is 10:41.