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

fixedFluxPressure BC: updateCoeffs(const scalarField& snGradp) MUST be called ...

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 5, 2020, 09:52
Question fixedFluxPressure BC: updateCoeffs(const scalarField& snGradp) MUST be called ...
  #1
New Member
 
Mohammad Khojastehmehr
Join Date: Jul 2020
Posts: 20
Rep Power: 6
MCrossover97 is on a distinguished road
Hey everybody!

I want to simulate 1D steady state flow in porous media using Darcy law. The equations are as follows:

Code:
\nabla.U=0;
U=\frac{-K}{\mu}\nablap;
where U is the velocity, p is pressure. \mu is the viscosity and K is the permeability.

As the inlet velocity is considered a constant in the case of my problem, I decided to use fixedFluxPressure BC. So, the the initial and boundary conditions would be:

p:
Code:
internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            fixedFluxPressure;
    }

    outlet
    {
        type            fixedValue;
        value           uniform 0;
    }

    frontAndBackAndTopAndBottom
    {
        type            empty;
    }
}
and U:
Code:
boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform (1 0 0);
    }

    outlet
    {
        type            zeroGradient
    }

    frontAndBackAndTopAndBottom
    {
        type            empty;
    }
}
I tried to solve the equations as follows:
Code:
fvScalarMatrix pEqn
    (
	fvm::laplacian(k/mu,p)
    );
pEqn.solve();

U=-k/mu*fvc::grad(p);
However, when I run my solver the case, I get this error:
Code:
--> FOAM FATAL ERROR:
updateCoeffs(const scalarField& snGradp) MUST be called before updateCoeffs() or evaluate() to set the boundary gradient.

    From function virtual void Foam::fixedFluxPressureFvPatchScalarField::updateCoeffs()
    in file fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C at line 157.
I don't know exactly how this fixedFluxPressure BC works and How it exactly uses the velocity field to calculate pressure gradient at the inlet. I would be very appreciated if anyone can help me with this.
MCrossover97 is offline   Reply With Quote

Old   June 25, 2021, 07:03
Default
  #2
New Member
 
Kennedy Murithi Micheni
Join Date: Apr 2020
Posts: 6
Rep Power: 6
Kenmaster is on a distinguished road
Quote:
Originally Posted by MCrossover97 View Post
Hey everybody!

I want to simulate 1D steady state flow in porous media using Darcy law. The equations are as follows:

Code:
\nabla.U=0;
U=\frac{-K}{\mu}\nablap;
where U is the velocity, p is pressure. \mu is the viscosity and K is the permeability.

As the inlet velocity is considered a constant in the case of my problem, I decided to use fixedFluxPressure BC. So, the the initial and boundary conditions would be:

p:
Code:
internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            fixedFluxPressure;
    }

    outlet
    {
        type            fixedValue;
        value           uniform 0;
    }

    frontAndBackAndTopAndBottom
    {
        type            empty;
    }
}
and U:
Code:
boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform (1 0 0);
    }

    outlet
    {
        type            zeroGradient
    }

    frontAndBackAndTopAndBottom
    {
        type            empty;
    }
}
I tried to solve the equations as follows:
Code:
fvScalarMatrix pEqn
    (
	fvm::laplacian(k/mu,p)
    );
pEqn.solve();

U=-k/mu*fvc::grad(p);
However, when I run my solver the case, I get this error:
Code:
--> FOAM FATAL ERROR:
updateCoeffs(const scalarField& snGradp) MUST be called before updateCoeffs() or evaluate() to set the boundary gradient.

    From function virtual void Foam::fixedFluxPressureFvPatchScalarField::updateCoeffs()
    in file fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C at line 157.
I don't know exactly how this fixedFluxPressure BC works and How it exactly uses the velocity field to calculate pressure gradient at the inlet. I would be very appreciated if anyone can help me with this.
Did you solve this
Kenmaster is offline   Reply With Quote

Reply

Tags
boundary condition, darcy's law, fixedfluxpressure


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
updateCoeffs(const scalarField& snGradp) MUST be called before updateCoeffs() jinyaqing OpenFOAM Running, Solving & CFD 7 March 14, 2024 12:57
SU2-7.0.1 on ubuntu 18.04 hyunko SU2 Installation 7 March 16, 2020 05:37
fixedFluxPressure with PisoFoam me.ouda OpenFOAM Running, Solving & CFD 1 October 27, 2015 06:30
terminate called after throwing an instance of 'int' b614910 SU2 10 July 27, 2014 23:16
reconstructParMesh not working with an axisymetric case francesco OpenFOAM Bugs 4 May 8, 2009 06:49


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