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/)
-   -   Strange error when increasing grid resolution (http://www.cfd-online.com/Forums/openfoam-solving/57943-strange-error-when-increasing-grid-resolution.html)

feymark February 18, 2009 09:05

Hi, I have a 2D uniform mes
 
Hi,

I have a 2D uniform mesh with 0.5<=x<=1, 0<=y<=0.5, created using blockMesh. I'm computing the following expression,

PMS_
(
IOobject
(
"PMS",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
log(2.0*x()-pow(x(),2)+0.25)*log(4.0*pow(y(),3)-3.0*pow(y(),2)+1.25)
)
where x() and y() is defined in the following way,

tmp<volscalarfield> MSolution::x() const
{
return mesh_.C().component(vector::X)/L_;
}
where L_=1.0m.
For a small grid, 20x20 nodes large, this gives PMS=0.0 at the boundaryFields, (x=0.5, 0<=y<=0.5) and (y=0.5, 0.5<=x<=1). This is the correct behavior. The problem is when I increase the grid resolution to maybe 100x100. Then I get values that are not equal to 0 on the boundary. I think it's important to add that these values are of the magnitude 1e-18, quite small depending on the circumstances. I have checked the polyMesh directory and everything seems to be correct there. I really don't understand this. Any suggestions?

Regards,
Andreas


All times are GMT -4. The time now is 16:09.