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

[swak4Foam] ARE zeroGradient in groovyBC and internalFiald different in result?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 30, 2013, 09:24
Default ARE zeroGradient in groovyBC and internalFiald different in result?
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
when I set BC for U to zeroGradient or:
Code:
right
    {
     type groovyBC;
     fractionExpression "0";
     gradientExpression "vector(0,0,0)";
    }
it answers without any error
but when I set it to:
Code:
right
    {
     type groovyBC;
     fractionExpression "1";
     valueExpression "internalField(U)";//vector(internalField(U).x,0,0)
    }
it falls to an error on T(energy equation probably) as so:
Code:
:
From function janafThermo<EquationOfState>::limit(const scalar T) const
in file /home/opencfd/OpenFOAM/OpenFOAM-2.1.1/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 108
attempt to use janafThermo<EquationOfState> out of temperature range 200 -> 6000;  T = -3333091.721
--> FOAM Warning :
From function janafThermo<EquationOfState>::limit(const scalar T) const
in file /home/opencfd/OpenFOAM/OpenFOAM-2.1.1/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 108
attempt to use janafThermo<EquationOfState> out of temperature range 200 -> 6000;  T = 4080511.561
--> FOAM Warning :
From function janafThermo<EquationOfState>::limit(const scalar T) const
in file /home/opencfd/OpenFOAM/OpenFOAM-2.1.1/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 108
attempt to use janafThermo<EquationOfState> out of temperature range 200 -> 6000;  T = -7124696.499
--> FOAM Warning :
From function janafThermo<EquationOfState>::limit(const scalar T) const
in file /home/opencfd/OpenFOAM/OpenFOAM-2.1.1/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 108
attempt to use janafThermo<EquationOfState> out of temperature range 200 -> 6000;  T = 5774453.414
--> FOAM Warning :
From function janafThermo<EquationOfState>::limit(const scalar T) const
in file /home/opencfd/OpenFOAM/OpenFOAM-2.1.1/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 108
attempt to use janafThermo<EquationOfState> out of temperature range 200 -> 6000;  T = -6575768.989
--> FOAM Warning :
From function janafThermo<EquationOfState>::limit(const scalar T) const
in file /home/opencfd/OpenFOAM/OpenFOAM-2.1.1/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 108
attempt to use janafThermo<EquationOfState> out of temperature range 200 -> 6000;  T = 5981361.409
--> FOAM Warning :
From function janafThermo<EquationOfState>::limit(const scalar T) const
in file /home/opencfd/OpenFOAM/OpenFOAM-2.1.1/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 108
attempt to use janafThermo<EquationOfState> out of temperature range 200 -> 6000;  T = 1404258.482
immortality is offline   Reply With Quote

Old   March 30, 2013, 11:49
Default
  #2
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 immortality View Post
when I set BC for U to zeroGradient or:
Code:
right
    {
     type groovyBC;
     fractionExpression "0";
     gradientExpression "vector(0,0,0)";
    }
it answers without any error
but when I set it to:
Code:
right
    {
     type groovyBC;
     fractionExpression "1";
     valueExpression "internalField(U)";//vector(internalField(U).x,0,0)
    }
That is NOT the implementation of a zeroGradient-BC. zeroGradient (and fractionExpression "0") say: "manipulate the matrix in such a way that whatever value internalField(U) has the boundary value is the same (no matter what value internalField(U) will have)". While the second formulation says "Take the current value of internalField(U) and manipulate the matrix in such a way that the boundary value is that value (no matter which value internalField(U) will have later on)". First is implicit, second is explicit (and therefore more unstable)
__________________
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   March 31, 2013, 06:08
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
thank you dear Bernard.
I grasped the total idea.but implicit and explicit you mentioned you mean same as those are used in equations?could you explain a little more about the difference?
does in the second case the solver takes the internalField(U) and put it exactly on the boundary but in the first(zeroGradient) it uses next time step value of internalField(U) and put it to the boundary?
immortality is offline   Reply With Quote

Old   March 31, 2013, 20:20
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 immortality View Post
thank you dear Bernard.
I grasped the total idea.but implicit and explicit you mentioned you mean same as those are used in equations?could you explain a little more about the difference?
does in the second case the solver takes the internalField(U) and put it exactly on the boundary but in the first(zeroGradient) it uses next time step value of internalField(U) and put it to the boundary?
If you have difficulties with the concept either
- leave your fingers of it (99.5% of all users don't need internalField)
- read a textbook (like Versteeg "An introduction to compuational fluid dynamics") where the discretization of equations (and boundary conditions!) is explained. The nomenclature may be different but it will be clear to you what implicit/"in the matrix" means
__________________
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   April 11, 2013, 18:22
Default
  #5
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
no I'm among thos .5% ! need to use internalField.
is there a way to use gradientExpression so that a minus to be multiply to internal value? ( i need it for velocity)
how can use gradientExpression except of velocity(0,0,0)?!
immortality is offline   Reply With Quote

Old   April 11, 2013, 19:06
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 immortality View Post
no I'm among thos .5% ! need to use internalField.
If the difference between a zeroGradient (Neuman) boundary condition and a Dirichlet-condition (fixedValue) that takes the value of the next cell is unclear to you: I doubt it.

Quote:
Originally Posted by immortality View Post
is there a way to use gradientExpression so that a minus to be multiply to internal value? ( i need it for velocity)
how can use gradientExpression except of velocity(0,0,0)?!
I don't understand what you want to say here. Of course you can use gradientExpressions diffeent from (0,0,0). You've got to understand that this is the gradient perpendicular to the patch-face (if that is your problem)
__________________
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   April 12, 2013, 04:28
Default
  #7
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
yes i knew that but didn't expect that much difference in stability.that problem is resolved now.
I mean how can implement an statement like vector(-internalField(U),0,0) (in the condition that flow is outward in a inlet patch by gradientExpression because most usage of it is with zero
immortality 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



All times are GMT -4. The time now is 07:41.