View Issue Details

IDProjectCategoryView StatusLast Update
0001768OpenFOAMBugpublic2015-10-21 17:25
Reportergucong Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
PlatformGNU/LinuxOSUbuntuOS Version15.04
Summary0001768: ddt scheme is not correct when mesh is moving and cut at the same time
DescriptionWhen trying to implement dynamic mesh with meshing moving and refinement at the same time, I found for example in src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C: fvcDdt:

if (mesh().moving())
{
  ...
  rDeltaT.value()*
  (
    vf.internalField()
    - vf.oldTime().internalField()*mesh().Vsc0()/mesh().Vsc()
  ),
}

where Vsc0 is the old cell volume and Vsc is the new cell volume. This can make the old field 8 times larger/smaller where the mesh is refined/unrefined.
TagsNo tags attached.

Activities

gucong

2015-06-30 02:28

reporter   ~0005017

Sorry. After doing mesh.setV0()=mesh.V(), it is working now. Maybe exposing fvMesh::storeOldVol is better.

henry

2015-06-30 07:54

manager   ~0005018

There should be no need to expose these internals as the automatic mesh-update system should handle them. In this case the old-time volume should be automatically updated follow mesh refinement then the new volumes updated following morphing.

It is not clear which solver you are using or how you are organizing the mesh changes. If there is an issue with the automatic mesh-update system it is likely to be fixed already in OpenFOAM-dev.

gucong

2015-06-30 08:30

reporter   ~0005019

I meant maybe make storeOldVol protected rather than private. Or solve the following problem in some other way.

In my dyanmicFvMesh, I first refine/unrefine as in dynamicRefineFvMesh. I found that I have to do

    this->setV0() = this->V();

before I make the mesh moving by

    fvMesh::movePoints(motionPtr_->newPoints());

Otherwise, the code will break, for example, fvc::ddt as described in the bug report.

This is because fvMesh::updateMesh stores the volume before refinement as V0. And fvMesh::movePionts will not update the V0 if mesh refinement is done previously but in the same time step.

henry

2015-06-30 08:36

manager   ~0005020

Have you tried using OpenFOAM-dev?

gucong

2015-06-30 08:55

reporter   ~0005022

Last edited: 2015-06-30 08:57

I will try after I build the dev tree. But I read the related code in dev and found no difference (based on my understanding of the problem). In particular fvMesh::updateMesh stores the volume before refinement as V0. And fvMesh::movePoints doesn't update V0 to the mesh after refinement. This breaks fvc::ddt. fvc::ddt assumes that there is no refinement if mesh is moving.

henry

2015-06-30 08:57

manager   ~0005023

The tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle case does automatic refinement and unrefinement and work correctly without any change to the code so at least for this case the old-time cell volumes are handled correctly.

gucong

2015-06-30 09:03

reporter   ~0005024

The tutorial case have no problem. The problem happens when I use refinement and fvMesh::movePoints at the same time step. fvc::ddt assumes that there is no refinement if mesh is moving.

henry

2015-06-30 09:06

manager   ~0005025

If you can setup a case in OpenFOAM-dev which demonstrates the problem and provide it here I will investigate.

henry

2015-10-21 17:25

manager   ~0005456

Orphaned report

Issue History

Date Modified Username Field Change
2015-06-30 02:05 gucong New Issue
2015-06-30 02:28 gucong Note Added: 0005017
2015-06-30 07:54 henry Note Added: 0005018
2015-06-30 08:30 gucong Note Added: 0005019
2015-06-30 08:36 henry Note Added: 0005020
2015-06-30 08:55 gucong Note Added: 0005022
2015-06-30 08:55 gucong Note Edited: 0005022
2015-06-30 08:57 gucong Note Edited: 0005022
2015-06-30 08:57 henry Note Added: 0005023
2015-06-30 09:03 gucong Note Added: 0005024
2015-06-30 09:06 henry Note Added: 0005025
2015-10-21 17:25 henry Note Added: 0005456
2015-10-21 17:25 henry Status new => closed
2015-10-21 17:25 henry Assigned To => henry
2015-10-21 17:25 henry Resolution open => no change required