FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

UEqns.H

Go to the documentation of this file.
00001 fvVectorMatrix UaEqn(Ua, Ua.dimensions()*dimVol/dimTime);
00002 fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime);
00003 
00004 {
00005     {
00006         volTensorField gradUaT = fvc::grad(Ua)().T();
00007 
00008         if (kineticTheory.on())
00009         {
00010             kineticTheory.solve(gradUaT);
00011             nuEffa = kineticTheory.mua()/rhoa;
00012         }
00013         else // If not using kinetic theory is using Ct model
00014         {
00015             nuEffa = sqr(Ct)*nutb + nua;
00016         }
00017 
00018         volTensorField Rca
00019         (
00020             "Rca",
00021             ((2.0/3.0)*I)*(sqr(Ct)*k + nuEffa*tr(gradUaT)) - nuEffa*gradUaT
00022         );
00023 
00024         if (kineticTheory.on())
00025         {
00026             Rca -= ((kineticTheory.lambda()/rhoa)*tr(gradUaT))*tensor(I);
00027         }
00028 
00029         surfaceScalarField phiRa =
00030             -fvc::interpolate(nuEffa)*mesh.magSf()*fvc::snGrad(alpha)
00031             /fvc::interpolate(alpha + scalar(0.001));
00032 
00033         UaEqn =
00034         (
00035             (scalar(1) + Cvm*rhob*beta/rhoa)*
00036             (
00037                 fvm::ddt(Ua)
00038               + fvm::div(phia, Ua, "div(phia,Ua)")
00039               - fvm::Sp(fvc::div(phia), Ua)
00040             )
00041 
00042           - fvm::laplacian(nuEffa, Ua)
00043           + fvc::div(Rca)
00044 
00045           + fvm::div(phiRa, Ua, "div(phia,Ua)")
00046           - fvm::Sp(fvc::div(phiRa), Ua)
00047           + (fvc::grad(alpha)/(fvc::average(alpha) + scalar(0.001)) & Rca)
00048          ==
00049         //  g                          // Buoyancy term transfered to p-equation
00050           - fvm::Sp(beta/rhoa*K, Ua)
00051         //+ beta/rhoa*K*Ub             // Explicit drag transfered to p-equation
00052           - beta/rhoa*(liftCoeff - Cvm*rhob*DDtUb)
00053         );
00054 
00055         UaEqn.relax();
00056     }
00057 
00058     {
00059         volTensorField gradUbT = fvc::grad(Ub)().T();
00060         volTensorField Rcb
00061         (
00062             "Rcb",
00063             ((2.0/3.0)*I)*(k + nuEffb*tr(gradUbT)) - nuEffb*gradUbT
00064         );
00065 
00066         surfaceScalarField phiRb =
00067             -fvc::interpolate(nuEffb)*mesh.magSf()*fvc::snGrad(beta)
00068             /fvc::interpolate(beta + scalar(0.001));
00069 
00070         UbEqn =
00071         (
00072             (scalar(1) + Cvm*rhob*alpha/rhob)*
00073             (
00074                 fvm::ddt(Ub)
00075               + fvm::div(phib, Ub, "div(phib,Ub)")
00076               - fvm::Sp(fvc::div(phib), Ub)
00077             )
00078 
00079           - fvm::laplacian(nuEffb, Ub)
00080           + fvc::div(Rcb)
00081 
00082           + fvm::div(phiRb, Ub, "div(phib,Ub)")
00083           - fvm::Sp(fvc::div(phiRb), Ub)
00084 
00085           + (fvc::grad(beta)/(fvc::average(beta) + scalar(0.001)) & Rcb)
00086          ==
00087         //  g                          // Buoyancy term transfered to p-equation
00088           - fvm::Sp(alpha/rhob*K, Ub)
00089         //+ alpha/rhob*K*Ua            // Explicit drag transfered to p-equation
00090           + alpha/rhob*(liftCoeff + Cvm*rhob*DDtUa)
00091         );
00092 
00093         UbEqn.relax();
00094     }
00095 }
00096 
00097 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines