CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   fixedGradient BC type with the channelOodles solver (https://www.cfd-online.com/Forums/openfoam-solving/65057-fixedgradient-bc-type-channeloodles-solver.html)

Bedotto June 2, 2009 12:11

fixedGradient BC type with the channelOodles solver
 
Hey everyone,

I'm a beginner with OpenFoam and that's why I post here in order to get some help :).

I study a turbulent couette flow in a channel and more particularly the thermodynamic aspect.
I use the channelOodles solver in which I've implemented the energy equation (in the incompressible case). My aim is to put heat fluxes on the topWall and on the bottomWall. In order to do that I've tried to put the fixedGradient condition in the 0 directory for my Temperature field. It looks like that:

////////////////////////
dimensions [0 0 0 1 0 0 0];

internalField uniform 300;

boundaryField
{
inout1
{
type cyclic;
}

inout2
{
type cyclic;
}

side1
{
type cyclic;
}

side2
{
type cyclic;
}

topWall
{
type fixedgradient;
value uniform 3.4e4;
}

bottomWall
{
type fixedgradient;
value uniform 3.0e4;
}
}
///////////////////////////

But I get some errors when I launch the solver, it sends me that:

////////////////////////
Starting time loop

Time = 0.1

Courant Number mean: 0.0552867 max: 0.585957
DILUPBiCG: Solving for k, Initial residual = 1, Final residual = 57608.7, No Iterations 1001
bounding k, min: -4.53955e-06 max: 3.69289e-06 average: 3.91368e-10
DILUPBiCG: Solving for Ux, Initial residual = 0.00210382, Final residual = 3.47222e-06, No Iterations 2
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 2.74052e-06, No Iterations 5
DILUPBiCG: Solving for Uz, Initial residual = 0.054276, Final residual = 7.72009e-06, No Iterations 3


--> FOAM FATAL ERROR :
gradientInternalCoeffs cannot be called for a defaultFvPatchField (actual type fixedgradient)
on patch topWall of field T in file "/craya/data/brugiere/heat/0/T"
You are probably trying to solve for a field with a default boundary condition.

From function defaultFvPatchField<Type>::gradientInternalCoeffs( ) const
in file fields/fvPatchFields/basic/default/defaultFvPatchField.C at line 694.

FOAM exiting
//////////////////////

I really don't understand why this error occurs. Moreover, I thank that this condition type was written like fixedGradient with a capital G. But when I try to write with G I get the following message:

//////////////////////////////
Reading transportProperties

Reading field p

Reading field T

--> FOAM FATAL IO ERROR : keyword gradient is undefined in dictionary "/craya/data/brugiere/heat/0/T::topWall"

file: /craya/data/brugiere/heat/0/T::topWall from line 56 to line 57.

From function dictionary::lookupEntry(const word& keyword) const
in file db/dictionary/dictionary.C at line 146.

FOAM exiting
////////////////////////

It seems that openFoam doesn't recognize the fixedGradient condition.
I hope some help.

My regards.
Quentin.

santos June 2, 2009 16:09

Hi Quentin,

Just enter the following:
Code:

type fixedGradient;
gradient uniform  3.4e4;

Regards,
Jose Santos

Bedotto June 3, 2009 03:43

Thanks Santos! This is working well now. (sorry if my question was a bit too dumb)

Regards.

Quentin.

prameelar August 15, 2011 11:30

Quote:

Originally Posted by Bedotto (Post 217952)
Hey everyone,

I'm a beginner with OpenFoam and that's why I post here in order to get some help :).

I study a turbulent couette flow in a channel and more particularly the thermodynamic aspect.
I use the channelOodles solver in which I've implemented the energy equation (in the incompressible case). My aim is to put heat fluxes on the topWall and on the bottomWall. In order to do that I've tried to put the fixedGradient condition in the 0 directory for my Temperature field. It looks like that:

////////////////////////
dimensions [0 0 0 1 0 0 0];

internalField uniform 300;

boundaryField
{
inout1
{
type cyclic;
}

inout2
{
type cyclic;
}

side1
{
type cyclic;
}

side2
{
type cyclic;
}

topWall
{
type fixedgradient;
value uniform 3.4e4;
}

bottomWall
{
type fixedgradient;
value uniform 3.0e4;
}
}
///////////////////////////

But I get some errors when I launch the solver, it sends me that:

////////////////////////
Starting time loop

Time = 0.1

Courant Number mean: 0.0552867 max: 0.585957
DILUPBiCG: Solving for k, Initial residual = 1, Final residual = 57608.7, No Iterations 1001
bounding k, min: -4.53955e-06 max: 3.69289e-06 average: 3.91368e-10
DILUPBiCG: Solving for Ux, Initial residual = 0.00210382, Final residual = 3.47222e-06, No Iterations 2
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 2.74052e-06, No Iterations 5
DILUPBiCG: Solving for Uz, Initial residual = 0.054276, Final residual = 7.72009e-06, No Iterations 3


--> FOAM FATAL ERROR :
gradientInternalCoeffs cannot be called for a defaultFvPatchField (actual type fixedgradient)
on patch topWall of field T in file "/craya/data/brugiere/heat/0/T"
You are probably trying to solve for a field with a default boundary condition.

From function defaultFvPatchField<Type>::gradientInternalCoeffs( ) const
in file fields/fvPatchFields/basic/default/defaultFvPatchField.C at line 694.

FOAM exiting
//////////////////////

I really don't understand why this error occurs. Moreover, I thank that this condition type was written like fixedGradient with a capital G. But when I try to write with G I get the following message:

//////////////////////////////
Reading transportProperties

Reading field p

Reading field T

--> FOAM FATAL IO ERROR : keyword gradient is undefined in dictionary "/craya/data/brugiere/heat/0/T::topWall"

file: /craya/data/brugiere/heat/0/T::topWall from line 56 to line 57.

From function dictionary::lookupEntry(const word& keyword) const
in file db/dictionary/dictionary.C at line 146.

FOAM exiting
////////////////////////

It seems that openFoam doesn't recognize the fixedGradient condition.
I hope some help.

My regards.
Quentin.

Hi, Coupld you guys tell me how to get gradient value (3e4/3.4e4)?

bhushanvelis April 22, 2013 06:02

Thanks it worked for me too !!

sabrinacarson April 15, 2019 09:49

Quote:

Originally Posted by santos (Post 217991)
Hi Quentin,

Just enter the following:
Code:

type fixedGradient;
gradient uniform  3.4e4;

Regards,
Jose Santos

Thank you. This solved my problem.


All times are GMT -4. The time now is 18:13.