View Issue Details

IDProjectCategoryView StatusLast Update
0004102OpenFOAMBugpublic2024-06-22 19:39
Reporteralundilong Assigned Tohenry  
PriorityimmediateSeverityblockReproducibilityalways
Status closedResolutionno change required 
PlatformGNU/LinuxOSUbuntuOS Version15.04
Product Versiondev 
Summary0004102: questionable implementation of H operator in fvMatrix.C, redundant introduce of the internalCoeffs
DescriptionTo make the problem simple, only take convection term to illustrate.
Please see the detailed description of the reported bug (see the attached picture).
Please point out if I have misinterpreted the code. I have checked the code thoroughly but cannot find a reasonable consideration for it.
TagsNo tags attached.

Activities

alundilong

2024-06-21 05:50

reporter  

H-operator.png (337,748 bytes)

henry

2024-06-21 07:49

manager   ~0013280

Please use one of the tutorial cases to demonstrate the problem and show how your suggested change provides improvement to the results.

alundilong

2024-06-22 19:00

reporter   ~0013281

Hi Henry, thank you for your attention.

For velocity will simple BC, such as fixedValue/fixedGradient/mixed, it is not an issue, as the variable of 'boundaryDiagCmpt' will always be zero (addBoundaryDiag/negate/addCmptAvBoundaryDiag cancelled out). However, if the velocity boundary condition is pressureInletOutlet type (transform,directionMixed), it can not be canceled out.

     for (direction cmpt=0; cmpt<Type::nComponents; cmpt++)
     {
         scalarField psiCmpt(psi_.primitiveField().component(cmpt));
  
         scalarField boundaryDiagCmpt(psi_.size(), Zero);
         addBoundaryDiag(boundaryDiagCmpt, cmpt);
         boundaryDiagCmpt.negate();
         addCmptAvBoundaryDiag(boundaryDiagCmpt);
  
         Hphi.primitiveFieldRef().replace(cmpt, boundaryDiagCmpt*psiCmpt);
     }
A test run on tutorial case of damBreak (via interFoam) along with a modified solver(simply change UEqn.H() to UEqn.myH()) are both attached.
An image show result difference is also given.
dambreak-comparison.png (235,690 bytes)   
dambreak-comparison.png (235,690 bytes)   

henry

2024-06-22 19:25

manager   ~0013282

Do all the tutorial cases run correctly with your proposed change? Even cases with symmetry planes and other transform boundary conditions for which the code you removed is needed?

henry

2024-06-22 19:39

manager   ~0013283

The current formulation has been developed, tested and validated over a long period of time on a wide range of cases and has proved to be robust and reliable.

If you are not happy with this implementation for your particular cases you can of course change it for your purpose but we cannot make this change to the core of OpenFOAM based on a single result or the preference of a single user.

Issue History

Date Modified Username Field Change
2024-06-21 05:50 alundilong New Issue
2024-06-21 05:50 alundilong File Added: H-operator.png
2024-06-21 07:49 henry Note Added: 0013280
2024-06-22 19:00 alundilong Note Added: 0013281
2024-06-22 19:00 alundilong File Added: OF6-solver-interFoam-testcase-damBreak.zip
2024-06-22 19:00 alundilong File Added: dambreak-comparison.png
2024-06-22 19:25 henry Note Added: 0013282
2024-06-22 19:39 henry Assigned To => henry
2024-06-22 19:39 henry Status new => closed
2024-06-22 19:39 henry Resolution open => no change required
2024-06-22 19:39 henry Note Added: 0013283