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

Implicit term in the continuity equation

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 28, 2019, 06:33
Default Implicit term in the continuity equation
  #1
pod
New Member
 
Join Date: Jun 2015
Posts: 16
Rep Power: 11
pod is on a distinguished road
Hello everyone,
I'm trying to use a continuity equation in chtMultiRegionFoam that looks like it (similarly to the one used in cavitatingFoam):


Code:
fvScalarMatrix rhoEqn
    (
        fvm::ddt(rho)
      + fvm::div(phi2, rho)
      ==
        fvOptions(rho)
    );

which basically has the second term implicit instead of explicit like in normal heat transfer solvers.
I get this known problem:


Code:
valueInternalCoeffs cannot be called for a calculatedFvPatchField
    on patch ...
    You are probably trying to solve for a field with a default boundary condition

I know this comes out if you set "calculated" b.c. type but I think mine should be fine:
in the 0 folder:
Code:
dimensions      [1 -3 0 0 0 0 0];

internalField   uniform 147;

boundaryField
{
    ".*"
    {
        type            zeroGradient;
    }
}

In the fluid part changeDictionary:

Code:
    rho
    {
    internalField   uniform 147;

    boundaryField
    {
        ".*"
        {
        type            zeroGradient;
                value           uniform 147;
        }
    }
    }

does anyone have any idea?
thanks a lot
pod is offline   Reply With Quote

Old   March 28, 2019, 07:37
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

the density field should be set automatically to calculated as the boundary values are "calculated" from other values. It is not a field like a passive scalar and I don´t think that your density field has zeroGradient patch types - even though you defined it. To check it, just plot rho before your continuity equation.

Furthermore, your equation is a transport equation and not a continuity equation:

\frac{\partial \rho}{\partial t} + \nabla \bullet (\underbrace{\rho \textbf{U}}_{phi2} \rho) = S_{\rho}

This equation looks more like an incompressible transport equation for the density.
granzer likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   March 28, 2019, 08:56
Default
  #3
pod
New Member
 
Join Date: Jun 2015
Posts: 16
Rep Power: 11
pod is on a distinguished road
Hello Tobi,
thanks a lot for your reply.
In reality phi2 is not equal to the definition of phi in heat transfer solvers (rho*U), but it is defined like:
Code:
surfaceScalarField phi2 = (fvc::interpolate(HbyA) & mesh.Sf())
         + rhorAUf*fvc::ddtCorr(U, linearInterpolate(U) & mesh.Sf()) - rhorAUf*mesh.magSf()*fvc::snGrad(p_rgh)/rhof;
in order to resemble the phi of cavitatingFoam, which is actually more similar to phiHbyA of chtMultiFoam. I forgot to mention that, sorry. So it is a continuity equation, right?


Also, the initialization of rho in cavitatingFoam's tutorials is similar to mine:
Code:
dimensions      [1 -3 0 0 0];

internalField   uniform 845;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 845;
    }

    outlet
    {
        type            fixedValue;
        value           uniform 835;
    }

    walls
    {
        type            zeroGradient;
    }

    frontBack
    {
        type            zeroGradient;
    }
}
that's why I don't understand what's wrong.
thanks
pod is offline   Reply With Quote

Old   March 29, 2019, 14:07
Default
  #4
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16
mAlletto will become famous soon enough
Quote:
Originally Posted by pod View Post
Hello everyone,
I'm trying to use a continuity equation in chtMultiRegionFoam that looks like it (similarly to the one used in cavitatingFoam):


Code:
fvScalarMatrix rhoEqn
    (
        fvm::ddt(rho)
      + fvm::div(phi2, rho)
      ==
        fvOptions(rho)
    );

which basically has the second term implicit instead of explicit like in normal heat transfer solvers.
I get this known problem:


Code:
valueInternalCoeffs cannot be called for a calculatedFvPatchField
    on patch ...
    You are probably trying to solve for a field with a default boundary condition

I know this comes out if you set "calculated" b.c. type but I think mine should be fine:
in the 0 folder:
Code:
dimensions      [1 -3 0 0 0 0 0];

internalField   uniform 147;

boundaryField
{
    ".*"
    {
        type            zeroGradient;
    }
}

In the fluid part changeDictionary:

Code:
    rho
    {
    internalField   uniform 147;

    boundaryField
    {
        ".*"
        {
        type            zeroGradient;
                value           uniform 147;
        }
    }
    }

does anyone have any idea?
thanks a lot
The error you posted usually appears if the boundary condition is unknown. Did you try to remove the value under zeroGradient?
mAlletto is offline   Reply With Quote

Reply

Tags
boundary condition, chtmultiregionfoam, continuity equation, implicit explicit


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
courant number increases to rather large values 6863523 OpenFOAM Running, Solving & CFD 22 July 6, 2023 00:48
Domain Reference Pressure and mass flow inlet boundary AdidaKK CFX 75 August 20, 2018 06:37
pimpleDyMFoam computation randomly stops babapeti OpenFOAM Running, Solving & CFD 5 January 24, 2018 06:28
Stuck in a Rut- interDyMFoam! xoitx OpenFOAM Running, Solving & CFD 14 March 25, 2016 08:09
Floating point exception error lpz_michele OpenFOAM Running, Solving & CFD 53 October 19, 2015 03:50


All times are GMT -4. The time now is 09:23.