View Issue Details

IDProjectCategoryView StatusLast Update
0004139OpenFOAMBugpublic2024-08-20 16:38
Reporterkakila Assigned Tohenry  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionno change required 
PlatformGNU/LinuxOSOtherOS Version(please specify)
Product Version12 
Summary0004139: Fatal Error - incompressibleVoF massSource
DescriptionThis is a copy from the post int he CFD-online forum: https://www.cfd-online.com/Forums/openfoam-solving/257463-fatal-error-incompressiblevof-masssource-v12.html

I am porting to OFv12 a case that worked perfectly in OFv11 (solver incompressibleVoF) that uses the massSource fvModel.

Below is the OFv11 fvModels file:

```
  FoamFile
  {
    format ascii;
    class dictionary;
    location "constant";
    object fvModels;
  }
  nucleation
  {
    type massSource;
    points ((0.0 0.0 0.0));
    phase liquid;
    massFlowRate -2e-06;
    fieldValues
    {
      alpha.liquid 0;
    }
  }
```

I get the error below if I use it with v12 without any edit.

```
--> FOAM FATAL ERROR:
Cannot add a mass source for field alpha.liquid to equation for alpha.liquid because this field's equation was not recognised as being in mass-conservative form

    From function void Foam::fv::massSourceBase::addSupType(Foam::VolField<Type>&, Foam::fvMatrix<Type>&) const [with Type = double; Foam::VolField<Type> = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>]
    in file massSource/massSourceBase.C at line 65.

FOAM exiting
```

For OFv12 I edited the file to (removed fieldValues and made flowrate positive)

```
  FoamFile
  {
    format ascii;
    class dictionary;
    location "constant";
    object fvModels;
  }
  nucleation
  {
    type massSource;
    points ((0.0 0.0 0.0));
    phase liquid;
    massFlowRate 2e-06;
  }
```

and added a section like this one in each field file (U, alpha.liquid, p_rgh) in the 0 folder

```
sources
{
    nucleation
    {
        type uniformFixedValue;
        uniformValue ...;
    }
}
```

where for the field alpha.liquid I put a 0 (zero) uniformValue (inert gas injection)

When I try to run this case I get the same error as before.

```
$ setFields && foamRun
/*---------------------------------------------------------------------------*\
  ========= |
  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
   \\ / O peration | Website: https://openfoam.org
    \\ / A nd | Version: 12
     \\/ M anipulation |
\*---------------------------------------------------------------------------*/
Build : 12-8b1612fe08a0
Exec : setFields
Date : Aug 19 2024
Time : 15:27:11
...
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading "setFieldsDict"

Setting field default values
    Setting internal values of volScalarField alpha.liquid
    Setting internal values of volVectorField U
    Setting internal values of volScalarField p_rgh

Setting field region values

End

/*---------------------------------------------------------------------------*\
  ========= |
  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
   \\ / O peration | Website: https://openfoam.org
    \\ / A nd | Version: 12
     \\/ M anipulation |
\*---------------------------------------------------------------------------*/
Build : 12-8b1612fe08a0
Exec : foamRun
Date : Aug 19 2024
Time : 15:27:11
...
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Selecting solver incompressibleVoF
Selecting viscosity model Newtonian
Selecting viscosity model Newtonian
No MRF models present

Courant Number mean: 7.02426e-05 max: 0.000342466
Interface Courant Number mean: 0 max: 0
Selecting turbulence model type laminar
Selecting laminar stress model Stokes
DICPCG: Solving for pcorr, Initial residual = 1, Final residual = 9.24536e-06, No Iterations 197
Creating fvModels from "constant/fvModels"

Selecting finite volume model type massSource
    Name: nucleation
    - selecting cells using points

PIMPLE: No convergence criteria found
PIMPLE: Operating solver in transient mode with 1 outer corrector
PIMPLE: Operating solver in PISO mode

Starting time loop

Courant Number mean: 1.56909e-05 max: 0.000175292
Interface Courant Number mean: 0 max: 0
deltaT = 1.19999e-07
Time = 1.19999e-07s

--> FOAM FATAL ERROR:
Cannot add a mass source for field alpha.liquid to equation for alpha.liquid because this field's equation was not recognised as being in mass-conservative form

    From function void Foam::fv::massSourceBase::addSupType(Foam::VolField<Type>&, Foam::fvMatrix<Type>&) const [with Type = double; Foam::VolField<Type> = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>]
    in file massSource/massSourceBase.C at line 65.

FOAM exiting
```
From the documentation I cannot see what I am doing wrong.

Is there anything I can do to fix this error? I do not think I can intervene on the equations defined for the alpha field in this solver.

Any ideas welcomed.
Steps To Reproduce1. download the attached case files.
2. Export
3. Run
```
setFields && foamRun
```
Additional InformationThe case runs without troubles in OpenFOAM v11
TagsNo tags attached.

Activities

kakila

2024-08-20 14:57

reporter  

e12.zip (641,283 bytes)

henry

2024-08-20 16:11

manager   ~0013380

Why are you using a mass source rather than a volume source? Take a look at:
tutorials/incompressibleVoF/damBreakInjection/constant/fvModels

kakila

2024-08-20 16:13

reporter   ~0013381

It seems the issue is the keyword "phase" in the definition of the massSource. Removing the keyword fixes the problem in v12.
In v11 it works even with the keyword.

henry

2024-08-20 16:38

manager   ~0013382

User support request

Issue History

Date Modified Username Field Change
2024-08-20 14:57 kakila New Issue
2024-08-20 14:57 kakila File Added: e12.zip
2024-08-20 16:11 henry Note Added: 0013380
2024-08-20 16:13 kakila Note Added: 0013381
2024-08-20 16:38 henry Assigned To => henry
2024-08-20 16:38 henry Status new => closed
2024-08-20 16:38 henry Resolution open => no change required
2024-08-20 16:38 henry Note Added: 0013382