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. |
No. Give some more background and ask what you really want to ask.
Seems to be an XY problem: http://mywiki.wooledge.org/XyProblem |
Quote:
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. |
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 00:35. |