CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Boundary Condition for granular temperature Theta (http://www.cfd-online.com/Forums/openfoam-programming-development/102775-boundary-condition-granular-temperature-theta.html)

cheng1988sjtu June 1, 2012 21:08

Boundary Condition for granular temperature Theta
 
Hi,

I'm using twoPhaseEulerFoam, including the kinetic theory. I've decided to create a file to solve the PDE for Theta, i.e the granular temperature, that is, I don't want to use the existing kinetic theory in OpenFOAM, basically, the work is done, and the compilation is OK, however, when I tried to run a case, the error message came out.

The following is how I did that, it's simple, I just create a *.H file, which contain the fvScalarMatrix for Theta:

/**************************/
fvScalarMatrix ThetaEqn
(
fvm::ddt(ss,Theta)
+ ...
==
...
);

ThetaEqn.relax();
ThetaEqn.solve();
/****************************/

The compilation is OK, and the initial file for Theta is defined as:
walls
{
type fixedValue;
uniform 0;
}
inandouthalf11
{
type cyclic;
}
inandouthalf12
{
type cyclic;
}
inandouthalf21
{
type cyclic;
}
inandouthalf22
{
type cyclic;
}
top
{
type fixedValue;
uniform 0;
}
frontAndBackPlanes
{
type empty;
}
/************************************************** ******/

However, When I tried to run the case, the error message is that :

--> FOAM FATAL ERROR:

gradientInternalCoeffs cannot be called for a calculatedFvPatchField
on patch top of field Theta in file "/*/*/*/*/0/Theta"
You are probably trying to solve for a field with a default boundary condition.

From function calculatedFvPatchField<Type>::gradientInternalCoef fs() const
in file fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C at line 186.

FOAM exiting

It seems that the problem is that I didn't define the boundary condition, however, I'm basically following Alberto's work on the boundary condition, that is JohnsonJackson's boundary condition, should I include the boundary condition explicitly in the theta equation file? Does anyone has that kind of experience?

Thanks!:D

cheng1988sjtu June 1, 2012 23:15

Problem solved
 
Never mind, it's just due to a stupid mistake,
in createField.H, I initiate Theta in a wrong way, it should be:

volScalarField Theta
(
IOobject
(
"Theta",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
// mesh,
// dimensionedScalar("zero", dimensionSet(0, 2, -2, 0, 0), 0.0)
);

cheers!


All times are GMT -4. The time now is 11:25.