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

No difference in solver behaviour with implicit source term

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 9, 2017, 04:16
Default No difference in solver behaviour with implicit source term
  #1
New Member
 
Dan
Join Date: Sep 2016
Posts: 20
Rep Power: 9
Gesetzt is on a distinguished road
Hi,

my old solver works like this:
Code:
 while (simple.correctNonOrthogonal())
        {
            fvScalarMatrix TEqn
            (
                        fvm::ddt(T)
                      + fvm::div(phi, T)
                      - fvm::laplacian(DM, T)
                      - T0/T1
                      +T/T1
                     ==
                        fvOptions(T)
            );
I wanted to treat the term T/T1 implicit, because T>0, and T1>0, so it would be negative on the RHS. As far as I have understand, this leads to better stability. Am I right?

So I changed my solver to this:


Code:
while (simple.correctNonOrthogonal())
        {
            fvScalarMatrix MzEqn
            (
                        fvm::ddt(T)
                      + fvm::div(phi, T)
                      - fvm::laplacian(DM, T)
                      - T0/T1
                      + fvm::Sp(1/T1,T)
                     ==
                        fvOptions(T)
            );
But I can't see any difference in the results. T1 is a dimensionedScalar and T a volScalarField. How can I implement it in the right way?

Edit: I would like to add, that the problem is, that my scalar T should be bounded. I have a pipe and at the inlet I have a constant value of T=1, but my solver tends to go to 1.1 in the beginning of the pipe, which is not realistic. My thought was, that part of the problem is my source term.

I found out that when I us "bounded Gauss linearUpwind grad(T)" there is no problem. But I think it's no good idea to use the bounded scheme for transient solution?

Best Regards,

Gesetzt
Gesetzt is offline   Reply With Quote

Old   December 10, 2017, 06:14
Default
  #2
New Member
 
Dan
Join Date: Sep 2016
Posts: 20
Rep Power: 9
Gesetzt is on a distinguished road
Hi,

I want to give information about my fvSchemes file also:

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

ddtSchemes
{
    default         Euler;
}

gradSchemes
{
    default         cellLimited Gauss linear 1;
}

divSchemes
{
    default         none;
    div(phi,T)       Gauss linearUpwind grad(T);
   //div(phi,T)       Gauss banana;
   //div(phi,T)      Gauss QUICK;
    //div(phi,T)      Gauss limitedLinear 0.5;
}

laplacianSchemes
{
    default         none;
    laplacian(DM,T) Gauss linear corrected;
    //laplacian(DM,T) Gauss linear limited 1;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default        corrected;
}

fluxRequired
{
    default         no;
    T               ;
}


// ************************************************************************* //
The main problem is, that my bounded scalar is going out of bounds. I thought the problem is maybe the solver, but actually I am not sure about this.
I tried different schemes, but the problem continues. Can anybody give me advice?
Gesetzt 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
adding scalar source term in scalarTransportFoam solver fluidflowsteel OpenFOAM 1 July 25, 2016 21:58
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 tlcoons OpenFOAM Installation 13 April 20, 2016 17:34
what is swap4foam ?? AB08 OpenFOAM 28 February 2, 2016 01:22
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 16:02
[swak4Foam] build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Community Contributions 14 April 23, 2013 13:59


All times are GMT -4. The time now is 21:34.