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

[swak4Foam] Boundary Conditions with GroovyBC, Normal Gradient

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree10Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 14, 2012, 05:55
Default
  #21
New Member
 
Peter Benovsky
Join Date: Jun 2011
Posts: 5
Rep Power: 14
Peter Benovsky is on a distinguished road
Quote:
Originally Posted by gschaider View Post
You can only have one BC on a patch at a time. Have you made sure that groovyBC is actually evaluated on that patch (for instance by introducing a syntactic error into an expression - if it fails it's evaluated)

BTW: which version of OF?
2.1.1
What I meant is that I use groovyBC for the temperature. alphat uses standard alpatWallFunction, hence should not be groovyfied.
Peter Benovsky is offline   Reply With Quote

Old   December 14, 2012, 07:26
Default
  #22
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 Peter Benovsky View Post
2.1.1
What I meant is that I use groovyBC for the temperature. alphat uses standard alpatWallFunction, hence should not be groovyfied.
OK. Please provide some context (like which fields you used which BC on). It is not as absurd as you might think: I have seen people specifying 'type' twice hoping both would work.

Anyway: if the value 0 is only there during the first timestep then it is the same bug
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   December 17, 2012, 10:44
Default
  #23
New Member
 
Peter Benovsky
Join Date: Jun 2011
Posts: 5
Rep Power: 14
Peter Benovsky is on a distinguished road
Quote:
Originally Posted by gschaider View Post
OK. Please provide some context (like which fields you used which BC on). It is not as absurd as you might think: I have seen people specifying 'type' twice hoping both would work.

Anyway: if the value 0 is only there during the first timestep then it is the same bug
It took longer than I thought but here it is (the context):
Code:
location "0";
object alphat;
 
heater
{
type alphatWallFunction;
value uniform 0.01;
}
 
object T;
 
heater
{
type groovyBC;
refValue uniform 300;
valueExpression "300"; 
gradientExpression "gradT*time()";
fractionExpression "0";
variables "heatFlux=100;gradT=heatFlux/(alphaEff);";
}
Without groovybc in the next time step I get for alphat:
Code:
location "0";
object alphat;
 
heater
{
type alphatWallFunction;
Prt                             0.85;
value nonuniform List<scalar>
.
.
.
}
With groovy bc it is just fixedValue with value=0
Cheers
Peter
Peter Benovsky is offline   Reply With Quote

Old   December 17, 2012, 13:30
Default
  #24
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 Peter Benovsky View Post
It took longer than I thought but here it is (the context):
Code:
location "0";
object alphat;
 
heater
{
type alphatWallFunction;
value uniform 0.01;
}
 
object T;
 
heater
{
type groovyBC;
refValue uniform 300;
valueExpression "300"; 
gradientExpression "gradT*time()";
fractionExpression "0";
variables "heatFlux=100;gradT=heatFlux/(alphaEff);";
}
Without groovybc in the next time step I get for alphat:
Code:
location "0";
object alphat;
 
heater
{
type alphatWallFunction;
Prt                             0.85;
value nonuniform List<scalar>
.
.
.
}
With groovy bc it is just fixedValue with value=0
Cheers
Peter
Hmm. That is strange. It should work. Could you try some things:

- instead of alphaEff add a constant (although I don't think that is the problem)
- set valueFraction to "uniform 0" (just to be sure)
- reset the 300 in the refValue to x. This should fail (this is just to make sure that it is really read)

Which version of swak do you use (check the start of the output of funkySetFields)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   February 21, 2014, 17:25
Default
  #25
New Member
 
Xuan Ge
Join Date: Oct 2011
Location: Ames, IA, US
Posts: 6
Rep Power: 14
xuan8908 is on a distinguished road
Hi, Bernhard,

I am trying to look at your codes of the groovyBC implementation. I am
curious where you pass those strings, like "valueExpression_" and
"gradientExpression_"? In the source code, groovyBCCommon.C, you just
look up those keywords from the dictionary file and read them. How do
those strings come into play to update the boundary condition? I guess
one of those source codes may contain the implementation of this. Could
you please tell me which source code is the right one that I can read
and learn from? Thanks a lot in advance. I will appreciate your reply.
xuan8908 is offline   Reply With Quote

Old   February 22, 2014, 12:23
Default
  #26
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 xuan8908 View Post
Hi, Bernhard,

I am trying to look at your codes of the groovyBC implementation. I am
curious where you pass those strings, like "valueExpression_" and
"gradientExpression_"? In the source code, groovyBCCommon.C, you just
look up those keywords from the dictionary file and read them. How do
those strings come into play to update the boundary condition? I guess
one of those source codes may contain the implementation of this. Could
you please tell me which source code is the right one that I can read
and learn from? Thanks a lot in advance. I will appreciate your reply.
grep is your friend if you want to find the location of variables in the source code (of course there are more sophisticated tool, but this is installed on every system)

That'd be updateCoeffs in groovyBCFvPatchField.C. But the real magic happens in Libraries/swak4FoamParsers (especially everything with PatchValue in the beginning)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   February 22, 2014, 12:54
Default
  #27
New Member
 
Xuan Ge
Join Date: Oct 2011
Location: Ames, IA, US
Posts: 6
Rep Power: 14
xuan8908 is on a distinguished road
Thank you, Bernhard. I will take a look at it.
xuan8908 is offline   Reply With Quote

Old   September 17, 2014, 05:40
Default
  #28
New Member
 
Join Date: Jul 2013
Posts: 7
Rep Power: 12
Sliwa is on a distinguished road
Hello,

I am not sure this is the right thread for my question, but I was wondering if it was possible to set a fixed gradient in the direction normal to the patch and a fixed value in the tangential direction with groovyBC?
Sliwa is offline   Reply With Quote

Old   September 17, 2014, 18:29
Default
  #29
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 Sliwa View Post
Hello,

I am not sure this is the right thread for my question, but I was wondering if it was possible to set a fixed gradient in the direction normal to the patch and a fixed value in the tangential direction with groovyBC?
There is a groovyBCDirection that wraps directionMixed (http://www.cfd-online.com/Forums/ope...-mixed-bc.html) but maybe this is not exactly what you need (no Dirichlet in tangential direction)
behzad-cfd likes this.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   September 18, 2014, 11:56
Default
  #30
New Member
 
Join Date: Jul 2013
Posts: 7
Rep Power: 12
Sliwa is on a distinguished road
Yes, I needed the Dirichlet in the tangential direction. Thanks anyway.
Sliwa is offline   Reply With Quote

Old   November 15, 2017, 15:57
Default
  #31
Member
 
behzad Ghasemi
Join Date: Sep 2013
Location: Iran
Posts: 56
Rep Power: 12
behzad-cfd is on a distinguished road
Quote:
Originally Posted by gschaider View Post
There is a groovyBCDirection that wraps directionMixed (http://www.cfd-online.com/Forums/ope...-mixed-bc.html) but maybe this is not exactly what you need (no Dirichlet in tangential direction)
Hi Bernhard,

I want to solve \nabla^{2}\xi+\vec{n}\cdot\nabla\xi=0 equation and obtain B that is defined like \overrightarrow{B}=(\frac{\partial\xi}{\partial  y})\vec{e_{x}}-(\frac{\partial\xi}{\partial x})\vec{e_{y}}.
I've implemented the equation in my base solver. Now i want to test functionality of the new solver but i have some boundary condition problem before testing.
For example if i want to get \overrightarrow{B}=(0,1) in boundaries i need to set (\frac{\partial\xi}{\partial  y})=0 and -(\frac{\partial\xi}{\partial x})=1.

Can i use groovyBC for this?
How can i implement this BCs?

Thanks in advance,
behzad-cfd is offline   Reply With Quote

Old   November 16, 2017, 21:16
Default
  #32
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 behzad-cfd View Post
Hi Bernhard,

I want to solve \nabla^{2}\xi+\vec{n}\cdot\nabla\xi=0 equation and obtain B that is defined like \overrightarrow{B}=(\frac{\partial\xi}{\partial  y})\vec{e_{x}}-(\frac{\partial\xi}{\partial x})\vec{e_{y}}.
I've implemented the equation in my base solver. Now i want to test functionality of the new solver but i have some boundary condition problem before testing.
For example if i want to get \overrightarrow{B}=(0,1) in boundaries i need to set (\frac{\partial\xi}{\partial  y})=0 and -(\frac{\partial\xi}{\partial x})=1.

Can i use groovyBC for this?
How can i implement this BCs?

Thanks in advance,
I'm afraid not. Because if you have a boundary with constant x then (\frac{\partial\xi}{\partial  y})=0 is not a boundary condition but a differential equation for the value on the boundary
behzad-cfd likes this.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   November 17, 2017, 04:44
Default
  #33
Member
 
behzad Ghasemi
Join Date: Sep 2013
Location: Iran
Posts: 56
Rep Power: 12
behzad-cfd is on a distinguished road
Quote:
Originally Posted by gschaider View Post
I'm afraid not. Because if you have a boundary with constant x then (\frac{\partial\xi}{\partial  y})=0 is not a boundary condition but a differential equation for the value on the boundary
Thanks for reply,
I should tell you that actually we have \vec{A}=(0,0,\xi) and \vec{B}=\nabla \times A = (\frac{\partial \xi}{\partial y}, -\frac{\partial \xi}{\partial x})
So how can i set such a condition?!
behzad-cfd is offline   Reply With Quote

Reply

Tags
boundary, condition, gradient, groovybc, normal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Problem in setting Boundary Condition Madhatter92 CFX 12 January 12, 2016 05:39
Problem with SIMPLEC-like finite volume channel flow boundary conditions ghobold Main CFD Forum 3 June 15, 2015 12:14
Radiation interface hinca CFX 15 January 26, 2014 18:11
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05


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