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!

openfoammaofnepo July 4, 2016 15:44

Dear Charlie,

How did you specify the boundary value of Theta for the inlet of the computational domain?

I found that in my case the iteration step is always high (such as 50, at the first time step it is 1000). Do you also have the same situations?

best regards,
OF

cheng1988sjtu July 4, 2016 16:00

BC for Theta at inlet
 
Hi OF,

I used zeroGradient for Theta at the inlet, and it worked fine. Also, a good initial condition for Theta field also helps!

Best

Charlie

openfoammaofnepo July 4, 2016 16:08

Hi Charlie,

Thank you. What kind of initial field for Theta did you specify?

My case is particle laden flows with inlet particle volume fraction = 4e-4. I am considering if I need to use kineticTheoryModel for the particle turbulence. Is your case also gas-particle flows? What is the volume fraction, so you are using Theta?

Thank you.


All times are GMT -4. The time now is 06:21.