CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   vector plus bug (http://www.cfd-online.com/Forums/openfoam-bugs/123335-vector-plus-bug.html)

 cctv September 10, 2013 07:28

vector plus bug

Hi
have you ever met a case that is when two very small negative values are plusing, the result turned out to be positive.

 Bernhard September 10, 2013 07:47

No. Give some more background and ask what you really want to ask.

Seems to be an XY problem: http://mywiki.wooledge.org/XyProblem

 cctv September 10, 2013 10:25

Quote:
 Originally Posted by Bernhard (Post 450912) No. Give some more background and ask what you really want to ask. Seems to be an XY problem: http://mywiki.wooledge.org/XyProblem
Thank you for your reply.
In openfoam 1.6-ext. the solver interTrackFoam
it has force calculating
vector totalForce =
interface.totalViscousForce()
+ interface.totalPressureForce();
vector freeSurface::totalPressureForce() const
{
const scalarField& S = aMesh().S();
const vectorField& n = aMesh().faceAreaNormals().internalField();
const scalarField& P = p().boundaryField()[aPatchID()];
vectorField pressureForces = S*P*n;
return gSum(pressureForces);
}
vector freeSurface::totalViscousForce() const
{
const scalarField& S = aMesh().S();
const vectorField& n = aMesh().faceAreaNormals().internalField();
vectorField nGradU =
U().boundaryField()[aPatchID()].snGrad();
vectorField viscousForces =
- muFluidA().value()*S
*(
nGradU
+ (fac::grad(Us())().internalField()&n)
- (n*fac::div(Us())().internalField())
);
return gSum(viscousForces);
}

but in some cases, when these two force is very small, its result turned out to be very big. and sometimes printed out -nan. I do not know why.

 Bernhard September 10, 2013 10:28

Can you give a simple example, so that we can reproduce the issue? It is very difficult to tell what is going on and diagnose the problem.

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