CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   ARE zeroGradient in groovyBC and internalFiald different in result? (http://www.cfd-online.com/Forums/openfoam-solving/115416-zerogradient-groovybc-internalfiald-different-result.html)

immortality March 30, 2013 09:24

ARE zeroGradient in groovyBC and internalFiald different in result?
 
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


gschaider March 30, 2013 11:49

Quote:

Originally Posted by immortality (Post 417325)
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)

immortality March 31, 2013 05:08

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?

gschaider March 31, 2013 19:20

Quote:

Originally Posted by immortality (Post 417393)
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

immortality April 11, 2013 17:22

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)?!

gschaider April 11, 2013 18:06

Quote:

Originally Posted by immortality (Post 419994)
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 (Post 419994)
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)

immortality April 12, 2013 03:28

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


All times are GMT -4. The time now is 20:55.