Difference between revisions of "ChtMultiRegionFoam"

From OpenFOAMWiki
(Momentum conservation)
(Momentum conservation)
Line 54: Line 54:
 
     \frac{ \partial (\rho {u}_i)}{\partial t} + \frac{\partial}{\partial x_j} \left( \rho {u}_j u_i \right) =  
 
     \frac{ \partial (\rho {u}_i)}{\partial t} + \frac{\partial}{\partial x_j} \left( \rho {u}_j u_i \right) =  
  
   - \frac{\partial p_{rgh}} {\partial{x_i}} + \frac{\partial \rho g_j x_j}{\partial x_i}  + \frac{\partial}{\partial x_j} \left( \tau_{ij} + \tau_{t_{ij}} \right)  
+
   - \frac{\partial p_{rgh}} {\partial{x_i}} - \frac{\partial \rho g_j x_j}{\partial x_i}  + \frac{\partial}{\partial x_j} \left( \tau_{ij} + \tau_{t_{ij}} \right)  
  
 
</math></center>
 
</math></center>
Line 61: Line 61:
 
<math> u </math> represent the velocity, <math> g_i </math> the gravitational acceleration, <math> p_{rgh} = p - \rho g_j x_j </math> the pressure minus the hydrostatic pressure and  
 
<math> u </math> represent the velocity, <math> g_i </math> the gravitational acceleration, <math> p_{rgh} = p - \rho g_j x_j </math> the pressure minus the hydrostatic pressure and  
 
<math> \tau_{ij}  </math> and <math> \tau_{t_{ij}}  </math> are the viscose and turbulent stresses.
 
<math> \tau_{ij}  </math> and <math> \tau_{t_{ij}}  </math> are the viscose and turbulent stresses.
 +
 +
The source code can be found in Ueqn.H:
 +
 +
<br><cpp>
 +
 +
    // Solve the Momentum equation
 +
 +
    MRF.correctBoundaryVelocity(U);
 +
 +
    tmp<fvVectorMatrix> tUEqn
 +
    (
 +
        fvm::ddt(rho, U) + fvm::div(phi, U)
 +
      + MRF.DDt(rho, U)
 +
      + turbulence.divDevRhoReff(U)
 +
    ==
 +
        fvOptions(rho, U)
 +
    );
 +
    fvVectorMatrix& UEqn = tUEqn.ref();
 +
 +
    UEqn.relax();
 +
 +
    fvOptions.constrain(UEqn);
 +
 +
    if (pimple.momentumPredictor())
 +
    {
 +
        solve
 +
        (
 +
            UEqn
 +
        ==
 +
            fvc::reconstruct
 +
            (
 +
                (
 +
                  - ghf*fvc::snGrad(rho)
 +
                  - fvc::snGrad(p_rgh)
 +
                )*mesh.magSf()
 +
            )
 +
        );
 +
 +
        fvOptions.correct(U);
 +
        K = 0.5*magSqr(U);
 +
    }
 +
 +
    fvOptions.correct(U);
 +
 +
 +
</cpp><br>
  
 
====Energy conservation====
 
====Energy conservation====

Revision as of 18:15, 2 November 2018

ChtMultiRegionFoam

   Solver for steady or transient fluid flow and solid heat conduction, with
   conjugate heat transfer between regions, buoyancy effects, turbulence,
   reactions and radiation modelling.

1 Equations

For each region defined as fluid, the according equation for the fluid is solved and the same is done for each solid region. The regions are coupled by a thermal boundary condition.

1.1 Equations Fluid

For each fluid region the compressible Navier Stokes equation are solved.

1.1.1 Mass conservation

The variable-density continuity equation is



\frac{\partial \rho}{\partial t} +   \frac{\partial {\rho u}_j}{\partial x_j} = 0
(1)

The source code can be found in src/finiteVolume/cfdTools/compressible/rhoEqn.H:


 
 
{
    fvScalarMatrix rhoEqn
    (
        fvm::ddt(rho)
      + fvc::div(phi)
      ==
        fvOptions(rho)
    );
 
    fvOptions.constrain(rhoEqn);
 
    rhoEqn.solve();
 
    fvOptions.correct(rho);
}
 

1.1.2 Momentum conservation



    \frac{ \partial (\rho {u}_i)}{\partial t} + \frac{\partial}{\partial x_j} \left( \rho {u}_j u_i \right) = 

   - \frac{\partial p_{rgh}} {\partial{x_i}} - \frac{\partial \rho g_j x_j}{\partial x_i}  + \frac{\partial}{\partial x_j} \left( \tau_{ij} + \tau_{t_{ij}} \right)
(2)

 u represent the velocity,  g_i the gravitational acceleration,  p_{rgh} = p - \rho g_j x_j the pressure minus the hydrostatic pressure and  \tau_{ij}  and  \tau_{t_{ij}}  are the viscose and turbulent stresses.

The source code can be found in Ueqn.H:


 
 
    // Solve the Momentum equation
 
    MRF.correctBoundaryVelocity(U);
 
    tmp<fvVectorMatrix> tUEqn
    (
        fvm::ddt(rho, U) + fvm::div(phi, U)
      + MRF.DDt(rho, U)
      + turbulence.divDevRhoReff(U)
     ==
        fvOptions(rho, U)
    );
    fvVectorMatrix& UEqn = tUEqn.ref();
 
    UEqn.relax();
 
    fvOptions.constrain(UEqn);
 
    if (pimple.momentumPredictor())
    {
        solve
        (
            UEqn
         ==
            fvc::reconstruct
            (
                (
                  - ghf*fvc::snGrad(rho)
                  - fvc::snGrad(p_rgh)
                )*mesh.magSf()
            )
        );
 
        fvOptions.correct(U);
        K = 0.5*magSqr(U);
    }
 
    fvOptions.correct(U);
 
 

1.1.3 Energy conservation

1.2 Equations Solid

2 Source Code