|
[Sponsors] |
How to add the species mass fraction equation to compressibleInterFoam? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 25, 2023, 06:13 |
How to add the species mass fraction equation to compressibleInterFoam?
|
#1 |
New Member
Qian Meng
Join Date: Nov 2022
Posts: 4
Rep Power: 4 |
Hello,everyone!
I am now trying to add the species mass fraction equation to compressibleInterFoam, but since I have less programming experience, I am not sure if this is correct? Code:
tmp<fv::convectionScheme<scalar>> mvConvection ( fv::convectionScheme<scalar>::New ( mesh, fields, alpha2rho2phi, mesh.divScheme("div(alpha2rho2phi,Yi)") ) ); { combustion->correct(); Qdot = combustion->Qdot(); volScalarField Yt(0.0*Y[0]); volScalarField alpha2muEff("alpha2muEff" , alpha2*turbulence.muEff()); forAll(Y, i) { if (i != inertIndex && composition.active(i)) { volScalarField& Yi = Y[i]; fvScalarMatrix YEqn ( fvm::ddt(alpha2rho2, Yi) + mvConvection->fvmDiv(alpha2rho2phi, Yi) - fvm::laplacian(alpha2muEff, Yi) == parcels.SYi(i, Yi) + combustion->R(Yi) + fvOptions(rho, Yi) ); YEqn.relax(); fvOptions.constrain(YEqn); YEqn.solve(mesh.solver("Yi")); fvOptions.correct(Yi); Yi.max(0.0); Yt += Yi; } } Y[inertIndex] = scalar(1) - Yt; Y[inertIndex].max(0.0); Code:
volScalarField alpha2rho2 ( IOobject ( "alpha2rho2", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), alpha2*rho2 ); surfaceScalarField alpha2rho2phi ( IOobject ( "alpha2phi", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), linearInterpolate(alpha2*rho2*U) & mesh.Sf() ); |
|
Tags |
compressibleinterfoam |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mass fraction of species | Lilly | FLUENT | 5 | March 13, 2022 18:52 |
What is the equation or formula to calculate Mass Flux[kg/m²s] of species in Fluent? | THA SEANGHAI | FLUENT | 0 | September 11, 2020 02:10 |
Order of species in the array of mass fraction | Vidushi | FLUENT | 5 | May 20, 2020 06:44 |
Define mass flow profile with regards to species mass fraction | danS | Fluent UDF and Scheme Programming | 0 | June 20, 2017 07:21 |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 04:32 |