CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM

Modifying pEqn: "cannot scale a matrix containing a faceFluxCorrection"

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   October 30, 2019, 11:45
Default Modifying pEqn: "cannot scale a matrix containing a faceFluxCorrection"
Raunak Bardia
Join Date: Jan 2015
Posts: 32
Rep Power: 10
raunakbardia is on a distinguished road
This post is related to the two-phase flow solver isoAdvector in OpenFoam v1706.

I am working to implement a new method to capture surface tension and hence, I am currently playing around with pEqn.H. Here is the pressure matrix I am trying to create.

fvScalarMatrix p_rghEqn
    isLiquid * fvm::laplacian(rAULf, p_rgh)
    + (1 - isLiquid) * fvm::laplacian(rAUVf, p_rgh)
     - isLiquid * fvc::laplacian(rAULf * DPField, isInterfaceOwnerLiquid)
     - (1 - isLiquid) * fvc::laplacian(rAUVf * DPField, isInterfaceOwnerLiquid)
     + isLiquid * fvc::laplacian(rAULf * DPField, isInterfaceOwnerVapor)
     + (1 - isLiquid) * fvc::laplacian(rAUVf * DPField, isInterfaceOwnerVapor)
     + fvc::div(phiHbyA) 

"isLiquid" is a volScalarField

volScalarField isLiquid
On executing this code, it throws the following error. I have attached a copy of the output log as well.

cannot scale a matrix containing a faceFluxCorrection

    From function void Foam::fvMatrix<Type>::operator*=(const Internal&) [with Type = double; Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::Internal = Foam::DimensionedField<double, Foam::volMesh>]
    in file /usr/local/openfoam/v1706/OpenFOAM-v1706/src/finiteVolume/lnInclude/fvMatrix.C at line 1242.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) in "/usr/local/openfoam/v1706/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/"
#1  Foam::error::abort() in "/usr/local/openfoam/v1706/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/"
#2  Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) at /usr/local/openfoam/v1706/OpenFOAM-v1706/src/OpenFOAM/lnInclude/errorManip.H:85
#3  Foam::fvMatrix<double>::operator*=(Foam::DimensionedField<double, Foam::volMesh> const&) at /usr/local/openfoam/v1706/OpenFOAM-v1706/src/finiteVolume/lnInclude/fvMatrix.C:1242
#4  ? at /usr/local/openfoam/v1706/OpenFOAM-v1706/src/finiteVolume/lnInclude/fvMatrix.C:2247
#5  ? at ~/OpenFOAM/rbardia-v1706/applications/solvers/temperatureFoam/pEqn.H:50
#6  __libc_start_main in "/lib64/"
#7  Foam::UOPstream::write(float) in "/home/rbardia/OpenFOAM/rbardia-v1706/platforms/linux64GccDPInt32Opt/bin/temperatureFoam"
The error is pointing to the factor "isLiquid", which I am multiplying with the "fvm::laplacian" operation in the formation of the pEqn matrix. This multiplication apparently is not allowed for matrices that use face flux correction often implemented for non-orthogonal matrices by using the corrected laplacian scheme as shown here. The fvSchemes file I am using is also attached.
    default         Gauss linear corrected;
However, my question stems from the fact that I am writing a similar scalar matrix for another variable "T", which is not posing this issue. TEqn.H is attached and the matrix is shown below:

fvScalarMatrix TEqn
    fvm::ddt(rhoCp ,T) 
    - isLiquid * fvm::laplacian(kLEff, T)
    - (1 - isLiquid) * fvm::laplacian(kVEff, T)
    isLiquid * fvc::laplacian(kLEff * DTField, isInterfaceOwnerLiquid)
    + (1 - isLiquid) * fvc::laplacian(kVEff * DTField, isInterfaceOwnerLiquid)
    - isLiquid * fvc::laplacian(kLEff * DTField, isInterfaceOwnerVapor)
    - (1 - isLiquid) * fvc::laplacian(kVEff * DTField, isInterfaceOwnerVapor)
Can someone help me with the reason why the faceFluxCorrection is not thrown for the TEqn but it happens for pEqn? Is there a way this multiplication can be done for the pEqn matrix as well.

Help is much needed and greatly appreciated.

Attached Files
File Type: txt fvSchemes.txt (1.4 KB, 1 views)
File Type: h TEqn.H (847 Bytes, 1 views)
File Type: txt out.txt (3.5 KB, 0 views)
raunakbardia is offline   Reply With Quote

Old   January 10, 2020, 13:32
Default cannot scale a matrix containing a faceFluxCorrection
Join Date: Mar 2018
Location: India
Posts: 54
Rep Power: 7
vivek05 is on a distinguished road
Hi Raunak Bardia,

Did you find answer to your question?

Because I have same problem with scalar transport equation.

Any help would be appreciated.

vivek05 is offline   Reply With Quote


fvm::laplacian, isoadvector, laplacian operator, peqn

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Problem simulating the temperature rise in a composite material (chtMultiRegionFoam) Adam_K OpenFOAM Running, Solving & CFD 2 March 27, 2019 06:51
How can I get the number of elements per row form the matrix? klausb OpenFOAM Programming & Development 2 December 30, 2018 15:27
How to find a good time scale strategy? StefanG CFX 19 June 8, 2012 08:41
Force can not converge colopolo CFX 13 October 4, 2011 22:03
OpenFOAM version 1.6 details lakeat OpenFOAM Running, Solving & CFD 42 August 26, 2009 21:47

All times are GMT -4. The time now is 12:01.