CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Fatal Error - incompressibleVoF massSource - OF v12

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 19, 2024, 10:32
Default Fatal Error - incompressibleVoF massSource - OF v12
  #1
New Member
 
Juan Pablo Carbajal
Join Date: Jun 2021
Posts: 23
Rep Power: 5
kakila is on a distinguished road
Dear all,

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:
Code:
  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;
    }
  }
For OFv12 I edited the file to (removed fieldValues and made flowrate positive)
Code:
  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
Code:
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
Code:
$ 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
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.
kakila is offline   Reply With Quote

Old   August 20, 2024, 07:25
Default
  #2
New Member
 
Juan Pablo Carbajal
Join Date: Jun 2021
Posts: 23
Rep Power: 5
kakila is on a distinguished road
Actually, I get the error even if I use the old configuration files without any edit.
Code:
--> 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

Last edited by kakila; August 20, 2024 at 07:26. Reason: typo in CODE
kakila is offline   Reply With Quote

Old   August 21, 2024, 08:24
Default
  #3
New Member
 
Juan Pablo Carbajal
Join Date: Jun 2021
Posts: 23
Rep Power: 5
kakila is on a distinguished road
Thanks to henry from the OpenFOAM issue tracker I could solve this.

Although massSource is listed in the table of fvModles available for the incompressibleVoF solver, it shouldn't be used with incompressible solvers (this is also noted in the documentation of massSource).

To achieve injection of mass into the domain using incompressible solvers, use volumeSource instead.
kakila is offline   Reply With Quote

Reply

Tags
mass source term, ofv12


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
type limitTemperature problem AdamRM OpenFOAM Running, Solving & CFD 6 November 16, 2023 06:55
massSource of specie i into the domain NuclearLeaf OpenFOAM 2 July 25, 2022 12:24
Problems with PyFoam and batch file! alfogianco OpenFOAM Running, Solving & CFD 0 January 5, 2022 09:57
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 05:18
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16


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