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

how to make a scalar transport equation to be conserved?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 5, 2013, 07:33
Default how to make a scalar transport equation to be conserved?
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
hello
I run a solver that has a scalar transport equation scalar but value is not between 0 and 1 as the snapshot.
how to resolve?
this is the equation I modified solver by:
Code:
// --- Scalar Transport
    tmp<fvScalarMatrix> gasEqn
    (
     fvm::ddt(rho,gas) 
             + fvm::div(phi, gas)
                -fvm::Sp(fvc::div(phi), gas)
                      - fvm::laplacian(turbulence->muEff(), gas)     
    );
    
    gasEqn().relax();
    
    gasEqn().solve(mesh.solver("gas"));
how to make it conseved so that gas(a scalar transport variable)be between 0(internalField value) and 1(inlet value)?(outlet zeroGradient.one inlet and one outlet only)
thanks.
Attached Thumbnails
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   May 5, 2013, 08:01
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Ehsan,

A few questions:
  1. Are you using a compressible or incompressible solver?
    1. Which solver are you using as base?
  2. What are the base fluid properties?
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   May 5, 2013, 08:04
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
hi Bruno
compressible.viscous.in both rhoCentralFoam and rhoPimpleFoam it occurs.
I had sent you the modified solvers and a case before.I think its because scalar transport equation is not conserved.maybe a term is excess or in lack!
I use janafThermo and sutherland
Code:
//thermoType      hePsiThermo<pureMixture<sutherland<janaf<perfectGas<specie>>,sensibleEnthalpy>>>;
thermoType
{
    type            hePsiThermo;
    mixture         pureMixture;
    transport       sutherland;
    thermo          janaf;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}
mixture
{
    specie
    {
        nMoles          1;
        molWeight       28.96;
    }
    thermodynamics
    {
     Tlow 200;
     Thigh 6000;
     Tcommon 1000;
     highCpCoeffs (3.129672277499967 1.211766752750042e-3 -4.04761109000018e-7 6.409571300000324e-11 -3.780447620000211e-15 -.996955811e3 5.257756413);
     lowCpCoeffs  (3.593868050000014 -8.419292810001117e-4 2.08457592775033e-6 -5.938441825004294e-10 -2.456771699998039e-13 -1.0512181e3 3.140021718);
        /*Cp              1040;
        Hf              2.544e+06;*/
    }
    transport
    {
       As 1.4584e-6;
       Ts 110.4;
        /*mu              1.84e-05;
        Pr              0.75;*/
    }
}


// ************************************************************************* //
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   May 5, 2013, 08:11
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
OK, then for comparison, adapt the solver pimpleFoam as well and compare the results.
Because as I wrote before in the same thread you mentioned, this way it'll make it easier to diagnose which component is making the scalar diffuse too much!
__________________
wyldckat 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
Passive scalar transport novyno OpenFOAM Running, Solving & CFD 10 May 5, 2016 13:31
problems concerning mass conservativity in bubbleFoam with custom scalar transport cutter OpenFOAM Programming & Development 3 February 10, 2015 04:25
Source Term on Scalar Transport Equation alessio.nz OpenFOAM Programming & Development 9 January 31, 2011 07:56
Scalar transport equation dimension problem litonx OpenFOAM Running, Solving & CFD 3 March 2, 2007 06:49
Scalar Transport Equations David harvey FLUENT 1 January 31, 2004 06:15


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