diff --git a/applications/solvers/combustion/SOxFoam/SOxFoam.C b/applications/solvers/combustion/SOxFoam/SOxFoam.C index 1069f167f..d139a31af 100644 --- a/applications/solvers/combustion/SOxFoam/SOxFoam.C +++ b/applications/solvers/combustion/SOxFoam/SOxFoam.C @@ -53,8 +53,7 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; - #include "Sso2Calc.H" - mut=rho*nut; + #include "calculateSso2.H" while (simple.correctNonOrthogonal()) { diff --git a/applications/solvers/combustion/SOxFoam/Sso2Calc.H b/applications/solvers/combustion/SOxFoam/Sso2Calc.H deleted file mode 100644 index 286a89652..000000000 --- a/applications/solvers/combustion/SOxFoam/Sso2Calc.H +++ /dev/null @@ -1,11 +0,0 @@ -const scalar Wso2 = 0.064066; //Molecular weight of SO2[kg/mol] -const scalar Ws = 0.032065; // S [kg/mol] - - forAll (mesh.cells(),celli) - { - - Sso2[celli] = (Sfuel1[celli]+Sfuel2[celli])*Ys[celli]*Wso2/Ws/mesh.V()[celli]; - - } - - diff --git a/applications/solvers/combustion/SOxFoam/calculateSso2.H b/applications/solvers/combustion/SOxFoam/calculateSso2.H new file mode 100644 index 000000000..b2d258095 --- /dev/null +++ b/applications/solvers/combustion/SOxFoam/calculateSso2.H @@ -0,0 +1,14 @@ +const scalar Wso2 = 0.064066; // Molecular weight of SO2[kg/mol] +const scalar Ws = 0.032065; // Molecular weight of S [kg/mol] + +forAll (mesh.cells(),celli) +{ + scalar sulfurSource = 0.0; + + forAll (fuelSources, si) + { + sulfurSource += fuelSources[si][celli] * sulfurMassInFuels[si]; + } + + Sso2[celli] = sulfurSource*Wso2/Ws/mesh.V()[celli]; +} diff --git a/applications/solvers/combustion/SOxFoam/createFields.H b/applications/solvers/combustion/SOxFoam/createFields.H index 51680499c..b9c53f281 100644 --- a/applications/solvers/combustion/SOxFoam/createFields.H +++ b/applications/solvers/combustion/SOxFoam/createFields.H @@ -9,7 +9,6 @@ volScalarField rho IOobject::MUST_READ, IOobject::AUTO_WRITE ), - //thermo.rho() mesh ); @@ -62,39 +61,9 @@ volScalarField mut IOobject::NO_READ, IOobject::AUTO_WRITE ), - mesh, - dimensionedScalar("mut",dimensionSet(1,-1,-1,0,0,0,0),0.0) + rho * nut ); - - -//#include "compressibleCreatePhi.H" -// -//mesh.setFluxRequired(p.name()); -// -//dimensionedScalar rhoMax -//( -// dimensionedScalar::lookupOrDefault -// ( -// "rhoMax", -// simple.dict(), -// dimDensity, -// GREAT -// ) -//); -// -//dimensionedScalar rhoMin -//( -// dimensionedScalar::lookupOrDefault -// ( -// "rhoMin", -// simple.dict(), -// dimDensity, -// 0 -// ) -//); - - volScalarField SO2 ( IOobject @@ -119,40 +88,14 @@ volScalarField Sso2 IOobject::AUTO_WRITE ), mesh, - dimensionedScalar("Sso2",dimensionSet(1,-3,-1,0,0,0,0),0.0) + dimensionedScalar("Sso2",dimDensity/dimTime,0.0) ); -volScalarField Sfuel1 +IOdictionary SOxProperties ( IOobject ( - "Sfuel1", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh -); - -volScalarField Sfuel2 -( - IOobject - ( - "Sfuel2", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh -); - -IOdictionary fuelSulfurMassFraction -( - IOobject - ( - "fuelSulfurMassFraction", + "SOxProperties", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, @@ -160,17 +103,28 @@ IOdictionary fuelSulfurMassFraction ) ); -volScalarField Ys -( - IOobject - ( - "Ys", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - mesh, - dimensionedScalar(fuelSulfurMassFraction.lookup("Ys")) -); +wordList fuelSourceNames(SOxProperties.lookup("fuelSourceNames")); +PtrList fuelSources(fuelSourceNames.size()); + +forAll (fuelSources, si) +{ + fuelSources.set + ( + si, + new volScalarField::Internal + ( + IOobject + ( + fuelSourceNames[si], + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ) + ); +} + +scalarField sulfurMassInFuels(SOxProperties.lookup("sulfurMassInFuels"));