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

directionMixed boundary condition

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 31, 2017, 17:56
Default directionMixed boundary condition
  #1
Member
 
Vedamt Chittlangia
Join Date: Feb 2016
Posts: 64
Rep Power: 9
vcvedant is an unknown quantity at this point
Hello,

I am using directionMixed BC for my case of flow over 2D flat plate. At the top boundary I want to set du/dy = 0 and v = 0. Where velocity vector is (u,v,w).

I have defined BC as:
Code:
top    //name of the boundary
{
    type     directionMixed;
    refValue         uniform (0 0 0);
    refGradient     uniform (0 0 0);
    valueFraction  uniform (0 0 0 1 0 0);
}
But after plotting my v component at the top I don't get 0 value as in the picture. I can't figure where I went wrong in using this boundary condition ?
Attached Images
File Type: png geometry.png (2.6 KB, 68 views)
File Type: png v_top.png (31.8 KB, 62 views)
vcvedant is offline   Reply With Quote

Old   December 7, 2017, 10:23
Default
  #2
Senior Member
 
Ali Shayegh
Join Date: Oct 2015
Posts: 131
Rep Power: 11
amuzeshi is on a distinguished road
Quote:
Originally Posted by vcvedant View Post
Hello,

I am using directionMixed BC for my case of flow over 2D flat plate. At the top boundary I want to set du/dy = 0 and v = 0. Where velocity vector is (u,v,w).

I have defined BC as:
Code:
top    //name of the boundary
{
    type     directionMixed;
    refValue         uniform (0 0 0);
    refGradient     uniform (0 0 0);
    valueFraction  uniform (0 0 0 1 0 0);
}
But after plotting my v component at the top I don't get 0 value as in the picture. I can't figure where I went wrong in using this boundary condition ?
To the best of my knowledge, elements of (0 0 0) aren't respectively (u v w)!
they are (1st_tangent 2nd_tangent normal_component) of velocity:
in this manner, valueFraction will be (0 0 0 0 0 1). see what ziemowitzima says:
DirectionMixed mixed bc
amuzeshi is offline   Reply With Quote

Old   March 22, 2019, 11:00
Default
  #3
Member
 
Join Date: Jan 2017
Posts: 71
Rep Power: 9
sadsid is on a distinguished road
Boundary condition groovcBCDirection
Based on the directionMixed boundary condition this allows to set a
boundary condition as a Dirichlet-condition only in certain directions
while in the other directions it is a gradient-condition.

can anyone know how to implement above condition?
sadsid is offline   Reply With Quote

Old   March 22, 2019, 14:52
Default
  #4
Senior Member
 
Ali Shayegh
Join Date: Oct 2015
Posts: 131
Rep Power: 11
amuzeshi is on a distinguished road
Quote:
Originally Posted by sadsid View Post
Boundary condition groovcBCDirection
Based on the directionMixed boundary condition this allows to set a
boundary condition as a Dirichlet-condition only in certain directions
while in the other directions it is a gradient-condition.

can anyone know how to implement above condition?
I haven't used groovybc, but I think directionMixed figures out your problem. Go to the link I inserted in my last post in this thread.
amuzeshi is offline   Reply With Quote

Old   March 22, 2019, 15:33
Default
  #5
Member
 
Join Date: Jan 2017
Posts: 71
Rep Power: 9
sadsid is on a distinguished road
Thank you for your reply!!
Actually I am looking for setting up the boundary condition like:
Code:
    type directionMixed;
    refValue uniform (0 0 0);
    refGradient uniform (0 0 0);
    valueFraction uniform (0.1 0 0 0.2 0 0.2);
    value uniform (0 0 0);
But in place of (0.1 0 0 0.2 0 0.2) I want to give a csv file. Can you help me in this regard?

Thanks
SS

Last edited by wyldckat; March 24, 2019 at 15:51. Reason: Added [CODE][/CODE] markers
sadsid is offline   Reply With Quote

Old   March 22, 2019, 16:53
Default
  #6
Senior Member
 
Ali Shayegh
Join Date: Oct 2015
Posts: 131
Rep Power: 11
amuzeshi is on a distinguished road
Quote:
Originally Posted by sadsid View Post
Thank you for your reply!!
Actually I am looking for setting up the boundary condition like:
type directionMixed;
refValue uniform (0 0 0);
refGradient uniform (0 0 0);
valueFraction uniform (0.1 0 0 0.2 0 0.2);
value uniform (0 0 0);
But in place of (0.1 0 0 0.2 0 0.2) I want to give a csv file. Can you help me in this regard?

Thanks
SS
I don't know if this sub-dictionary supports csv file or not. You can refer to well-informed users like wyldckat.
amuzeshi is offline   Reply With Quote

Old   March 22, 2019, 17:17
Default
  #7
Member
 
Join Date: Jan 2017
Posts: 71
Rep Power: 9
sadsid is on a distinguished road
Ok. Thanks!
sadsid is offline   Reply With Quote

Old   March 24, 2019, 16:06
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Quick answers:
  1. For future reference, regarding "groovyBCDirection" ("groovy", not "groovc") the only example I could quickly find was on file "Examples/tests/directionMixedBendPipe/0/U":
    Code:
        inner      
        {
            //        type            fixedValue;
            type groovyBCDirection;
            value           uniform (0 0 0);
            valueExpression "vector(0,0,0)";
            // switch from slip to fixedValue
            fractionExpression "pos().y>pos().x ? symm(normal()*normal()) : symmTensor(1,0,0,1,0,1)";
            //        fractionExpression "pos().y>pos().x ? symmTensor(0,0,0,0,0,0) : symmTensor(1,0,0,1,0,1)";
    }
    Also available online:
  2. This:
    Code:
    valueFraction uniform (0.1 0 0 0.2 0 0.2);
    is by definition wrong. And it depends on whether you are applying on a vector field or a scalar field. For example, this:
    Code:
    valueFraction nonuniform  List<scalar> 6(0.1 0 0 0.2 0 0.2);
    which means it would only be applicable for a patch with 6 faces.
  3. Defining from CSV file... really depends on what exactly you are trying to do. Because I'm guessing that your CSV file will actually have the positions of the centres of the faces and then the respective values to be used for that field. And if that is what you are trying to do, then it requires creating a new derived boundary condition that does that.
  4. Please let us know how you are creating that CSV file, because it might be easier to simply convert the CSV file to the format that OpenFOAM is expecting here...
__________________
wyldckat is offline   Reply With Quote

Old   March 27, 2019, 11:12
Default
  #9
Member
 
Join Date: Jan 2017
Posts: 71
Rep Power: 9
sadsid is on a distinguished road
Dear wyldckat, Thank you for your reply in detail.

Code:
dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);//should I change this internal field?

boundaryField
{
    w1
    {
//        type            noSlip;

    type directionMixed;
    refValue uniform (0 0 0);//what about this uniform value if I have a table at value fraction
    refGradient uniform (0 0 0);//same question about this
    valueFraction table
    (
(0 (0.042735 0 0 0.01899696 0 0.042735))
(0.05 (0.042735 0 0 0.01899696 0 0.042735))
(1 (0.042735 0 0 0.01899696 0 0.042735))
); //first value in (()) is time and rest values written in the bracket are values w.r.t. time
         value uniform;//what about this value should it be uniform?if we have a table at value fraction
    }
    w2
    {
        type            noSlip;
    }
    left1
    {
        type            cyclic;
    }
    right1
    {
        type            cyclic;
    }
    front1
    {
        type            cyclic;
    }
    back1
    {
        type            cyclic;
    }
    
}
Question1: Can I change valueFraction in a way I did?If not then how to make it unsteady as I have a tabular values to insert.
Q2: If yes then what about the keyword uniform?

Last edited by wyldckat; April 3, 2019 at 08:55. Reason: Added [CODE][/CODE] markers
sadsid is offline   Reply With Quote

Old   April 3, 2019, 05:41
Default
  #10
Member
 
Join Date: Jan 2017
Posts: 71
Rep Power: 9
sadsid is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Quick answers:
  1. For future reference, regarding "groovyBCDirection" ("groovy", not "groovc") the only example I could quickly find was on file "Examples/tests/directionMixedBendPipe/0/U":
    Code:
        inner      
        {
            //        type            fixedValue;
            type groovyBCDirection;
            value           uniform (0 0 0);
            valueExpression "vector(0,0,0)";
            // switch from slip to fixedValue
            fractionExpression "pos().y>pos().x ? symm(normal()*normal()) : symmTensor(1,0,0,1,0,1)";
            //        fractionExpression "pos().y>pos().x ? symmTensor(0,0,0,0,0,0) : symmTensor(1,0,0,1,0,1)";
    }
    Also available online:
  2. This:
    Code:
    valueFraction uniform (0.1 0 0 0.2 0 0.2);
    is by definition wrong. And it depends on whether you are applying on a vector field or a scalar field. For example, this:
    Code:
    valueFraction nonuniform  List<scalar> 6(0.1 0 0 0.2 0 0.2);
    which means it would only be applicable for a patch with 6 faces.
  3. Defining from CSV file... really depends on what exactly you are trying to do. Because I'm guessing that your CSV file will actually have the positions of the centres of the faces and then the respective values to be used for that field. And if that is what you are trying to do, then it requires creating a new derived boundary condition that does that.
  4. Please let us know how you are creating that CSV file, because it might be easier to simply convert the CSV file to the format that OpenFOAM is expecting here...

Dear Bruno my csv/text file containing a table of valueFraction with respect to the time, for example: the first entity of the table looks like (0,(1 0 0 1 0 1))).
sadsid is offline   Reply With Quote

Old   April 3, 2019, 11:01
Default
  #11
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Quick answers/questions @sadsid:

Quote:
Originally Posted by sadsid View Post
Code:
    w1
    {
//        type            noSlip;

    type directionMixed;
    refValue uniform (0 0 0);//what about this uniform value if I have a table at value fraction
    refGradient uniform (0 0 0);//same question about this
    valueFraction table
    (
(0 (0.042735 0 0 0.01899696 0 0.042735))
(0.05 (0.042735 0 0 0.01899696 0 0.042735))
(1 (0.042735 0 0 0.01899696 0 0.042735))
); //first value in (()) is time and rest values written in the bracket are values w.r.t. time
         value uniform;//what about this value should it be uniform?if we have a table at value fraction
    }
Question1: Can I change valueFraction in a way I did?If not then how to make it unsteady as I have a tabular values to insert.
Q2: If yes then what about the keyword uniform?
  1. No, you cannot simply make that change like that...
  2. "uniform" refers to the fact that 'valueFraction' was designed to be defined as a 1:1 definition of a value per face on the patch.

Quote:
Originally Posted by sadsid View Post
Dear Bruno my csv/text file containing a table of valueFraction with respect to the time, for example: the first entity of the table looks like (0,(1 0 0 1 0 1))).
Which OpenFOAM version are you using? I ask this because this requires the creation of a new boundary condition specifically for your requirement.
wyldckat is offline   Reply With Quote

Old   April 3, 2019, 11:41
Default
  #12
Member
 
Join Date: Jan 2017
Posts: 71
Rep Power: 9
sadsid is on a distinguished road
I am using OpenFOAM v5. Yes I think it needs to customize boundary condition directionMixed (am I right?). I will wait for your response. It would be helpful if you guide me to code it. Thanks for your quick response.
sadsid is offline   Reply With Quote

Old   April 7, 2019, 17:40
Default
  #13
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Quick answer: I wasn't able to look into this myself, namely to create the modified boundary condition.

However, here are the steps I advise you to take:
  1. Study this: https://wiki.openfoam.com/Programmin...by_Gavin_Tabor
  2. Create a custom condition based on "directionMixed". Since you're using OpenFOAM 5, it's in the folder src/finiteVolume/fields/fvPatchFields/basic/directionMixed
  3. Next you need to look into the boundary condition "uniformFixedValue" (folder src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue) and see how the variable "uniformValue_" is defined.
  4. Now you need to implement the "uniformValue_" variable into your custom boundary condition.
  5. Example on how to use CSV is given here: https://cpp.openfoam.org/v5/classFoa...V.html#details

Last edited by wyldckat; April 7, 2019 at 17:42. Reason: forgot a couple of links
wyldckat is offline   Reply With Quote

Old   April 8, 2019, 04:58
Default
  #14
Member
 
Join Date: Jan 2017
Posts: 71
Rep Power: 9
sadsid is on a distinguished road
Dear Bruno

Thank you for the guidelines. Let me dig out in these. I will come back to you shortly.
sadsid is offline   Reply With Quote

Reply

Tags
boundary, directionmixed, openfoam 2.3.x


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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
Centrifugal fan j0hnny CFX 13 October 1, 2019 14:55
Accessing multiple boundary patches from a custom boundary condition file ripudaman OpenFOAM Programming & Development 0 October 22, 2014 19:34
Radiation interface hinca CFX 15 January 26, 2014 18:11
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 18:44


All times are GMT -4. The time now is 16:23.