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

Incompatible dimensionsof pcorr and div(phi) in interFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 1, 2021, 08:54
Default Incompatible dimensionsof pcorr and div(phi) in interFoam
  #1
New Member
 
Prasad ADHAV
Join Date: Apr 2020
Location: Belval, Luxembourg
Posts: 10
Rep Power: 6
Alpha001 is on a distinguished road
Hello,

I use Ubuntu 18.04 LTS.
OpenFOAM v7.

I have added new fields in interFoam in `createFields.H`, and I have renamed the solver as PorousInterFoam.

Code:
Info<< "Reading transportProperties\n" << endl;
immiscibleIncompressibleTwoPhaseMixture mixture(U, phi);

volScalarField& alpha1(mixture.alpha1());
volScalarField& alpha2(mixture.alpha2());

const dimensionedScalar& rho1 = mixture.rho1();
const dimensionedScalar& rho2 = mixture.rho2();


// Need to store rho for ddt(rho, U)
Info<< "Writing field rho \n"
       "\n" << endl;
volScalarField rho
(
    IOobject
    (
        "rho",
        runTime.timeName(),
        mesh,
        IOobject::READ_IF_PRESENT,
        IOobject::AUTO_WRITE
    ),
    alpha1*rho1 + alpha2*rho2
);
rho.oldTime();

Info<< "Writing field mu\n" << endl;
volScalarField mu
(
    IOobject
    (
        "mu",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
    ),
    mixture.mu()*1.0
);

Info<< "Reading field Volume_Porosity\n" << endl;
volScalarField Volume_Porosity
(
    IOobject
    (
        "Volume_Porosity",
        runTime.timeName(),
        mesh,
        IOobject::MUST_READ,
        IOobject::AUTO_WRITE
    ),
    mesh
);

// GradP is declared after p and p_rgh
Info<< "Reading field GradP\n" << endl;
volVectorField GradP
(
    IOobject
    (
        "GradP",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
    ),
    fvc::grad(p)
);
I have added the following in PorousInterFoam.C, the solver file.
It is inside pimple loop and after `mixture.correct();`

Code:
mu = mixture.mu(); 
GradP = fvc::grad(p);
I have a set up a dam break case, with the following changes to `fvSchemes` and
`fvSolutions`.

When I run the case I get the following error due to dimension mismatch:

Code:
--> FOAM FATAL ERROR: 

    [pcorr[2 -2 -4 0 0 0 0] ] + [div(phi)[0 0 -1 0 0 0 0] ]

    From function void Foam::checkMethod(const Foam::fvMatrix<Type>&, const Foam::DimensionedField<Type, Foam::volMesh>&, const char*) [with Type = double]
    in file /opt/openfoam7/src/finiteVolume/lnInclude/fvMatrix.C at line 1291.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  void Foam::checkMethod<double>(Foam::fvMatrix<double> const&, Foam::DimensionedField<double, Foam::volMesh> const&, char const*) in "/home/prasad/OpenFOAM/prasad-7/platforms/linux64GccDPInt32Opt/bin/PorousInterFoam"
#3  Foam::tmp<Foam::fvMatrix<double> > Foam::operator+<double>(Foam::tmp<Foam::fvMatrix<double> > const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) in "/home/prasad/OpenFOAM/prasad-7/platforms/linux64GccDPInt32Opt/bin/PorousInterFoam"
#4  ? in "/home/prasad/OpenFOAM/prasad-7/platforms/linux64GccDPInt32Opt/bin/PorousInterFoam"
#5  ? in "/home/prasad/OpenFOAM/prasad-7/platforms/linux64GccDPInt32Opt/bin/PorousInterFoam"
#6  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7  ? in "/home/prasad/OpenFOAM/prasad-7/platforms/linux64GccDPInt32Opt/bin/PorousInterFoam"
Aborted (core dumped)
Not really sure where is this dimension mismatch from.
Is it the solver, or the simulation set-up?

Thank you.
Attached Files
File Type: txt fvSchemes.txt (1.3 KB, 3 views)
File Type: txt fvSolution.txt (3.2 KB, 3 views)
Alpha001 is offline   Reply With Quote

Reply

Tags
dimensions, interfoam, programming


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



All times are GMT -4. The time now is 11:05.