View Issue Details

IDProjectCategoryView StatusLast Update
0001110OpenFOAMBugpublic2013-12-18 23:00
Reporteruser814Assigned Tohenry  
PrioritynormalSeveritymajorReproducibilityhave not tried
Status resolvedResolutionfixed 
PlatformLinuxOSUbuntuOS Version10.04
Summary0001110: compressibleInterDyMFoam mass not conserved
DescriptionIn pEqn.H line 11 - 17

    surfaceScalarField phiHbyA
    (
        "phiHbyA",
        (fvc::interpolate(HbyA) & mesh.Sf())
      + fvc::ddtPhiCorr(rAU, rho, U, phiAbs)
    );

The flux of the control volume boundary meshPhi should be substracted, otherwise with my test I end up having an increase of mass equal to exactly the amount of the mass being swept by the reduction of mass due to reduced domain volume.
TagsNo tags attached.

Activities

henry

2013-12-18 14:59

manager   ~0002691

Which version of OpenFOAM are you running? Try again with the latest OpenFOAM-2.2.x and if the problem persists report further details including a suitable small test-case.

user814

2013-12-18 15:55

 

henry.tar.gz (4,559 bytes)

user814

2013-12-18 16:03

  ~0002692

I have uploaded the case.

After the run when getting the flux at inlet and outlet, it yields

patchIntegrate phi inlet -latestTime

Time = 0.007
    Area vector of patch inlet[2] = (0 -0.000493 0)
    Area magnitude of patch inlet[2] = 0.000493
    Reading surfaceScalarField phi
    Integral of phi over patch inlet[2] = -1e-05


patchIntegrate phi outlet -latestTime

Time = 0.007
    Area vector of patch outlet[3] = (0 0.000493 0)
    Area magnitude of patch outlet[3] = 0.000493
    Reading surfaceScalarField phi
    Integral of phi over patch outlet[3] = 0.00031

Considering the movingWall motion 0.1 m/s, and the movingWall surface = 0.15*0.01 = 1.5e-4 sqm, it gives you the sweep flux 1.5e-05 m3/s.

And this is exactly the added extra mass: 0.00031 - 0.00001 - 0.00015 = 0.00015

user814

2013-12-18 16:05

  ~0002693

And yes I am running latest OF-2.2.x

henry

2013-12-18 17:45

manager   ~0002694

Try again with correct BCs for p_rgh. See for example

OpenFOAM-2.2.x/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D

henry

2013-12-18 18:05

manager   ~0002695

I have reproduced the problem here and I will work on it.

user814

2013-12-18 18:24

  ~0002696

I substract the motion flux and it fixed the problem.
In pEqn.H
surfaceScalarField phiHbyA
    (
        "phiHbyA",
        (fvc::interpolate(HbyA) & mesh.Sf()) - fvc::meshPhi(rho,U)
      + fvc::ddtPhiCorr(rAU, rho, U, phi)

henry

2013-12-18 19:27

manager   ~0002697

That is not sufficient as it does not resolve the issue with ddtPhiCorr and note the

                // Make the fluxes relative to the mesh motion
                fvc::makeRelative(phi, U);

in compressibleInterDyMFoam.C

henry

2013-12-18 23:00

manager   ~0002698

Resolved by commit f3639a9c9d2baed720f2890e819f17af92a03a23

Issue History

Date Modified Username Field Change
2013-12-18 14:52 user814 New Issue
2013-12-18 14:59 henry Note Added: 0002691
2013-12-18 15:55 user814 File Added: henry.tar.gz
2013-12-18 16:03 user814 Note Added: 0002692
2013-12-18 16:05 user814 Note Added: 0002693
2013-12-18 17:45 henry Note Added: 0002694
2013-12-18 18:05 henry Note Added: 0002695
2013-12-18 18:24 user814 Note Added: 0002696
2013-12-18 19:27 henry Note Added: 0002697
2013-12-18 23:00 henry Note Added: 0002698
2013-12-18 23:00 henry Status new => resolved
2013-12-18 23:00 henry Resolution open => fixed
2013-12-18 23:00 henry Assigned To => henry