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

componentMixed BC in the motionU file

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 1, 2014, 16:30
Default componentMixed BC in the motionU file
  #1
Senior Member
 
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 14
sasanghomi is on a distinguished road
Hi Foamers ,

I want to know about this BC in the motionU file:
type componentMixed;
refValue uniform (0 0 0);
valueFraction uniform (1 0 1);


How does it work? I know it is a combination of Neuman and Dirichlet BCs. Actually I want to know the meaning of refValue uniform (0 0 0); and valueFraction uniform (1 0 1); exactly !!
Could anyone explain it mathematically ?

I appreciate your help.
Thanks and best regards
Sasan.

sasanghomi is offline   Reply With Quote

Old   March 3, 2014, 06:54
Default
  #2
Senior Member
 
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 14
sasanghomi is on a distinguished road
Any ideas?
sasanghomi is offline   Reply With Quote

Old   March 3, 2014, 07:20
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Sasan,
  1. Which OpenFOAM version are you referring to?
  2. Which tutorial case?
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   March 3, 2014, 09:09
Default
  #4
Senior Member
 
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 14
sasanghomi is on a distinguished road
Hi Dear Bruno,

Thanks for your reply.I am using OP 1.6-ext and about tutorial case , I should say Prof.Jasak has attached a test case about engine simulation in this thread : http://www.cfd-online.com/Forums/ope...changes-4.html
honestly, I need to know this BC in the motionU file in the zero (0) directory. Also I attached this test case here. Please help me to gain a lot of information about this BC.

I appreciate your help,
Thanks and best regards.
Sasan.
Attached Files
File Type: gz simpleEngine_HJ_25Mar2011.tar.gz (11.1 KB, 12 views)
sasanghomi is offline   Reply With Quote

Old   March 3, 2014, 13:41
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Sasan,

When in doubt, look at the source code. Here's what I've done:
  1. Went into the folder for the main source code libraries:
    Code:
    cd $FOAM_SRC
  2. Searched for the boundary condition in question:
    Code:
    find . -iname "*componentMixed*"
  3. The first one seems the most likely, namely the files at:
    Code:
    OpenFOAM/fields/PointPatchFields/derived/componentMixed/ComponentMixedPointPatchVectorField.*
  4. The class description in the ".H" file, says this:
    Quote:
    Code:
        ComponentMixedPointPatchVectorField. The boundary condition is a mix
        of a fixedValue and a zeroGradient boundary condition, where a
        fixedValue/zeroGradient mix may be different for each direction.
    
        I am still not sure how to do the fixedValue-fixedGradient
        combination.  HJ, date deleted
  5. Looking at the ".C" file, it's a buit tricky to figure out what-is-what:
    1. The method that has the description "Evaluate patch field" is the one responsible for the actual boundary condition field calculations. The specific code is this one:
      Code:
          vectorField values =
             cmptMultiply(refValue_, valueFraction_)
             + cmptMultiply(internalValues, vector::one - valueFraction_);
      For your example:
      Quote:
      refValue uniform (0 0 0);
      valueFraction uniform (1 0 1);
      It does this:
      Code:
      (0 0 0)*(1 0 1) + U * ((1 1 1) - (1 0 1)) =
      (0 0 0) + U * (0 1 0) =
      (0 Uy 0)
    2. The method that has the description "Set boundary condition to matrix", seems to do a manipulation to the equation matrix, by hacking into the mesh points for the patch which was assigned this boundary condition, by setting a constraint for each point on the patch. This requires us to look for what the class "MatrixType<vector>::ConstraintType" actually does.
  6. Another find command:
    Code:
    find . -iname "*MatrixType*"
    Gets me nothing... Ooops, that's because "MatrixType" is a object name place-holder, given that this is a template class. OK, let's do a broader search, this time searching inside certain files:
    Code:
    find . -name "*.[CH]" -type f | xargs grep -sl "ConstraintType"
  7. Looks like the file:
    Code:
    OpenFOAM/fields/PointPatchFields/PointPatchField/PointPatchField.H
    is a good candidate. But it's not it. It should be:
    Code:
    OpenFOAM/matrices/blockLduMatrix/BlockLduMatrix/BlockLduMatrix.H
  8. Ouch... this isn't good:
    Code:
    template<class Type>
    class BlockConstraint;
    //...
    typedef BlockConstraint<Type> ConstraintType;
    Now I gotta go look for where "BlockConstraint" is properly defined...
  9. Another search with find, leads me to these files:
    Code:
    OpenFOAM/matrices/blockLduMatrix/BlockLduMatrix/BlockConstraint/BlockConstraint.*
    What we're looking for is this constructor:
    Code:
            //- Construct from components
            BlockConstraint
            (
                const label row,
                const Type value,
                const Type& fixedCmpts = pTraits<Type>::one
            );
    The meaning of each variable:
    Code:
            //- Matrix row ID
            label rowID_;
    
            //- Fixed value
            Type value_;
    
            //- Fixed components (0-1) 1 = fixed, 0 = free
            Type fixedComponents_;
  10. All of this searching because of #5.b:
    Code:
            // create a constraint
            typename MatrixType<vector>::ConstraintType bc
            (
                curPoint,
                refValue_[pointI],
                cmptMag(valueFraction_[pointI])
            );
I hope you've understood all of that, because my brain just went:
Quote:
I don't want to look at C++ for the rest of the day.
Anyway, I believe that the answer is given on #4.a.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   March 3, 2014, 16:15
Default
  #6
Senior Member
 
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 14
sasanghomi is on a distinguished road
Dear Bruno,

I really appreciated your help. I don't know how to thank you, honestly.
Thank you very much for your attention.

Best regards,
Sasan.
sasanghomi is offline   Reply With Quote

Reply


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
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 01:41
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 03:23
[swak4Foam] swak4Foam-groovyBC build problem zxj160 OpenFOAM Community Contributions 18 July 30, 2013 13:14
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 11:44
ParaView Compilation jakaranda OpenFOAM Installation 3 October 27, 2008 11:46


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