# vector plus bug

 Register Blogs Members List Search Today's Posts Mark Forums Read

 September 10, 2013, 07:28 vector plus bug #1 Member   Yu CAO Join Date: May 2013 Posts: 76 Rep Power: 5 Hi have you ever met a case that is when two very small negative values are plusing, the result turned out to be positive.

 September 10, 2013, 07:47 #2 Senior Member   Bernhard Join Date: Sep 2009 Location: Delft Posts: 790 Rep Power: 14 No. Give some more background and ask what you really want to ask. Seems to be an XY problem: http://mywiki.wooledge.org/XyProblem

September 10, 2013, 10:25
#3
Member

Yu CAO
Join Date: May 2013
Posts: 76
Rep Power: 5
Quote:
 Originally Posted by Bernhard No. Give some more background and ask what you really want to ask. Seems to be an XY problem: http://mywiki.wooledge.org/XyProblem
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 viscousForces =
- muFluidA().value()*S
*(
- (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.

 September 10, 2013, 10:28 #4 Senior Member   Bernhard Join Date: Sep 2009 Location: Delft Posts: 790 Rep Power: 14 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.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post novakm OpenFOAM Bugs 1 December 5, 2013 14:18 fs82 OpenFOAM Bugs 21 November 16, 2009 09:15 egp OpenFOAM Installation 5 December 8, 2006 13:56 Mattijs Janssens (Mattijs) OpenFOAM 0 January 10, 2005 11:05 Jonas Larsson Main CFD Forum 1 January 5, 2000 11:22

All times are GMT -4. The time now is 22:33.