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

Custom boundary condition: unexpected behavior with chtMultiRegionFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 28, 2014, 13:51
Post Custom boundary condition: unexpected behavior with chtMultiRegionFoam
  #1
Member
 
Vincent Leroy
Join Date: Jul 2012
Location: Rhode-Saint-Genèse, Belgium
Posts: 43
Rep Power: 14
leroyv is on a distinguished road
Dear OpenFOAM users,
I recently wrote a simple custom boundary condition which computes the fluid velocity at the wall using a formula of the type:

v = f(rho) * normal

While my code yields the expected results using the rhoPimpleFoam solver, everything is messed up when using it with chtMultiRegionFoam, even though I use the exact same parameters for the BC. The near-wall velocity has an inverted orientation, and the upstream flow has a stagnation point, even if the wall velocity is oriented downstream. This is obviously a physical and numerical nonsense ...

Is there something in particular that should be taken care of when using chtMultiRegionFoam with custom BCs?

Parameters with rhoPimpleFoam:
Code:
squareWall
    {
        type            pyrolysisVelocity;
        refValue        0.001;
        massPR          0.001;
        rhoS            -1;
        rhoName         rho;
    }
Result: https://www.dropbox.com/s/n7cfws80w3...Foam_outer.png

With chtMultiRegionFoam:
Code:
fluid_to_solid
            {
                type pyrolysisVelocity;
                refValue 0.001;
                massPR 0.001;
                rhoS -1;
                rhoName rho;
            }
Result: https://www.dropbox.com/s/8t2re4piih...Foam_outer.png

Last edited by leroyv; January 29, 2014 at 06:10. Reason: corrected typos
leroyv is offline   Reply With Quote

Old   January 29, 2014, 12:42
Post Update
  #2
Member
 
Vincent Leroy
Join Date: Jul 2012
Location: Rhode-Saint-Genèse, Belgium
Posts: 43
Rep Power: 14
leroyv is on a distinguished road
A little progress update: I went through the code and did some additional debugging. The coordinates of velocity on the patch seem to be computed correctly: I checked the values in the output files.

The results with a surfaceNormalFixedValue BC are okay:
https://www.dropbox.com/s/zui2qaz9tz...FixedValue.png
I'm guessing something wrong happens when running the updateCoeffs() method, maybe I shouldn't use the fixedValueFvPatchVectorField::operator==() member function?

Last edited by leroyv; January 29, 2014 at 12:44. Reason: disabled smilies
leroyv is offline   Reply With Quote

Old   January 30, 2014, 10:30
Post Update
  #3
Member
 
Vincent Leroy
Join Date: Jul 2012
Location: Rhode-Saint-Genèse, Belgium
Posts: 43
Rep Power: 14
leroyv is on a distinguished road
I ran an additional test using swak4foam:
Code:
fluid_to_solid
    {
        type groovyBC;
        valueExpression "- 0.001 * normal()";
    }
It gave nearly the same result as obtained with chtMultiRegionFoam:
https://www.dropbox.com/s/0yjr5vca1y..._swak4foam.png
leroyv is offline   Reply With Quote

Old   February 1, 2014, 08:49
Post Update
  #4
Member
 
Vincent Leroy
Join Date: Jul 2012
Location: Rhode-Saint-Genèse, Belgium
Posts: 43
Rep Power: 14
leroyv is on a distinguished road
I computed the mass flux using the patchIntegrate utility.

Solver: chtMultiRegionFoam (using BCs for isothermal flow)
Inlet mass flux: 0.000811 kg/s

1. BC: surfaceNormalFixedValue, -0.001
fluid_to_solid mass flux: 0.000463 kg/s
Outlet mass flux: 0.00127 kg/s

2. BC: groovyBC, "- 0.001 * normal()"
fluid_to_solid mass flux: <something>e-20 = 0 kg/s
Outlet mass flux: 0.000811 kg/s

Mass conversation seems to be okay. Something might be going wrong with the phi field, because the value of U at the boundary seems to be fine:
Code:
        value           nonuniform List<vector>
40
(
(0.001 0 0)
(0 -0.001 0)
(0.001 0 0)
(0.001 0 0)
(0.001 0 0)
(0.001 0 0)
(0.001 -0 0)
(0.001 -0 0)
(0.001 -0 0)
(0.001 -0 0)
(0.001 -0 0)
(0 0.001 0)
(0 -0.001 0)
(0 0.001 0)
(0 -0.001 0)
(0 0.001 0)
(0 -0.001 0)
(0 0.001 0)
(0 -0.001 0)
(0 0.001 0)
(0 -0.001 0)
(0 0.001 0)
(0 -0.001 0)
(0 0.001 0)
(0 -0.001 0)
(0 0.001 0)
(0 -0.001 0)
(0 0.001 0)
(-0.001 -0 0)
(0 -0.001 0)
(-0.001 -0 0)
(-0.001 -0 0)
(-0.001 -0 0)
(-0.001 -0 0)
(-0.001 0 0)
(-0.001 0 0)
(-0.001 0 0)
(-0.001 0 0)
(0 0.001 0)
(-0.001 0 0)
)
Any idea of what that could be? I attached my case directory.
Attached Files
File Type: zip squareCylinder.zip (21.1 KB, 1 views)
leroyv is offline   Reply With Quote

Reply

Tags
boundary condition, chtmultiregionfoam, swak4foam


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
Mathematical representation of fixedDisplacementZeroShear boundary condition Sargam05 OpenFOAM 14 January 11, 2022 07:55
Low Mixing time Problem Mavier CFX 5 April 29, 2013 01:00
Velocity profile boundary condition Tuca FLOW-3D 1 April 23, 2013 13:02
Bug in fvc::grad() and periodic boundary condition JBUNSW OpenFOAM 3 November 15, 2012 04:09
asking for Boundary condition in FLUENT Destry FLUENT 0 July 27, 2010 01:55


All times are GMT -4. The time now is 05:34.