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

codedMixed BC not applied

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 21, 2021, 00:30
Default codedMixed BC not applied
  #1
New Member
 
mahesh
Join Date: May 2019
Posts: 1
Rep Power: 0
mahesh_s is on a distinguished road
Hi,

I am trying to apply fixedValue BC to some portion of the boundary patch and zeroGradient to remaining patch. I used codedMixed to apply the BC. What I found was, though the code compiles fine, the BC's are not applied to the patch.
I am attaching the code. Can any one please tell me where I made the mistake.

Code:
 upperWall
    {
        type            codedMixed;
        refValue        uniform 0;
        refGradient     uniform 0;
        valueFraction   uniform 0;
        

        name    upperWallMixed;  

        code
        #{
            const fvPatch& bp = this->patch();
            const vectorField& cf = bp.Cf();
            scalarField& rValue = this->refValue();
            scalarField& rGrad = this->refGrad();
            scalarField& vFraction = this->valueFraction(); 
            
            forAll(cf, i)
            {
                const scalar x = cf[i].x();                
                if ((x > 0.2) && (x < 0.3))
                {
                    rValue[i] = 10;
                    rGrad[i] = 0.0;
                    vFraction[i] = 1;
                
                }
                rValue[i] = 0;
                rGrad[i] = 0.0;
                vFraction[i] = 0;                
            }
                    
        #};
    }
mahesh_s is offline   Reply With Quote

Reply

Tags
codedmixed


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
Intuition for why flow follows convex surfaces lopp Main CFD Forum 47 February 1, 2022 14:14
Different results using Swak and CodedMixed gionni OpenFOAM Programming & Development 2 March 12, 2021 07:22
codedMixed condition - not applied s.blaise OpenFOAM Pre-Processing 1 September 3, 2020 05:54
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch gschaider OpenFOAM Installation 225 August 25, 2015 20:43
COMSOL: optimization applied to a laminar flow tdh89 COMSOL 0 April 30, 2012 09:57


All times are GMT -4. The time now is 02:53.