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

Passive Scalar Out of Bounds

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By floquation
  • 1 Post By floquation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 1, 2017, 09:04
Talking Passive Scalar Out of Bounds
  #1
Senior Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10
FlyBob91 is on a distinguished road
Hello to all,
i've just met some problem with scalarTransportFoam, because i find the scalar is larger than 1 in some points and smaller than zero. I think this is up to the schemes used.
I'm working on OF1612+ and this is my fvSchemes file (the original from pitzDaily case).
I run the direct simulation to find the U field then i copy it in the 0 folder where i run scalaTransportFoam.
Why is my scalar out of bounds? Any Solution?

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  plus                                  |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default         Euler;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         none;
    div(phi,T)      Gauss linearUpwind grad(T);
}

laplacianSchemes
{
    default         none;
    laplacian(DT,T) Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}


// ************************************************************************* //

Thanks for help
FlyBob91 is offline   Reply With Quote

Old   August 1, 2017, 09:11
Default
  #2
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20
floquation will become famous soon enough
Use a bounded scheme instead.

Replace your "divScheme" (so the scheme for the convective term) by banana.
Then choose one of the schemes that start with "limited". For example (disclaimer: typed from memory, could contain a syntax error):
Code:
div(phi,T) limitedVanLeer 0 1;
FlyBob91 likes this.
floquation is offline   Reply With Quote

Old   August 1, 2017, 10:01
Default
  #3
Senior Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10
FlyBob91 is on a distinguished road
Quote:
Originally Posted by floquation View Post
Use a bounded scheme instead.

Replace your "divScheme" (so the scheme for the convective term) by banana.
Then choose one of the schemes that start with "limited". For example (disclaimer: typed from memory, could contain a syntax error):
Code:
div(phi,T) limitedVanLeer 0 1;
Many thanks Kevin. I wrongly took for granted the solver bounded the scalar between 0 and 1.
Maybe can you suggest me a second order scheme (i noticed that the linear scheme flattens too much the solution) that works good in channel flow?
FlyBob91 is offline   Reply With Quote

Old   August 1, 2017, 10:35
Default
  #4
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20
floquation will become famous soon enough
Did you mean "linear" or "linearUpwind"? Since you said "linear" in your last post, but your first post showed that you were using "linearUpwind".

Either way, according to the OF user guide, both "linear" and "linearUpwind" are already second order.

Personally, I am using limitedVanLeer, but what works for my case needs not work for your case. I am performing multiphase simulations with interFoam.
FlyBob91 likes this.
floquation is offline   Reply With Quote

Old   August 5, 2017, 05:29
Default
  #5
Senior Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10
FlyBob91 is on a distinguished road
Hello,
I tried to use some bounded schemes they seem to limit correctly the passive scalar but, unfortunately, the solution is very far to what i have to obtain.

If you compare the image of what i have to obation with my solution without the bounded condition you can see they are qualitatively similar except for the scalar which is unbounded

What I have to Obtain.png

My Solution Without Buonded Condition.png

The fvSchemes i used are those i reported in the first post.
Then i used these schemes

Code:
ddtSchemes
{
    default         Euler;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         none;
    div(phi,T)      Gauss limitedLinear01 1;
}

laplacianSchemes
{
    default         none;
    laplacian(DT,T) Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

fluxRequired
{
    default         no;
    T               ;
}
And here the results. It seems Gauss limitedLinear01 flattens to much the scalar field.

My Solution With Bounded Condition.png




I state my case is a mixing problem in a channel with 2 inlets. At the first Inlet i impose T=1 and at the second T=0 and the images show the outlet of the channel. I'm working on ofv1612+
Another question. Reading the OF user guide i noticed that Gauss limitedLinear01 is followed by another 1. What is his meaning?

Any Idea?
Thanks for help
FlyBob91 is offline   Reply With Quote

Old   August 7, 2017, 06:26
Default
  #6
Senior Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10
FlyBob91 is on a distinguished road
Hello to all,
i'm here again. I literally tested alle the limited method as suggested but the problem continues to appear.

Here all the files of my case. Maybe the problem is not the scheme.

Code:
ddtSchemes
{
    default         Euler;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         none;
    div(phi,T)      Gauss linearUpwind grad(T);
}

laplacianSchemes
{
    default         none;
    laplacian(DT,T) Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    T
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance       1e-06;
        relTol          0;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;

}
Code:
dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0.5;

boundaryField
{

    inlet1
    {
        type            fixedValue;
        value           uniform 1;
    }

    inlet2
    {
        type            fixedValue;
        value           uniform 0;
    }

    outlet
    {
        type            zeroGradient;
    }

    walls
    {
        type            zeroGradient;
    }

    movable
    {
        type            zeroGradient;
    }

}

thanks for help
FlyBob91 is offline   Reply With Quote

Old   August 10, 2017, 06:17
Default
  #7
Senior Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10
FlyBob91 is on a distinguished road
Little update!
The Gauss linearUpwind grad(T) for the divergence term seems to be the scheme which, qualitatively, gives best results. Is there a manner to make to mantain it applaying a limit? Os is better if i start to work to the other term as the gradient and laplacian?
FlyBob91 is offline   Reply With Quote

Reply


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 during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 04:18
Division by zero exception - loop over scalarField Pat84 OpenFOAM Programming & Development 6 February 18, 2017 05:57
Issue symmetryPlane 2.5d extruded airfoil simulation 281419 OpenFOAM Running, Solving & CFD 5 November 28, 2015 13:09
Diverging solution in transonicMRFDyMFoam tsalter OpenFOAM Running, Solving & CFD 30 July 7, 2014 06:20
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 01:47


All times are GMT -4. The time now is 14:07.