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

[swak4Foam] settings a gradient on boundary using groovyBC

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 10, 2011, 10:36
Default settings a gradient on boundary using groovyBC
  #1
Member
 
Join Date: May 2009
Posts: 54
Rep Power: 17
gfilip is on a distinguished road
Hello,

I am experimenting with groovyBC and can successfully use the valueExpression on a patch. When I try to set a gradientExpression for pressure, such as:
Code:
   
inlet
    {
        type            groovyBC;
        //valueExpression               "100";
        gradientExpression      "100";

    }
and then calculate the normal gradient of pressure on the inlet, I get non-constant values much different than 100. When using the gradientExpression I also obtain a 0 pressure on the inlet boundary. I also tried using:
gradientExpression "vector(100,0,0)&normal()" but that gives the same result.

This is a simple 2D case with an oscillatingFixedValue velocity inlet ran using pisoFoam.

Am I interpreting the gradientExpression patch parameter wrong?
gfilip is offline   Reply With Quote

Old   November 10, 2011, 12:11
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
From the documentation:
Code:
* fractionExpression 
   Determines whether the face is Dirichlet (1) or Neumann (0). Defaults to 1
You can probably see the problem. Fix fractionExpression and all will be good.

Last edited by akidess; November 10, 2011 at 12:11. Reason: formatting
akidess is offline   Reply With Quote

Old   November 10, 2011, 12:14
Default
  #3
Member
 
Join Date: May 2009
Posts: 54
Rep Power: 17
gfilip is on a distinguished road
Hi Anton,

I have in fact tested the fractionExpression as well, but setting it to 0 did not help.
gfilip is offline   Reply With Quote

Old   November 10, 2011, 20:37
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by gfilip View Post
Hello,

I am experimenting with groovyBC and can successfully use the valueExpression on a patch. When I try to set a gradientExpression for pressure, such as:
Code:
   
inlet
    {
        type            groovyBC;
        //valueExpression               "100";
        gradientExpression      "100";

    }
and then calculate the normal gradient of pressure on the inlet, I get non-constant values much different than 100. When using the gradientExpression I also obtain a 0 pressure on the inlet boundary. I also tried using:
gradientExpression "vector(100,0,0)&normal()" but that gives the same result.

This is a simple 2D case with an oscillatingFixedValue velocity inlet ran using pisoFoam.

Am I interpreting the gradientExpression patch parameter wrong?
I'm just wondering whether I'm misinterpreting your posting. "I get non-constant values much different than 100" Do you mean "I calculated the gradient using the value in the next cell and the delta coefficient and it was much different from 100". In that case there is a problem. Or did you mean "'value' on the patch is different from 100". That is to be expected because you're only setting the gradient on the patch (basically the relative change to the next cell) NOT the value with a Neuman condition
gschaider is offline   Reply With Quote

Old   May 3, 2012, 11:05
Default
  #5
Member
 
Albert Tong
Join Date: Dec 2010
Location: Perth, WA, Australia
Posts: 76
Blog Entries: 1
Rep Power: 16
tfuwa is on a distinguished road
Hi All,

I would like to set up a gradient B.C., ∂p/∂x = cos (2*pi*t) .

Is there a way to do this with groovyBC or openfoam official tools?

Cheers.
__________________
Kind regards,

Albert
tfuwa is offline   Reply With Quote

Old   May 3, 2012, 12:24
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by tfuwa View Post
Hi All,

I would like to set up a gradient B.C., ∂p/∂x = cos (2*pi*t) .

Is there a way to do this with groovyBC or openfoam official tools?
In groovyBC this would be something like this:
valueExpression "0"; // this doesn't matter
fractionExpression "0"; // no value, all gradient
gradientExpression "sin(2*pi*time())";

Official tools: you can do something similar with some C++-programming with the codedMixed-BC I guess
gschaider is offline   Reply With Quote

Old   May 4, 2012, 10:41
Default
  #7
Member
 
Albert Tong
Join Date: Dec 2010
Location: Perth, WA, Australia
Posts: 76
Blog Entries: 1
Rep Power: 16
tfuwa is on a distinguished road
Thanks Bernhard! It works perfect.
__________________
Kind regards,

Albert
tfuwa 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
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 08:30
question regarding LES of pipe flow - pimpleFoam Dan1788 OpenFOAM Running, Solving & CFD 37 December 26, 2017 15:42
Multiphase flow - incorrect velocity on inlet Mike_Tom CFX 6 September 29, 2016 02:27
Difficulty In Setting Boundary Conditions Moinul Haque CFX 4 November 25, 2014 18:30
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 07:28


All times are GMT -4. The time now is 15:58.