diff --git a/applications/solvers/combustion/rhoReactingFoam/Make/files b/applications/solvers/combustion/rhoReactingFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..3a97a48fd60990418bf233232acce5b59a82bbb8 --- /dev/null +++ b/applications/solvers/combustion/rhoReactingFoam/Make/files @@ -0,0 +1,3 @@ +rhoReactingFoam.C + +EXE = $(FOAM_APPBIN)/rhoReactingFoam diff --git a/applications/solvers/combustion/rhoReactingFoam/Make/options b/applications/solvers/combustion/rhoReactingFoam/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..e982f635a14fefba2fa2a03153961be4e1bf8fca --- /dev/null +++ b/applications/solvers/combustion/rhoReactingFoam/Make/options @@ -0,0 +1,19 @@ +EXE_INC = \ + -I../XiFoam \ + -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ + -I$(LIB_SRC)/ODE/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -lcompressibleRASModels \ + -lcompressibleLESModels \ + -lreactionThermophysicalModels \ + -lspecie \ + -lbasicThermophysicalModels \ + -lchemistryModel \ + -lODE \ + -lfiniteVolume diff --git a/applications/solvers/combustion/rhoReactingFoam/YEqn.H b/applications/solvers/combustion/rhoReactingFoam/YEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..cda24ec2f72efc49c797a83bbcbb4ba2be6007b5 --- /dev/null +++ b/applications/solvers/combustion/rhoReactingFoam/YEqn.H @@ -0,0 +1,43 @@ +tmp<fv::convectionScheme<scalar> > mvConvection +( + fv::convectionScheme<scalar>::New + ( + mesh, + fields, + phi, + mesh.divScheme("div(phi,Yi_h)") + ) +); + +{ + label inertIndex = -1; + volScalarField Yt = 0.0*Y[0]; + + for (label i=0; i<Y.size(); i++) + { + if (Y[i].name() != inertSpecie) + { + volScalarField& Yi = Y[i]; + + solve + ( + fvm::ddt(rho, Yi) + + mvConvection->fvmDiv(phi, Yi) + - fvm::laplacian(turbulence->muEff(), Yi) + == + kappa*chemistry.RR(i), + mesh.solver("Yi") + ); + + Yi.max(0.0); + Yt += Yi; + } + else + { + inertIndex = i; + } + } + + Y[inertIndex] = scalar(1) - Yt; + Y[inertIndex].max(0.0); +} diff --git a/applications/solvers/combustion/rhoReactingFoam/chemistry.H b/applications/solvers/combustion/rhoReactingFoam/chemistry.H new file mode 100644 index 0000000000000000000000000000000000000000..d059bd9ed34f1a577175a271ef6e77360bf63bb6 --- /dev/null +++ b/applications/solvers/combustion/rhoReactingFoam/chemistry.H @@ -0,0 +1,24 @@ +{ + Info << "Solving chemistry" << endl; + + chemistry.solve + ( + runTime.value() - runTime.deltaT().value(), + runTime.deltaT().value() + ); + + // turbulent time scale + if (turbulentReaction) + { + volScalarField tk = + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); + volScalarField tc = chemistry.tc(); + + // Chalmers PaSR model + kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); + } + else + { + kappa = 1.0; + } +} diff --git a/applications/solvers/combustion/rhoReactingFoam/createFields.H b/applications/solvers/combustion/rhoReactingFoam/createFields.H new file mode 100644 index 0000000000000000000000000000000000000000..d44b4b9171ef0f8f965b1c4732cb21132600f4d4 --- /dev/null +++ b/applications/solvers/combustion/rhoReactingFoam/createFields.H @@ -0,0 +1,85 @@ +Info<< nl << "Reading thermophysicalProperties" << endl; +autoPtr<rhoChemistryModel> pChemistry +( + rhoChemistryModel::New(mesh) +); +rhoChemistryModel& chemistry = pChemistry(); + +hReactionThermo& thermo = chemistry.thermo(); + +basicMultiComponentMixture& composition = thermo.composition(); +PtrList<volScalarField>& Y = composition.Y(); + +word inertSpecie(thermo.lookup("inertSpecie")); + +volScalarField rho +( + IOobject + ( + "rho", + runTime.timeName(), + mesh + ), + thermo.rho() +); + +Info<< "Reading field U\n" << endl; +volVectorField U +( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh +); + + +volScalarField& p = thermo.p(); +const volScalarField& psi = thermo.psi(); +volScalarField& h = thermo.h(); + + +#include "compressibleCreatePhi.H" + +volScalarField kappa +( + IOobject + ( + "kappa", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("zero", dimless, 0.0) +); + +Info << "Creating turbulence model.\n" << nl; +autoPtr<compressible::turbulenceModel> turbulence +( + compressible::turbulenceModel::New + ( + rho, + U, + phi, + thermo + ) +); + +Info<< "Creating field DpDt\n" << endl; +volScalarField DpDt = + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); + +multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; + +forAll (Y, i) +{ + fields.add(Y[i]); +} +fields.add(h); + diff --git a/applications/solvers/combustion/rhoReactingFoam/pEqn.H b/applications/solvers/combustion/rhoReactingFoam/pEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..a58cd28decb0cf466b393e4dda16144fd2664c54 --- /dev/null +++ b/applications/solvers/combustion/rhoReactingFoam/pEqn.H @@ -0,0 +1,93 @@ +{ + rho = thermo.rho(); + + // Thermodynamic density needs to be updated by psi*d(p) after the + // pressure solution - done in 2 parts. Part 1: + thermo.rho() -= psi*p; + + volScalarField rUA = 1.0/UEqn.A(); + U = rUA*UEqn.H(); + + if (transonic) + { + surfaceScalarField phiv = + (fvc::interpolate(U) & mesh.Sf()) + + fvc::ddtPhiCorr(rUA, rho, U, phi); + + phi = fvc::interpolate(rho)*phiv; + + surfaceScalarField phid + ( + "phid", + fvc::interpolate(thermo.psi())*phiv + ); + + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pEqn + ( + fvc::ddt(rho) + fvc::div(phi) + + correction(fvm::ddt(psi, p) + fvm::div(phid, p)) + - fvm::laplacian(rho*rUA, p) + ); + + if (ocorr == nOuterCorr && corr == nCorr && nonOrth == nNonOrthCorr) + { + pEqn.solve(mesh.solver(p.name() + "Final")); + } + else + { + pEqn.solve(); + } + + if (nonOrth == nNonOrthCorr) + { + phi += pEqn.flux(); + } + } + } + else + { + phi = + fvc::interpolate(rho) + *( + (fvc::interpolate(U) & mesh.Sf()) + + fvc::ddtPhiCorr(rUA, rho, U, phi) + ); + + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pEqn + ( + fvc::ddt(rho) + psi*correction(fvm::ddt(p)) + + fvc::div(phi) + - fvm::laplacian(rho*rUA, p) + ); + + if (ocorr == nOuterCorr && corr == nCorr && nonOrth == nNonOrthCorr) + { + pEqn.solve(mesh.solver(p.name() + "Final")); + } + else + { + pEqn.solve(); + } + + if (nonOrth == nNonOrthCorr) + { + phi += pEqn.flux(); + } + } + } + + // Second part of thermodynamic density update + thermo.rho() += psi*p; + + #include "rhoEqn.H" + #include "compressibleContinuityErrs.H" + + U -= rUA*fvc::grad(p); + U.correctBoundaryConditions(); + + DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); +} diff --git a/applications/solvers/combustion/rhoReactingFoam/readChemistryProperties.H b/applications/solvers/combustion/rhoReactingFoam/readChemistryProperties.H new file mode 100644 index 0000000000000000000000000000000000000000..ab51afe28361cdf65bc74af68961a6732535d6b3 --- /dev/null +++ b/applications/solvers/combustion/rhoReactingFoam/readChemistryProperties.H @@ -0,0 +1,23 @@ +Info<< "Reading chemistry properties\n" << endl; + +IOdictionary chemistryProperties +( + IOobject + ( + "chemistryProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ) +); + +Switch turbulentReaction(chemistryProperties.lookup("turbulentReaction")); + +dimensionedScalar Cmix("Cmix", dimless, 1.0); + +if (turbulentReaction) +{ + chemistryProperties.lookup("Cmix") >> Cmix; +} diff --git a/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C b/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C new file mode 100644 index 0000000000000000000000000000000000000000..16f49a197fe9d5028a1db860bf7bb58ddbf7244c --- /dev/null +++ b/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C @@ -0,0 +1,102 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + rhoReactingFoam + +Description + Chemical reaction code using density based thermodynamics package. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "hReactionThermo.H" +#include "turbulenceModel.H" +#include "rhoChemistryModel.H" +#include "chemistrySolver.H" +#include "multivariateScheme.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readChemistryProperties.H" + #include "readEnvironmentalProperties.H" + #include "createFields.H" + #include "initContinuityErrs.H" + #include "readTimeControls.H" + #include "compressibleCourantNo.H" + #include "setInitialDeltaT.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info << "\nStarting time loop\n" << endl; + + while (runTime.run()) + { + #include "readTimeControls.H" + #include "readPISOControls.H" + #include "compressibleCourantNo.H" + #include "setDeltaT.H" + + runTime++; + Info<< "Time = " << runTime.timeName() << nl << endl; + + #include "chemistry.H" + #include "rhoEqn.H" + #include "UEqn.H" + + for (label ocorr=1; ocorr <= nOuterCorr; ocorr++) + { + #include "YEqn.H" + #include "hEqn.H" + + // --- PISO loop + for (int corr=1; corr<=nCorr; corr++) + { + #include "pEqn.H" + } + } + + turbulence->correct(); + + rho = thermo.rho(); + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H index 3fbe9f63b5dccde3146aa0a98f151bb68f61bdd0..b408709aed902619ce7a316b11d0049a1f0e9948 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H @@ -9,35 +9,10 @@ + parcels.SU() ); - UEqn.relax(); + pZones.addResistance(UEqn); - tmp<volScalarField> trAU; - tmp<volTensorField> trTU; - - if (pressureImplicitPorosity) + if (momentumPredictor) { - tmp<volTensorField> tTU = tensor(I)*UEqn.A(); - pZones.addResistance(UEqn, tTU()); - trTU = inv(tTU()); - trTU().rename("rAU"); - - volVectorField gradp = fvc::grad(p); - - for (int UCorr=0; UCorr<nUCorr; UCorr++) - { - U = trTU() & (UEqn.H() - gradp); - } - U.correctBoundaryConditions(); + solve(UEqn == -fvc::grad(p)); } - else - { - pZones.addResistance(UEqn); - - trAU = 1.0/UEqn.A(); - trAU().rename("rAU"); - solve - ( - UEqn == -fvc::grad(p) - ); - } diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H index 1623b746649eea235a3cdb5a8e45094a26940cd6..e802fdfe0d85929101f5e6723080b6666dfa2fb4 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H @@ -43,5 +43,4 @@ tmp<fv::convectionScheme<scalar> > mvConvection Y[inertIndex] = scalar(1) - Yt; Y[inertIndex].max(0.0); - } diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H index da3cca5a5b935f9b7a0d76d66f03c785fdff8ecd..a3054db0f5853192df84abadd77f6a3e3fed6687 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H @@ -73,13 +73,7 @@ ) ); - Info<< "Creating field DpDt\n" << endl; - volScalarField DpDt - ( - "DpDt", - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) - ); - + Info<< "Creating multi-variate interpolation scheme\n" << endl; multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; forAll (Y, i) diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createPorousZones.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createPorousZones.H index caed85ecba899c76d9f3dcce50d474ef1114e1bf..90506856d2a072cad5ee3b4be584ee0aa42fda81 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createPorousZones.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createPorousZones.H @@ -1,21 +1,3 @@ Info<< "Creating porous zones" << nl << endl; porousZones pZones(mesh); - Switch pressureImplicitPorosity(false); - - label nUCorr = 0; - if (pZones.size()) - { - // nUCorrectors for pressureImplicitPorosity - if (mesh.solutionDict().subDict("PISO").found("nUCorrectors")) - { - mesh.solutionDict().subDict("PISO").lookup("nUCorrectors") - >> nUCorr; - } - - if (nUCorr > 0) - { - pressureImplicitPorosity = true; - } - } - diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hEqn.H index d686e452f46f053c7b52f7b19872f964d9c054ef..6e6b0c763ae85dbde75e0745e8c27b2899598fe3 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hEqn.H @@ -1,20 +1,51 @@ { - fvScalarMatrix hEqn + tmp<volScalarField> pWork ( - fvm::ddt(rho, h) - + mvConvection->fvmDiv(phi, h) - - fvm::laplacian(turbulence->alphaEff(), h) - == - DpDt - + parcels.Sh() - + radiation->Sh(thermo) + new volScalarField + ( + IOobject + ( + "pWork", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("zero", dimensionSet(1, -1, -3, 0, 0), 0.0) + ) ); - hEqn.relax(); + if (dpdt) + { + pWork() += fvc::ddt(p); + } + if (eWork) + { + pWork() = -p*fvc::div(phi/fvc::interpolate(rho)); + } + if (hWork) + { + pWork() += fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p)); + } - hEqn.solve(); + { + solve + ( + fvm::ddt(rho, h) + + mvConvection->fvmDiv(phi, h) + - fvm::laplacian(turbulence->alphaEff(), h) + == + pWork() + + parcels.Sh() + + radiation->Sh(thermo) + ); - thermo.correct(); + thermo.correct(); - radiation->correct(); + radiation->correct(); + + Info<< "T gas min/max = " << min(T).value() << ", " + << max(T).value() << endl; + } } diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H index be4c14c8e5e01ffb045a749b5451e00e59f75ac0..32657588b0f594133d47d0b886a88be1a21907ac 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H @@ -5,65 +5,13 @@ // pressure solution - done in 2 parts. Part 1: thermo.rho() -= psi*p; - if (pressureImplicitPorosity) - { - U = trTU()&UEqn.H(); - } - else - { - U = trAU()*UEqn.H(); - } + volScalarField rAU = 1.0/UEqn.A(); + U = rAU*UEqn.H(); - if (transonic) + if (pZones.size() > 0) { - surfaceScalarField phiv = fvc::interpolate(U) & mesh.Sf(); - - phi = fvc::interpolate(rho)*phiv; - - surfaceScalarField phid("phid", fvc::interpolate(psi)*phiv); - - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) - { - tmp<fvScalarMatrix> lapTerm; - - if (pressureImplicitPorosity) - { - lapTerm = fvm::laplacian(rho*trTU(), p); - } - else - { - lapTerm = fvm::laplacian(rho*trAU(), p); - } - - fvScalarMatrix pEqn - ( - fvc::ddt(rho) + fvc::div(phi) - + correction(psi*fvm::ddt(p) + fvm::div(phid, p)) - - lapTerm() - == - parcels.Srho() - + pointMassSources.Su() - ); - - if - ( - oCorr == nOuterCorr-1 - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - { - pEqn.solve(mesh.solver("pFinal")); - } - else - { - pEqn.solve(); - } - - if (nonOrth == nNonOrthCorr) - { - phi == pEqn.flux(); - } - } + // ddtPhiCorr not well defined for cases with porosity + phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf()); } else { @@ -71,50 +19,34 @@ fvc::interpolate(rho) *( (fvc::interpolate(U) & mesh.Sf()) -// + fvc::ddtPhiCorr(trAU(), rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ); + } - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pEqn + ( + fvc::ddt(rho) + psi*correction(fvm::ddt(p)) + + fvc::div(phi) + - fvm::laplacian(rho*rAU, p) + == + parcels.Srho() + + pointMassSources.Su() + ); + + if (corr == nCorr-1 && nonOrth == nNonOrthCorr) { - tmp<fvScalarMatrix> lapTerm; - - if (pressureImplicitPorosity) - { - lapTerm = fvm::laplacian(rho*trTU(), p); - } - else - { - lapTerm = fvm::laplacian(rho*trAU(), p); - } - - fvScalarMatrix pEqn - ( - fvc::ddt(rho) + psi*correction(fvm::ddt(p)) - + fvc::div(phi) - - lapTerm() - == - parcels.Srho() - + pointMassSources.Su() - ); - - if - ( - oCorr == nOuterCorr-1 - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - { - pEqn.solve(mesh.solver("pFinal")); - } - else - { - pEqn.solve(); - } + pEqn.solve(mesh.solver("pFinal")); + } + else + { + pEqn.solve(); + } - if (nonOrth == nNonOrthCorr) - { - phi += pEqn.flux(); - } + if (nonOrth == nNonOrthCorr) + { + phi += pEqn.flux(); } } @@ -124,15 +56,6 @@ #include "rhoEqn.H" #include "compressibleContinuityErrs.H" - if (pressureImplicitPorosity) - { - U -= trTU()&fvc::grad(p); - } - else - { - U -= trAU()*fvc::grad(p); - } + U -= rAU*fvc::grad(p); U.correctBoundaryConditions(); - - DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); } diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C index c7e4fee7b6d08106bf2e132a49ede475a65cc27d..760627de80fc83d1785dc29ab3956688679c57eb 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C @@ -23,15 +23,16 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Application - trackedReactingParcelFoam + porousExplicitSourceReactingParcelFoam Description - - reacting parcel cloud tracking + - reacting parcel cloud - porous media - point mass sources - polynomial based, incompressible thermodynamics (f(T)) - Note: ddtPhiCorr not used here - not well defined for porous calcs + Note: ddtPhiCorr not used here when porous zones are active + - not well defined for porous calcs \*---------------------------------------------------------------------------*/ @@ -74,6 +75,7 @@ int main(int argc, char *argv[]) { #include "readTimeControls.H" #include "readPISOControls.H" + #include "readAdditionalSolutionControls.H" #include "compressibleCourantNo.H" #include "setDeltaT.H" @@ -88,23 +90,16 @@ int main(int argc, char *argv[]) #include "chemistry.H" #include "rhoEqn.H" #include "UEqn.H" + #include "YEqn.H" + #include "hEqn.H" - // --- PIMPLE loop - for (int oCorr=1; oCorr<=nOuterCorr; oCorr++) + // --- PISO loop + for (int corr=0; corr<nCorr; corr++) { - #include "YEqn.H" - #include "hEqn.H" - - // --- PISO loop - for (int corr=1; corr<=nCorr; corr++) - { - #include "pEqn.H" - } - - Info<< "T gas min/max = " << min(T).value() << ", " - << max(T).value() << endl; + #include "pEqn.H" } + turbulence->correct(); rho = thermo.rho(); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readAdditionalSolutionControls.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readAdditionalSolutionControls.H new file mode 100644 index 0000000000000000000000000000000000000000..8159205caee0a202b8fc1be04130bf4a0b4d5c46 --- /dev/null +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readAdditionalSolutionControls.H @@ -0,0 +1,20 @@ +dictionary additional = mesh.solutionDict().subDict("additional"); + +bool dpdt = true; +if (additional.found("dpdt")) +{ + additional.lookup("dpdt") >> dpdt; +} + +bool eWork = true; +if (additional.found("eWork")) +{ + additional.lookup("eWork") >> eWork; +} + +bool hWork = true; +if (additional.found("hWork")) +{ + additional.lookup("hWork") >> hWork; +} + diff --git a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H index 5ab4ebbecec37c35c8e76d5d1eb5653e0ed13fad..9ac00bd060f7d650f216ad162595af56ca7a31f6 100644 --- a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H +++ b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H @@ -63,17 +63,28 @@ class OutputFilterFunctionObject { // Private data + //- Output filter name word name_; + + //- Reference to the time database const Time& time_; + + //- Input dictionary dictionary dict_; + + //- Name of region word regionName_; + + //- Optional dictionary name to supply required inputs word dictName_; //- Switch for the execution of the functionObject bool enabled_; + //- Output controls outputFilterOutputControl outputControl_; + //- Pointer to the output filter autoPtr<OutputFilter> ptr_; @@ -108,31 +119,78 @@ public: // Member Functions - //- Return name - virtual const word& name() const - { - return name_; - } + // Access + + //- Return name + virtual const word& name() const + { + return name_; + } + + //- Return time database + virtual const Time& time() const + { + return time_; + } + + //- Return the input dictionary + virtual const dictionary& dict() const + { + return dict_; + } + + //- Return the region name + virtual const word& regionName() const + { + return regionName_; + } + + //- Return the optional dictionary name + virtual const word& dictName() const + { + return dictName_; + } + + //- Return the enabled flag + virtual bool enabled() const + { + return enabled_; + } + + //- Return the output control object + virtual const outputFilterOutputControl& outputControl() const + { + return outputControl_; + } + + //- Return the output filter + virtual const OutputFilter& outputFilter() const + { + return ptr_(); + } + + + // Function object control - //- Switch the function object on - virtual void on(); + //- Switch the function object on + virtual void on(); - //- Switch the function object off - virtual void off(); + //- Switch the function object off + virtual void off(); - //- Called at the start of the time-loop - virtual bool start(); + //- Called at the start of the time-loop + virtual bool start(); - //- Called at each ++ or += of the time-loop - virtual bool execute(); + //- Called at each ++ or += of the time-loop + virtual bool execute(); - //- Called when Time::run() determines that the time-loop exits - virtual bool end(); + //- Called when Time::run() determines that the time-loop exits + virtual bool end(); - //- Read and set the function object if its data have changed - virtual bool read(const dictionary&); + //- Read and set the function object if its data have changed + virtual bool read(const dictionary&); }; diff --git a/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.C b/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.C index a4d249d265fe3f5fff3b62957e0a69eec4bd910c..0f274d70bf338b8e8a45ac0ee056b439b294be16 100644 --- a/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.C +++ b/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.H b/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.H index d4d6c2bc94d997ade9ef37fab7b48c837bfc30f8..8516508d8b317ea68a462d4bc3832fd05e0a5b43 100644 --- a/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.H +++ b/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/coalCombustion/CoalParcel/CoalParcel.C b/src/lagrangian/coalCombustion/CoalParcel/CoalParcel.C index 53a9f3ac63461372f31361e80c7c6a3bb0228c6a..ef3448186a61717ac365df1033601c42427dde6c 100644 --- a/src/lagrangian/coalCombustion/CoalParcel/CoalParcel.C +++ b/src/lagrangian/coalCombustion/CoalParcel/CoalParcel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/coalCombustion/CoalParcel/CoalParcel.H b/src/lagrangian/coalCombustion/CoalParcel/CoalParcel.H index a23e96bb852fcc7b85c38f49f054db309b001f87..f313a16501e71aea51a8418db090d7ba91e75f92 100644 --- a/src/lagrangian/coalCombustion/CoalParcel/CoalParcel.H +++ b/src/lagrangian/coalCombustion/CoalParcel/CoalParcel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/coalCombustion/CoalParcel/defineCoalParcel.C b/src/lagrangian/coalCombustion/CoalParcel/defineCoalParcel.C index f5071d60305ef366ef1ceebebf789281fbf9eae9..204568acb15df7d4533112aa6bd08345d022823f 100644 --- a/src/lagrangian/coalCombustion/CoalParcel/defineCoalParcel.C +++ b/src/lagrangian/coalCombustion/CoalParcel/defineCoalParcel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C index 10cec60dd27e5fc331d97c7c49428e6399bad2a9..23aa3dc47823a780110e71326cdab70b9cb066db 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C @@ -299,7 +299,7 @@ void Foam::DsmcCloud<ParcelType>::collisions() // Temporary storage for subCells List<DynamicList<label> > subCells(8); - scalar deltaT = mesh_.time().deltaT().value(); + scalar deltaT = cachedDeltaT(); label collisionCandidates = 0; @@ -778,6 +778,9 @@ Foam::DsmcCloud<ParcelType>::~DsmcCloud() template<class ParcelType> void Foam::DsmcCloud<ParcelType>::evolve() { + // cache the value of deltaT for this timestep + storeDeltaT(); + typename ParcelType::trackData td(*this); // Reset the surface data collection fields diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H index fc5cf53d683be6ed9ec879578887f59c70d53718..76b1dd7e79046022dd7869178c84dbc612211abf 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H @@ -116,6 +116,10 @@ class DsmcCloud //- Random number generator Random rndGen_; + //- In-cloud cache of deltaT, lookup in submodels and parcel is + // expensive + scalar cachedDeltaT_; + // References to the macroscopic fields @@ -243,6 +247,12 @@ public: //- Return refernce to the random object inline Random& rndGen(); + //- Store (cache) the current value of deltaT + inline void storeDeltaT(); + + //- Return the cached value of deltaT + inline scalar cachedDeltaT() const; + // References to the surface data collection fields diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H index 449650c0a8345d1fc3f14289eb39b4a27eb84521..3529702fdd6b5591a6c588a0890b0a417dbcae2d 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H @@ -120,6 +120,20 @@ inline Foam::Random& Foam::DsmcCloud<ParcelType>::rndGen() } +template<class ParcelType> +inline void Foam::DsmcCloud<ParcelType>::storeDeltaT() +{ + cachedDeltaT_ = mesh().time().deltaT().value(); +} + + +template<class ParcelType> +inline Foam::scalar Foam::DsmcCloud<ParcelType>::cachedDeltaT() const +{ + return cachedDeltaT_; +} + + template<class ParcelType> inline const Foam::volScalarField& Foam::DsmcCloud<ParcelType>::q() const { diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C index fae05b0f2ffc2543046d449aef0dd2bcb7352de7..c52d92d20fef43858cfdd7075883003e6a043b76 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C @@ -44,7 +44,7 @@ bool Foam::DsmcParcel<ParcelType>::move const polyMesh& mesh = td.cloud().pMesh(); const polyBoundaryMesh& pbMesh = mesh.boundaryMesh(); - const scalar deltaT = mesh.time().deltaT().value(); + const scalar deltaT = td.cloud().cachedDeltaT(); scalar tEnd = (1.0 - p.stepFraction())*deltaT; const scalar dtMax = tEnd; @@ -145,7 +145,7 @@ void Foam::DsmcParcel<ParcelType>::hitWallPatch const scalar fA = mag(wpp.faceAreas()[wppLocalFace]); - const scalar deltaT = td.cloud().mesh().time().deltaT().value(); + const scalar deltaT = td.cloud().cachedDeltaT(); scalar deltaQ = td.cloud().nParticle()*(preIE - postIE)/(deltaT*fA); diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C index 807337d7e01a6c734f5ac040db3a7acefad348ef..0f0e135e4c9ab1042852cd547c000c9a00c2ae3c 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C @@ -126,7 +126,7 @@ void Foam::FreeStream<CloudType>::inflow() const polyMesh& mesh(cloud.mesh()); - const scalar deltaT = mesh.time().deltaT().value(); + const scalar deltaT = cloud.cachedDeltaT(); Random& rndGen(cloud.rndGen()); diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C index e2dd07acf1ea8106931ed523afe68fece1e24bce..e473102c1a9084fd87e0794aa55d843c80604432 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C @@ -177,6 +177,7 @@ template<class ParcelType> void Foam::KinematicCloud<ParcelType>::preEvolve() { this->dispersion().cacheFields(true); + forces_.cacheFields(true); } @@ -189,6 +190,7 @@ void Foam::KinematicCloud<ParcelType>::postEvolve() } this->dispersion().cacheFields(false); + forces_.cacheFields(false); this->postProcessing().post(); } diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H index 077067a97221fa51a0257501ea994d8195f878d9..ee2b3bafe2c2329048734b33fcd99d6154316a83 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H @@ -274,18 +274,6 @@ public: inline const dictionary& interpolationSchemes() const; - // Forces to include in particle motion evaluation - - //- Return reference to the gravity force flag - inline Switch forceGravity() const; - - //- Return reference to the virtual mass force flag - inline Switch forceVirtualMass() const; - - //- Return reference to the pressure gradient force flag - inline Switch forcePressureGradient() const; - - // Sub-models //- Return const-access to the dispersion model diff --git a/src/lagrangian/intermediate/particleForces/particleForces.C b/src/lagrangian/intermediate/particleForces/particleForces.C index d81ebadefcbdc5cf8cf0b4285540e7038baa6dd7..5320566c84382e91f744263062c1e2c7b493dd3f 100644 --- a/src/lagrangian/intermediate/particleForces/particleForces.C +++ b/src/lagrangian/intermediate/particleForces/particleForces.C @@ -27,6 +27,7 @@ License #include "particleForces.H" #include "fvMesh.H" #include "volFields.H" +#include "fvcGrad.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -40,21 +41,17 @@ Foam::particleForces::particleForces mesh_(mesh), dict_(dict.subDict("particleForces")), g_(g), + gradUPtr_(NULL), gravity_(dict_.lookup("gravity")), virtualMass_(dict_.lookup("virtualMass")), Cvm_(0.0), pressureGradient_(dict_.lookup("pressureGradient")), - gradUName_("unknown_gradUName") + UName_(dict_.lookupOrDefault<word>("U", "U")) { - if (gravity_) + if (virtualMass_) { dict_.lookup("Cvm") >> Cvm_; } - - if (pressureGradient_) - { - dict_.lookup("gradU") >> gradUName_; - } } @@ -63,18 +60,21 @@ Foam::particleForces::particleForces(const particleForces& f) mesh_(f.mesh_), dict_(f.dict_), g_(f.g_), + gradUPtr_(f.gradUPtr_), gravity_(f.gravity_), virtualMass_(f.virtualMass_), Cvm_(f.Cvm_), pressureGradient_(f.pressureGradient_), - gradUName_(f.gradUName_) + UName_(f.UName_) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::particleForces::~particleForces() -{} +{ + cacheFields(false); +} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // @@ -109,9 +109,26 @@ Foam::Switch Foam::particleForces::pressureGradient() const } -const Foam::word& Foam::particleForces::gradUName() const +const Foam::word& Foam::particleForces::UName() const { - return gradUName_; + return UName_; +} + + +void Foam::particleForces::cacheFields(const bool store) +{ + if (store && pressureGradient_) + { + const volVectorField U = mesh_.lookupObject<volVectorField>(UName_); + gradUPtr_ = fvc::grad(U).ptr(); + } + else + { + if (gradUPtr_) + { + delete gradUPtr_; + } + } } @@ -130,15 +147,17 @@ Foam::vector Foam::particleForces::calcCoupled // Virtual mass force if (virtualMass_) { - notImplemented("Foam::particleForces::calc(...) - virtualMass force"); + notImplemented + ( + "Foam::particleForces::calcCoupled(...) - virtual mass force" + ); // Ftot += Cvm_*rhoc/rho*d(Uc - U)/dt; } // Pressure gradient force if (pressureGradient_) { - const volSymmTensorField& gradU = - mesh_.lookupObject<volSymmTensorField>(gradUName_); + const volTensorField& gradU = *gradUPtr_; Ftot += rhoc/rho*(U & gradU[cellI]); } diff --git a/src/lagrangian/intermediate/particleForces/particleForces.H b/src/lagrangian/intermediate/particleForces/particleForces.H index aab27da4653faa4fa950f2c4463f69e6896271b8..fbe88a6dc832e7fd545a1a673aaf2dce90178a23 100644 --- a/src/lagrangian/intermediate/particleForces/particleForces.H +++ b/src/lagrangian/intermediate/particleForces/particleForces.H @@ -39,6 +39,7 @@ SourceFiles #include "dictionary.H" #include "Switch.H" #include "vector.H" +#include "volFieldsFwd.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -65,6 +66,9 @@ class particleForces //- Gravity const vector g_; + //- Velocity gradient field + const volTensorField* gradUPtr_; + // Forces to include in particle motion evaluation @@ -80,8 +84,11 @@ class particleForces //- Pressure gradient Switch pressureGradient_; - //- Name of velocity gradient field for pressure gradient force - word gradUName_; + + // Additional info + + //- Name of velucity field - default = "U" + const word UName_; public: @@ -126,12 +133,15 @@ public: //- Return pressure gradient force activate switch Switch pressureGradient() const; - //- Return the name of the velocity gradient field - const word& gradUName() const; + //- Return name of velocity field + const word& UName() const; // Evaluation + //- Cache carrier fields + void cacheFields(const bool store); + //- Calculate action/reaction forces between carrier and particles vector calcCoupled ( diff --git a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C index b747373e3a71e2682a01f0cb335262bc916ce8dc..113fb829421dc6bc1591701c4a54c4e4cd3f05d5 100644 --- a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C +++ b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C @@ -507,7 +507,7 @@ void Foam::moleculeCloud::initialiseMolecules else { const dictionary& zoneDict = - mdInitialiseDict.subDict(zone.name()); + mdInitialiseDict.subDict(zone.name()); const scalar temperature ( @@ -530,7 +530,7 @@ void Foam::moleculeCloud::initialiseMolecules { FatalErrorIn("Foam::moleculeCloud::initialiseMolecules") << "latticeIds and latticePositions must be the same " - << " size." << nl + << " size." << nl << abort(FatalError); } @@ -548,6 +548,15 @@ void Foam::moleculeCloud::initialiseMolecules zoneDict.lookup("numberDensity") ); + if (numberDensity < VSMALL) + { + WarningIn("moleculeCloud::initialiseMolecules") + << "numberDensity too small, not filling zone " + << zone.name() << endl; + + continue; + } + latticeCellScale = pow ( latticeIds.size()/(det(latticeCellShape)*numberDensity), @@ -572,9 +581,19 @@ void Foam::moleculeCloud::initialiseMolecules zoneDict.lookup("massDensity") ); + if (massDensity < VSMALL) + { + WarningIn("moleculeCloud::initialiseMolecules") + << "massDensity too small, not filling zone " + << zone.name() << endl; + + continue; + } + + latticeCellScale = pow ( - unitCellMass /(det(latticeCellShape)*massDensity), + unitCellMass/(det(latticeCellShape)*massDensity), (1.0/3.0) ); } @@ -906,7 +925,7 @@ void Foam::moleculeCloud::initialiseMolecules ) { WarningIn("Foam::moleculeCloud::initialiseMolecules()") - << "A whole layer of unit cells was placed " + << "A whole layer of unit cells was placed " << "outside the bounds of the mesh, but no " << "molecules have been placed in zone '" << zone.name() diff --git a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.C b/src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.C index f8678015f0ebe1db02f786bb81138a41db813642..b746987f3c17ed9ad2789622cc0ea2c56c29fd0b 100644 --- a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.C +++ b/src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.C @@ -127,11 +127,11 @@ void Foam::staticPressure::write() { const volScalarField& p = obr_.lookupObject<volScalarField>(pName_); - volScalarField pDyn + volScalarField pStatic ( IOobject ( - "pDyn", + "pStatic", obr_.time().timeName(), obr_, IOobject::NO_READ @@ -139,7 +139,7 @@ void Foam::staticPressure::write() dimensionedScalar("rho", dimDensity, rho_)*p ); - pDyn.write(); + pStatic.write(); } } diff --git a/src/postProcessing/functionObjects/zones/Make/files b/src/postProcessing/functionObjects/zones/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..90e33f75241df48dde2b4749d723aff3fc660b82 --- /dev/null +++ b/src/postProcessing/functionObjects/zones/Make/files @@ -0,0 +1,4 @@ +faceZoneIntegration/faceZonesIntegration.C +faceZoneIntegration/faceZonesIntegrationFunctionObject.C + +LIB = $(FOAM_LIBBIN)/libzoneFunctionObjects diff --git a/src/postProcessing/functionObjects/zones/Make/options b/src/postProcessing/functionObjects/zones/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..5166bcc9e32f547f48a5f87c9c60d7210409967f --- /dev/null +++ b/src/postProcessing/functionObjects/zones/Make/options @@ -0,0 +1,9 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude + +LIB_LIBS = \ + -lfiniteVolume \ + -lmeshTools \ + -lsampling diff --git a/src/postProcessing/functionObjects/zones/faceZoneIntegration/IOfaceZonesIntegration.H b/src/postProcessing/functionObjects/zones/faceZoneIntegration/IOfaceZonesIntegration.H new file mode 100644 index 0000000000000000000000000000000000000000..ef1ecbf0043aa34d098f0f2db829ee69e9c955fe --- /dev/null +++ b/src/postProcessing/functionObjects/zones/faceZoneIntegration/IOfaceZonesIntegration.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Typedef + Foam::IOfaceZonesIntegration + +Description + Instance of the generic IOOutputFilter for faceZonesIntegration. + +\*---------------------------------------------------------------------------*/ + +#ifndef IOfaceZonesIntegration_H +#define IOfaceZonesIntegration_H + +#include "faceZonesIntegration.H" +#include "IOOutputFilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef IOOutputFilter<faceZonesIntegration> IOfaceZonesIntegration; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegration.C b/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegration.C new file mode 100644 index 0000000000000000000000000000000000000000..0b8314667c728839bc11e72eddc2149e94026fdd --- /dev/null +++ b/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegration.C @@ -0,0 +1,322 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "faceZonesIntegration.H" +#include "volFields.H" +#include "dictionary.H" +#include "Time.H" +#include "IOmanip.H" +#include "ListListOps.H" +#include "processorPolyPatch.H" +#include "cyclicPolyPatch.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(faceZonesIntegration, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::faceZonesIntegration::faceZonesIntegration +( + const word& name, + const objectRegistry& obr, + const dictionary& dict, + const bool loadFromFiles +) +: + name_(name), + obr_(obr), + active_(true), + log_(false), + faceZonesSet_(), + fItems_(), + faceZonesIntegrationFilePtr_(NULL) +{ + // Check if the available mesh is an fvMesh otherise deactivate + if (!isA<fvMesh>(obr_)) + { + active_ = false; + WarningIn + ( + "Foam::faceZonesIntegration::faceZonesIntegration" + "(" + "const word&, " + "const objectRegistry&, " + "const dictionary&, " + "const bool" + ")" + ) << "No fvMesh available, deactivating." + << endl; + } + + read(dict); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::faceZonesIntegration::~faceZonesIntegration() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::faceZonesIntegration::read(const dictionary& dict) +{ + if (active_) + { + log_ = dict.lookupOrDefault<Switch>("log", false); + + dict.lookup("fields") >> fItems_; + + dict.lookup("faceZones") >> faceZonesSet_; + } +} + + +void Foam::faceZonesIntegration::makeFile() +{ + // Create the face Zone file if not already created + if (faceZonesIntegrationFilePtr_.empty()) + { + if (debug) + { + Info<< "Creating faceZonesIntegration file." << endl; + } + + // File update + if (Pstream::master()) + { + fileName faceZonesIntegrationDir; + if (Pstream::parRun()) + { + // Put in undecomposed case (Note: gives problems for + // distributed data running) + faceZonesIntegrationDir = + obr_.time().path()/".."/name_/obr_.time().timeName(); + } + else + { + faceZonesIntegrationDir = + obr_.time().path()/name_/obr_.time().timeName(); + } + + // Create directory if does not exist. + mkDir(faceZonesIntegrationDir); + + // Open new file at start up + faceZonesIntegrationFilePtr_.resize(fItems_.size()); + + forAll(fItems_, Ifields) + { + const word& fieldName = fItems_[Ifields]; + + OFstream* sPtr = new OFstream + ( + faceZonesIntegrationDir/fieldName + ); + + faceZonesIntegrationFilePtr_.insert(fieldName, sPtr); + } + + // Add headers to output data + writeFileHeader(); + } + } +} + + +void Foam::faceZonesIntegration::writeFileHeader() +{ + forAllIter(HashPtrTable<OFstream>, faceZonesIntegrationFilePtr_, iter) + { + unsigned int w = IOstream::defaultPrecision() + 7; + + OFstream& os = *faceZonesIntegrationFilePtr_[iter.key()]; + + os << "#Time " << setw(w); + + forAll (faceZonesSet_, zoneI) + { + const word name = faceZonesSet_[zoneI]; + os << name << setw(w); + } + + os << nl << endl; + } +} + + +void Foam::faceZonesIntegration::execute() +{ + // Do nothing - only valid on write +} + + +void Foam::faceZonesIntegration::end() +{ + // Do nothing - only valid on write +} + + +void Foam::faceZonesIntegration::write() +{ + if (active_) + { + makeFile(); + scalar dm = 0.0; + forAll(fItems_, fieldI) + { + const word& fieldName = fItems_[fieldI]; + + const surfaceScalarField& fD = + obr_.lookupObject<surfaceScalarField>(fieldName); + + const fvMesh& mesh = fD.mesh(); + + unsigned int w = IOstream::defaultPrecision() + 7; + + if + ( + Pstream::master() + && faceZonesIntegrationFilePtr_.found(fieldName) + ) + { + OFstream& os = *faceZonesIntegrationFilePtr_(fieldName); + + os << obr_.time().value(); + + const faceZoneMesh& faceZoneList = mesh.faceZones(); + + forAll(faceZonesSet_, zoneI) + { + const word name = faceZonesSet_[zoneI]; + + label zoneID = faceZoneList.findZoneID(name); + + const faceZone& fz = mesh.faceZones()[zoneID]; + + dm = calcFaceZonesIntegral(fD, fz); + + reduce(dm, sumOp<scalar>()); + + os << ' ' << setw(w) << dm; + + if (log_) + { + Info<< "faceZonesIntegration output:" << nl + << " Integration" << dm << endl; + } + } + + os << endl; + } + } + } +} + + +Foam::scalar Foam::faceZonesIntegration::calcFaceZonesIntegral +( + const surfaceScalarField& fD, + const faceZone& fz +) const +{ + scalar dm = 0.0; + const fvMesh& mesh = fD.mesh(); + + forAll (fz, i) + { + label faceI = fz[i]; + + if (mesh.isInternalFace(faceI)) + { + if (fz.flipMap()[faceI]) + { + dm -= fD[faceI]; + } + else + { + dm += fD[faceI]; + } + } + else + { + label patchI = mesh.boundaryMesh().whichPatch(faceI); + const polyPatch& pp = mesh.boundaryMesh()[patchI]; + if (isA<processorPolyPatch>(pp)) + { + if (refCast<const processorPolyPatch>(pp).owner()) + { + if (fz.flipMap()[faceI]) + { + dm -= fD.boundaryField()[patchI][pp.whichFace(faceI)]; + } + else + { + dm += fD.boundaryField()[patchI][pp.whichFace(faceI)]; + } + } + } + else if (isA<cyclicPolyPatch>(pp)) + { + label patchFaceI = faceI - pp.start(); + if (patchFaceI < pp.size()/2) + { + if (fz.flipMap()[patchFaceI]) + { + dm -= fD.boundaryField()[patchI][patchFaceI]; + } + else + { + dm += fD.boundaryField()[patchI][patchFaceI]; + } + } + } + else if (!isA<emptyPolyPatch>(pp)) + { + label patchFaceI = faceI - pp.start(); + if (fz.flipMap()[patchFaceI]) + { + dm -= fD.boundaryField()[patchI][patchFaceI]; + } + else + { + dm += fD.boundaryField()[patchI][patchFaceI]; + } + } + } + } + + return dm; +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegration.H b/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegration.H new file mode 100644 index 0000000000000000000000000000000000000000..5fc957bba739954dcf3181cd03d5a7f654e6609f --- /dev/null +++ b/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegration.H @@ -0,0 +1,178 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::faceZonesIntegration + +Description + Integrates surfaceScalarFields on faceZones + +SourceFiles + faceZonesIntegration.C + IOfaceZonesIntegration.H + +\*---------------------------------------------------------------------------*/ + +#ifndef faceZonesIntegration_H +#define faceZonesIntegration_H + +#include "fvCFD.H" +#include "primitiveFieldsFwd.H" +#include "volFieldsFwd.H" +#include "HashPtrTable.H" +#include "OFstream.H" +#include "Switch.H" +#include "pointFieldFwd.H" +#include "polyMesh.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class objectRegistry; +class dictionary; +class mapPolyMesh; + +/*---------------------------------------------------------------------------*\ + Class faceZonesIntegration Declaration +\*---------------------------------------------------------------------------*/ + +class faceZonesIntegration +{ + +protected: + + // Private data + + //- Name of this set of face zone integration, + // Also used as the name of the probes directory. + word name_; + + const objectRegistry& obr_; + + //- on/off switch + bool active_; + + //- Switch to send output to Info as well as to file + Switch log_; + + //- Current open files + HashPtrTable<OFstream> faceZonesIntegrationFilePtr_; + + // Read from dictionary + + //- faceZones to integrate over + wordList faceZonesSet_; + + //- Names of the surface fields + wordList fItems_; + + + // Private Member Functions + + //- If the integration file has not been created create it + void makeFile(); + + scalar calcFaceZonesIntegral + ( + const surfaceScalarField& fD, + const faceZone& fz + ) const; + + + //- Disallow default bitwise copy construct + faceZonesIntegration(const faceZonesIntegration&); + + //- Disallow default bitwise assignment + void operator=(const faceZonesIntegration&); + + //- Output file header information + virtual void writeFileHeader(); + + +public: + + //- Runtime type information + TypeName("faceZonesIntegration"); + + + // Constructors + + //- Construct for given objectRegistry and dictionary. + // Allow the possibility to load fields from files + faceZonesIntegration + ( + const word& name, + const objectRegistry&, + const dictionary&, + const bool loadFromFiles = false + ); + + + // Destructor + + virtual ~faceZonesIntegration(); + + + // Member Functions + + //- Return name of the set of zones + virtual const word& name() const + { + return name_; + }; + + //- Read the zone integration data + virtual void read(const dictionary&); + + //- Execute, currently does nothing + virtual void execute(); + + //- Execute at the final time-loop, currently does nothing + virtual void end(); + + //- Write the integration + virtual void write(); + + //- Update for changes of mesh + virtual void updateMesh(const mapPolyMesh&) + {} + + //- Update for changes of mesh + virtual void movePoints(const pointField&) + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegrationFunctionObject.C b/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegrationFunctionObject.C new file mode 100644 index 0000000000000000000000000000000000000000..43665119b14aeedf9056ead1a814e32f8518e3cb --- /dev/null +++ b/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegrationFunctionObject.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "faceZonesIntegrationFunctionObject.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineNamedTemplateTypeNameAndDebug(faceZonesIntegrationFunctionObject, 0); + + addToRunTimeSelectionTable + ( + functionObject, + faceZonesIntegrationFunctionObject, + dictionary + ); +} + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegrationFunctionObject.H b/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegrationFunctionObject.H new file mode 100644 index 0000000000000000000000000000000000000000..2cc95e2af21eb19a1e890207447fdfdfa76d47d3 --- /dev/null +++ b/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegrationFunctionObject.H @@ -0,0 +1,55 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Typedef + Foam::faceZonesIntegrationFunctionObject + +Description + FunctionObject wrapper around faceZonesIntegration to allow them to be + created via the functions list within controlDict. + +SourceFiles + faceZonesIntegrationFunctionObject.C + +\*---------------------------------------------------------------------------*/ + +#ifndef faceZonesIntegrationFunctionObject_H +#define faceZonesIntegrationFunctionObject_H + +#include "faceZonesIntegration.H" +#include "OutputFilterFunctionObject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef OutputFilterFunctionObject<faceZonesIntegration> + faceZonesIntegrationFunctionObject; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/sampling/probes/probes.H b/src/sampling/probes/probes.H index 33e4f39e25056cda02b95f87a2fa8ae676ad5869..11a7f581c16215cc4f7fe448163c368af9240c7c 100644 --- a/src/sampling/probes/probes.H +++ b/src/sampling/probes/probes.H @@ -175,9 +175,8 @@ public: ); - // Destructor - - virtual ~probes(); + //- Destructor + virtual ~probes(); // Member Functions @@ -188,6 +187,18 @@ public: return name_; } + //- Return names of fields to probe + virtual const wordList& fieldNames() const + { + return fieldNames_; + } + + //- Return locations to probe + virtual const vectorField& probeLocations() const + { + return probeLocations_; + } + //- Cells to be probed (obtained from the locations) const labelList& cells() const { diff --git a/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C b/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C index 72852bdb80cad7d9d3891f0e696fcf85f7a3dc9c..9cfc15a8692efc66e73819802bb8a2002b8a4283 100644 --- a/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C +++ b/src/thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C @@ -34,7 +34,6 @@ const Foam::scalar Foam::liquidMixture::TrMax = 0.999; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::liquidMixture::liquidMixture ( const dictionary& thermophysicalProperties @@ -72,6 +71,7 @@ Foam::liquidMixture::liquidMixture } } + // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // Foam::autoPtr<Foam::liquidMixture> Foam::liquidMixture::New @@ -85,7 +85,6 @@ Foam::autoPtr<Foam::liquidMixture> Foam::liquidMixture::New // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -// Critical Temperature Foam::scalar Foam::liquidMixture::Tc ( const scalarField& x @@ -104,9 +103,8 @@ Foam::scalar Foam::liquidMixture::Tc return vTc/vc; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Pseudocritical temperature + Foam::scalar Foam::liquidMixture::Tpc ( const scalarField& x @@ -121,9 +119,7 @@ Foam::scalar Foam::liquidMixture::Tpc return Tpc; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Pseudocritical pressure Foam::scalar Foam::liquidMixture::Ppc ( const scalarField& x @@ -140,7 +136,6 @@ Foam::scalar Foam::liquidMixture::Ppc return specie::RR*Zc*Tpc(x)/Vc; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Foam::scalar Foam::liquidMixture::omega ( @@ -156,7 +151,6 @@ Foam::scalar Foam::liquidMixture::omega return omega; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Foam::scalarField Foam::liquidMixture::Xs ( @@ -178,9 +172,6 @@ Foam::scalarField Foam::liquidMixture::Xs return xs; } -//----------------------------------------------------------------------------- -// Physical properties -//----------------------------------------------------------------------------- Foam::scalar Foam::liquidMixture::W ( @@ -196,6 +187,7 @@ Foam::scalar Foam::liquidMixture::W return W; } + Foam::scalarField Foam::liquidMixture::Y ( const scalarField& X @@ -211,6 +203,7 @@ Foam::scalarField Foam::liquidMixture::Y return Y; } + Foam::scalarField Foam::liquidMixture::X ( const scalarField& Y @@ -250,6 +243,7 @@ Foam::scalar Foam::liquidMixture::rho return W(x)/v; } + Foam::scalar Foam::liquidMixture::pv ( const scalar p, @@ -271,6 +265,7 @@ Foam::scalar Foam::liquidMixture::pv return pv/W(x); } + Foam::scalar Foam::liquidMixture::hl ( const scalar p, @@ -292,6 +287,7 @@ Foam::scalar Foam::liquidMixture::hl return hl/W(x); } + Foam::scalar Foam::liquidMixture::cp ( const scalar p, @@ -313,6 +309,7 @@ Foam::scalar Foam::liquidMixture::cp return cp/W(x); } + Foam::scalar Foam::liquidMixture::sigma ( const scalar p, @@ -346,6 +343,7 @@ Foam::scalar Foam::liquidMixture::sigma return sigma; } + Foam::scalar Foam::liquidMixture::mu ( const scalar p, @@ -367,6 +365,7 @@ Foam::scalar Foam::liquidMixture::mu return exp(mu); } + Foam::scalar Foam::liquidMixture::K ( const scalar p, @@ -402,7 +401,12 @@ Foam::scalar Foam::liquidMixture::K { scalar Tj = min(TrMax*properties_[j].Tc(), T); - scalar Kij = 2.0/(1.0/properties_[i].K(p, Ti) + 1.0/properties_[j].K(p, Tj)); + scalar Kij = + 2.0 + /( + 1.0/properties_[i].K(p, Ti) + + 1.0/properties_[j].K(p, Tj) + ); K += phii[i]*phii[j]*Kij; } } @@ -410,6 +414,7 @@ Foam::scalar Foam::liquidMixture::K return K; } + Foam::scalar Foam::liquidMixture::D ( const scalar p, @@ -432,4 +437,5 @@ Foam::scalar Foam::liquidMixture::D return 1.0/Dinv; } + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/Ar/Ar.C b/src/thermophysicalModels/liquids/Ar/Ar.C index 7bd5bc451618118ca02c0e519e1fa3e0a754e598..901a6ea6dadfbd353aa05443534522d4e86bf652 100644 --- a/src/thermophysicalModels/liquids/Ar/Ar.C +++ b/src/thermophysicalModels/liquids/Ar/Ar.C @@ -27,19 +27,117 @@ License #include "Ar.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(Ar, 0); + addToRunTimeSelectionTable(liquid, Ar,); + addToRunTimeSelectionTable(liquid, Ar, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTypeNameAndDebug(Ar, 0); -addToRunTimeSelectionTable(liquid, Ar,); -addToRunTimeSelectionTable(liquid, Ar, Istream); +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::Ar::Ar() +: + liquid + ( + 39.948, + 150.86, + 4.8981e+6, + 0.07459, + 0.291, + 83.78, + 6.88e+4, + 87.28, + 0.0, + 0.0, + 1.4138e+4 + ), + rho_(151.922244, 0.286, 150.86, 0.2984), + pv_(39.233, -1051.7, -3.5895, 5.0444e-05, 2), + hl_(150.86, 218509.061780314, 0.352, 0.0, 0.0, 0.0), + cp_(4562.43116050866, -70.7770101131471, 0.367477721037349, 0.0, 0.0, 0.0), + h_ + ( + -1460974.49982473, + 4562.43116050866, + -35.3885050565735, + 0.122492573679116, + 0.0, + 0.0 + ), + cpg_(520.326424351657, 0.0, 0.0, 0.0, 0.0, 0.0), + B_ + ( + 0.000952488234705117, + -0.379993992189847, + -2022.62941824372, + 4633523580654.85, + -302893761890458.0 + ), + mu_(-8.868, 204.3, -0.3831, -1.3e-22, 10.0), + mug_(8.386e-07, 0.6175, 75.377, -432.5), + K_(0.1819, -0.0003176, -4.11e-06, 0.0, 0.0, 0.0), + Kg_(0.0001236, 0.8262, -132.8, 16000), + sigma_(150.86, 0.03823, 1.2927, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 39.948, 28) // note: Same as nHeptane +{} + + +Foam::Ar::Ar +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc0& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} + -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::Ar::Ar(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/Ar/Ar.H b/src/thermophysicalModels/liquids/Ar/Ar.H index 63d873d9ebc18ca06bc639dc65c2358f4772fc2e..39e8f0f960a4422bdb9047c6dcaf3e6d49fba759 100644 --- a/src/thermophysicalModels/liquids/Ar/Ar.H +++ b/src/thermophysicalModels/liquids/Ar/Ar.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - Ar() - : - liquid(39.948, 150.86, 4.8981e+6, 0.07459, 0.291, 83.78, 6.88e+4, 87.28, 0.0, 0.0, 1.4138e+4), - rho_(151.922244, 0.286, 150.86, 0.2984), - pv_(39.233, -1051.7, -3.5895, 5.0444e-05, 2), - hl_(150.86, 218509.061780314, 0.352, 0, 0, 0), - cp_(4562.43116050866, -70.7770101131471, 0.367477721037349, 0, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-1460974.49982473, 4562.43116050866, -35.3885050565735, 0.122492573679116, 0, 0), - cpg_(520.326424351657, 0, 0, 0, 0, 0), - B_(0.000952488234705117, -0.379993992189847, -2022.62941824372, 4633523580654.85, -302893761890458.0), - mu_(-8.868, 204.3, -0.3831, -1.3e-22, 10), - mug_(8.386e-07, 0.6175, 75.377, -432.5), - K_(0.1819, -0.0003176, -4.11e-06, 0, 0, 0), - Kg_(0.0001236, 0.8262, -132.8, 16000), - sigma_(150.86, 0.03823, 1.2927, 0, 0, 0), - D_(147.18, 20.1, 39.948, 28) // NN: Same as nHeptane - {} + Ar(); + + //- Construct from components Ar ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - Ar(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + Ar(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const Ar& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "ArI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/Ar/ArI.H b/src/thermophysicalModels/liquids/Ar/ArI.H new file mode 100644 index 0000000000000000000000000000000000000000..72ba64c1a832aef42cfba29faa1d0fd391d410a4 --- /dev/null +++ b/src/thermophysicalModels/liquids/Ar/ArI.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::Ar::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::Ar::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::Ar::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::Ar::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::Ar::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::Ar::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::Ar::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::Ar::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::Ar::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::Ar::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::Ar::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::Ar::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::Ar::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C10H22/C10H22.C b/src/thermophysicalModels/liquids/C10H22/C10H22.C index d1148a21aee1c8c6edd73540d89a7251b08f0988..d26c3afc390f9972414dd715bee3e345ce5dfb71 100644 --- a/src/thermophysicalModels/liquids/C10H22/C10H22.C +++ b/src/thermophysicalModels/liquids/C10H22/C10H22.C @@ -27,19 +27,124 @@ License #include "C10H22.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C10H22, 0); + addToRunTimeSelectionTable(liquid, C10H22,); + addToRunTimeSelectionTable(liquid, C10H22, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::C10H22::C10H22() +: + liquid + ( + 142.285, + 617.70, + 2.11e+6, + 0.6, + 0.247, + 243.51, + 1.393, + 447.30, + 0.0, + 0.4923, + 1.57e+4 + ), + rho_(60.94208835, 0.25745, 617.7, 0.28912), + pv_(112.73, -9749.6, -13.245, 7.1266e-06, 2.0), + hl_(617.70, 464743.296904101, 0.39797, 0.0, 0.0, 0.0), + cp_ + ( + 1958.18252099659, + -1.39094071757388, + 0.00754612221948905, + 0.0, + 0.0, + 0.0 + ), + h_ + ( + -2699436.15229142, + 1958.18252099659, + -0.695470358786942, + 0.00251537407316302, + 0.0, + 0.0 + ), + cpg_(1175.10630073444, 3762.16748076045, 1614.1, 2658.04547211582, 742), + B_ + ( + 0.00337351091119935, + -4.13606494008504, + -534560.916470464, + -1.13364022911762e+19, + 2.80704220402713e+21 + ), + mu_(-16.468, 1533.5, 0.7511, 0.0, 0.0), + mug_(2.64e-08, 0.9487, 71.0, 0.0), + K_(0.2063, -0.000254, 0.0, 0.0, 0.0, 0.0), + Kg_(-668.4, 0.9323, -4071000000.0, 0.0), + sigma_(617.70, 0.055435, 1.3095, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 142.285, 28.0) // note: Same as nHeptane +{} + + +Foam::C10H22::C10H22 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C10H22, 0); -addToRunTimeSelectionTable(liquid, C10H22,); -addToRunTimeSelectionTable(liquid, C10H22, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C10H22::C10H22(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C10H22/C10H22.H b/src/thermophysicalModels/liquids/C10H22/C10H22.H index 6ee211c320c92f08bc813ca836849c908fd4b989..88ee972321aecf5f76e972b270a15619599188e3 100644 --- a/src/thermophysicalModels/liquids/C10H22/C10H22.H +++ b/src/thermophysicalModels/liquids/C10H22/C10H22.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - C10H22() - : - liquid(142.285, 617.70, 2.11e+6, 0.6, 0.247, 243.51, 1.393, 447.30, 0.0, 0.4923, 1.57e+4), - rho_(60.94208835, 0.25745, 617.7, 0.28912), - pv_(112.73, -9749.6, -13.245, 7.1266e-06, 2), - hl_(617.70, 464743.296904101, 0.39797, 0, 0, 0), - cp_(1958.18252099659, -1.39094071757388, 0.00754612221948905, 0, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-2699436.15229142, 1958.18252099659, -0.695470358786942, 0.00251537407316302, 0, 0), - cpg_(1175.10630073444, 3762.16748076045, 1614.1, 2658.04547211582, 742), - B_(0.00337351091119935, -4.13606494008504, -534560.916470464, -1.13364022911762e+19, 2.80704220402713e+21), - mu_(-16.468, 1533.5, 0.7511, 0, 0), - mug_(2.64e-08, 0.9487, 71, 0), - K_(0.2063, -0.000254, 0, 0, 0, 0), - Kg_(-668.4, 0.9323, -4071000000.0, 0), - sigma_(617.70, 0.055435, 1.3095, 0, 0, 0), - D_(147.18, 20.1, 142.285, 28) // NN: Same as nHeptane - {} + C10H22(); + + //- Construct from components C10H22 ( const liquid& l, @@ -123,124 +106,55 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C10H22(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C10H22(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + + // I-O //- Write the function coefficients void writeData(Ostream& os) const @@ -261,8 +175,7 @@ public: } - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C10H22& l) { l.writeData(os); @@ -277,6 +190,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C10H22I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C10H22/C10H22I.H b/src/thermophysicalModels/liquids/C10H22/C10H22I.H new file mode 100644 index 0000000000000000000000000000000000000000..bdbc395f1f54241bcfbd82261deb1938eaf22124 --- /dev/null +++ b/src/thermophysicalModels/liquids/C10H22/C10H22I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C10H22::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C10H22::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C10H22::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C10H22::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C10H22::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C10H22::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C10H22::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C10H22::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C10H22::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C10H22::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C10H22::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C10H22::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C10H22::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C12H26/C12H26.C b/src/thermophysicalModels/liquids/C12H26/C12H26.C index d12ca93da75252e7391935995dc876c5431667c3..8eb5d25e4615fab70790a2db71baf840ee0989bb 100644 --- a/src/thermophysicalModels/liquids/C12H26/C12H26.C +++ b/src/thermophysicalModels/liquids/C12H26/C12H26.C @@ -27,19 +27,116 @@ License #include "C12H26.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C12H26, 0); + addToRunTimeSelectionTable(liquid, C12H26,); + addToRunTimeSelectionTable(liquid, C12H26, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::C12H26::C12H26() +: + liquid + ( + 170.338, + 658.0, + 1.82e+6, + 0.716, + 0.238, + 263.57, + 6.152e-1, + 489.47, + 0.0, + 0.5764, + 1.59e+4 + ), + rho_(60.53982858, 0.25511, 658.0, 0.29368), + pv_(137.47, -11976.0, -16.698, 8.0906e-06, 2.0), + hl_(658.0, 454020.829174935, 0.40681, 0.0, 0.0, 0.0), + cp_(2983.53861146661, -8.0352006011577, 0.018207916025784, 0.0, 0.0, 0.0), + h_ + ( + -2755166.83820769, + 2983.53861146661, + -4.01760030057885, + 0.00606930534192801, + 0.0, + 0.0 + ), + cpg_(1250.16144371778, 3894.02247296552, 1715.5, 2650.67101879792, 777.5), + B_ + ( + 0.00516619896910848, + -6.40491258556517, + -295295.236529723, + -3.22147729807794e+19, + 8.78195117941974e+21 + ), + mu_(-20.607, 1943, 1.3205, 0.0, 0.0), + mug_(6.344e-08, 0.8287, 219.5, 0.0), + K_(0.2047, -0.0002326, 0.0, 0.0, 0.0, 0.0), + Kg_(5.719e-06, 1.4699, 579.4, 0.0), + sigma_(658.0, 0.055493, 1.3262, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 170.338, 28.0) // note: Same as nHeptane +{} + + +Foam::C12H26::C12H26 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C12H26, 0); -addToRunTimeSelectionTable(liquid, C12H26,); -addToRunTimeSelectionTable(liquid, C12H26, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C12H26::C12H26(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C12H26/C12H26.H b/src/thermophysicalModels/liquids/C12H26/C12H26.H index 2feca3b73686c9a80e83664ecc4dd8a374a6f561..9c3cba2ac2b71a724afda2c55b1c14a02dd5e494 100644 --- a/src/thermophysicalModels/liquids/C12H26/C12H26.H +++ b/src/thermophysicalModels/liquids/C12H26/C12H26.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - C12H26() - : - liquid(170.338, 658.0, 1.82e+6, 0.716, 0.238, 263.57, 6.152e-1, 489.47, 0, 0.5764, 1.59e+4), - rho_(60.53982858, 0.25511, 658, 0.29368), - pv_(137.47, -11976, -16.698, 8.0906e-06, 2), - hl_(658.0, 454020.829174935, 0.40681, 0, 0, 0), - cp_(2983.53861146661, -8.0352006011577, 0.018207916025784, 0, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-2755166.83820769, 2983.53861146661, -4.01760030057885, 0.00606930534192801, 0, 0), - cpg_(1250.16144371778, 3894.02247296552, 1715.5, 2650.67101879792, 777.5), - B_(0.00516619896910848, -6.40491258556517, -295295.236529723, -3.22147729807794e+19, 8.78195117941974e+21), - mu_(-20.607, 1943, 1.3205, 0, 0), - mug_(6.344e-08, 0.8287, 219.5, 0), - K_(0.2047, -0.0002326, 0, 0, 0, 0), - Kg_(5.719e-06, 1.4699, 579.4, 0), - sigma_(658.0, 0.055493, 1.3262, 0, 0, 0), - D_(147.18, 20.1, 170.338, 28) // NN: Same as nHeptane - {} + C12H26(); + + //- Construct from conponents C12H26 ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C12H26(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C12H26(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C12H26& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C12H26I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C12H26/C12H26I.H b/src/thermophysicalModels/liquids/C12H26/C12H26I.H new file mode 100644 index 0000000000000000000000000000000000000000..0edb1e981ae1598a684da2e20f5bb20918b36724 --- /dev/null +++ b/src/thermophysicalModels/liquids/C12H26/C12H26I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C12H26::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C12H26::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C12H26::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C12H26::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C12H26::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C12H26::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C12H26::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C12H26::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C12H26::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C12H26::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C12H26::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C12H26::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C12H26::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C13H28/C13H28.C b/src/thermophysicalModels/liquids/C13H28/C13H28.C index 2b8fe56e6ab445d988e13f54a1515fc6161c06b5..db63784cafe571719b973353a2c717312ba36a51 100644 --- a/src/thermophysicalModels/liquids/C13H28/C13H28.C +++ b/src/thermophysicalModels/liquids/C13H28/C13H28.C @@ -27,19 +27,124 @@ License #include "C13H28.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C13H28, 0); + addToRunTimeSelectionTable(liquid, C13H28,); + addToRunTimeSelectionTable(liquid, C13H28, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::C13H28::C13H28() +: + liquid + ( + 184.365, + 675.80, + 1.7225e+6, + 0.77, + 0.236, + 267.76, + 3.801e-1, + 508.62, + 0.0, + 0.6186, + 1.5901e+4 + ), + rho_(59.513022, 0.2504, 675.8, 0.312), + pv_(118.27, -11432, -13.769, 5.9641e-06, 2.0), + hl_(675.80, 444227.48352453, 0.4162, 0.0, 0.0, 0.0), + cp_ + ( + 4275.05220622135, + -16.6539202126217, + 0.0325755973205326, + 0.0, + 0.0, + 0.0 + ), + h_ + ( + -2860442.0545124, + 4275.05220622135, + -8.32696010631085, + 0.0108585324401775, + 0.0, + 0.0 + ), + cpg_(1136.87522035093, 3641.14663846175, -1443, 2277.00485450058, -683.0), + B_ + ( + 0.00246321156401703, + -2.66601578390692, + -1249532.17801643, + -1.0460770753668e+19, + 1.90117430097904e+21 + ), + mu_(-23.341, 2121.9, 1.7208, 0.0, 0.0), + mug_(3.5585e-08, 0.8987, 165.3, 0.0), + K_(0.1981, -0.0002046, 0.0, 0.0, 0.0, 0.0), + Kg_(5.3701e-06, 1.4751, 599.09, 0.0), + sigma_(675.80, 0.05561, 1.3361, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 184.365, 28.0) // note: Same as nHeptane +{} + + +Foam::C13H28::C13H28 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C13H28, 0); -addToRunTimeSelectionTable(liquid, C13H28,); -addToRunTimeSelectionTable(liquid, C13H28, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C13H28::C13H28(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C13H28/C13H28.H b/src/thermophysicalModels/liquids/C13H28/C13H28.H index 632b7c0ab76a2fd2827db4c4be7095d595715bc3..d97300f1d129f6e381139ecd35812f44cb1eeac9 100644 --- a/src/thermophysicalModels/liquids/C13H28/C13H28.H +++ b/src/thermophysicalModels/liquids/C13H28/C13H28.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - C13H28() - : - liquid(184.365, 675.80, 1.7225e+6, 0.77, 0.236, 267.76, 3.801e-1, 508.62, 0.0, 0.6186, 1.5901e+4), - rho_(59.513022, 0.2504, 675.8, 0.312), - pv_(118.27, -11432, -13.769, 5.9641e-06, 2), - hl_(675.80, 444227.48352453, 0.4162, 0, 0, 0), - cp_(4275.05220622135, -16.6539202126217, 0.0325755973205326, 0, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-2860442.0545124, 4275.05220622135, -8.32696010631085, 0.0108585324401775, 0, 0), - cpg_(1136.87522035093, 3641.14663846175, -1443, 2277.00485450058, -683), - B_(0.00246321156401703, -2.66601578390692, -1249532.17801643, -1.0460770753668e+19, 1.90117430097904e+21), - mu_(-23.341, 2121.9, 1.7208, 0, 0), - mug_(3.5585e-08, 0.8987, 165.3, 0), - K_(0.1981, -0.0002046, 0, 0, 0, 0), - Kg_(5.3701e-06, 1.4751, 599.09, 0), - sigma_(675.80, 0.05561, 1.3361, 0, 0, 0), - D_(147.18, 20.1, 184.365, 28) // NN: Same as nHeptane - {} + C13H28(); + + //- Construct from components C13H28 ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C13H28(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C13H28(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C13H28& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C13H28I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C13H28/C13H28I.H b/src/thermophysicalModels/liquids/C13H28/C13H28I.H new file mode 100644 index 0000000000000000000000000000000000000000..333905a9f3cc3aa36fe61f62446d7ffce1190aed --- /dev/null +++ b/src/thermophysicalModels/liquids/C13H28/C13H28I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C13H28::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C13H28::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C13H28::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C13H28::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C13H28::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C13H28::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C13H28::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C13H28::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C13H28::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C13H28::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C13H28::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C13H28::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C13H28::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C14H30/C14H30.C b/src/thermophysicalModels/liquids/C14H30/C14H30.C index 4177874ca49b691c462070304cff0c425540ebe0..0ccb3eb6c6edd4c437e08aa7a2e7edc8a9800155 100644 --- a/src/thermophysicalModels/liquids/C14H30/C14H30.C +++ b/src/thermophysicalModels/liquids/C14H30/C14H30.C @@ -27,19 +27,124 @@ License #include "C14H30.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C14H30, 0); + addToRunTimeSelectionTable(liquid, C14H30,); + addToRunTimeSelectionTable(liquid, C14H30, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::C14H30::C14H30() +: + liquid + ( + 198.392, + 692.40, + 1.6212e+6, + 0.8428, + 0.237, + 279.01, + 1.8849e-1, + 526.73, + 0.0, + 0.6617, + 1.6173e+4 + ), + rho_(60.92023144, 0.2582, 692.4, 0.26628), + pv_(249.21, -16915, -35.195, 0.028451, 1.0), + hl_(692.40, 455764.345336506, 0.428, 0.0, 0.0, 0.0), + cp_ + ( + 2565.72845679261, + -4.78114036856325, + 0.0120362716238558, + 0.0, + 0.0, + 0.0 + ), + h_ + ( + -2690601.01887934, + 2565.72845679261, + -2.39057018428162, + 0.00401209054128527, + 0.0, + 0.0 + ), + cpg_(1134.11831122223, 3629.17859591113, -1440.3, 2275.29335860317, -682), + B_ + ( + 0.00247837614419936, + -2.62692044034034, + -1427174.48284205, + -1.68288035807895e+19, + 3.48854792531957e+21 + ), + mu_(-18.964, 2010.9, 1.0648, 0.0, 0.0), + mug_(4.4565e-08, 0.8684, 228.16, -4347.2), + K_(0.1957, -0.0001993, 0.0, 0.0, 0.0, 0.0), + Kg_(-0.000628, 0.944, -5490, 0.0), + sigma_(692.40, 0.056436, 1.3658, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 198.392, 28.0) // note: Same as nHeptane +{} + + +Foam::C14H30::C14H30 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C14H30, 0); -addToRunTimeSelectionTable(liquid, C14H30,); -addToRunTimeSelectionTable(liquid, C14H30, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C14H30::C14H30(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C14H30/C14H30.H b/src/thermophysicalModels/liquids/C14H30/C14H30.H index fa86f3c9c3df5ad7493f1ffb20c08b875fd152fa..183ee026de88bd828575787d3a3a657de5756b8f 100644 --- a/src/thermophysicalModels/liquids/C14H30/C14H30.H +++ b/src/thermophysicalModels/liquids/C14H30/C14H30.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - C14H30() - : - liquid(198.392, 692.40, 1.6212e+6, 0.8428, 0.237, 279.01, 1.8849e-1, 526.73, 0.0, 0.6617, 1.6173e+4), - rho_(60.92023144, 0.2582, 692.4, 0.26628), - pv_(249.21, -16915, -35.195, 0.028451, 1), - hl_(692.40, 455764.345336506, 0.428, 0, 0, 0), - cp_(2565.72845679261, -4.78114036856325, 0.0120362716238558, 0, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-2690601.01887934, 2565.72845679261, -2.39057018428162, 0.00401209054128527, 0, 0), - cpg_(1134.11831122223, 3629.17859591113, -1440.3, 2275.29335860317, -682), - B_(0.00247837614419936, -2.62692044034034, -1427174.48284205, -1.68288035807895e+19, 3.48854792531957e+21), - mu_(-18.964, 2010.9, 1.0648, 0, 0), - mug_(4.4565e-08, 0.8684, 228.16, -4347.2), - K_(0.1957, -0.0001993, 0, 0, 0, 0), - Kg_(-0.000628, 0.944, -5490, 0), - sigma_(692.40, 0.056436, 1.3658, 0, 0, 0), - D_(147.18, 20.1, 198.392, 28) // NN: Same as nHeptane - {} + C14H30(); + + //- Construct from components C14H30 ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C14H30(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C14H30(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; - //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + //- Liquid thermal conductivity [W/(m K)] + inline scalar K(scalar p, scalar T) const; - //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + //- Vapour thermal conductivity [W/(m K)] + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C14H30& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C14H30I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C14H30/C14H30I.H b/src/thermophysicalModels/liquids/C14H30/C14H30I.H new file mode 100644 index 0000000000000000000000000000000000000000..6c64cab8c42ab65ef5866fb8aac40fd1766a5966 --- /dev/null +++ b/src/thermophysicalModels/liquids/C14H30/C14H30I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C14H30::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C14H30::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C14H30::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C14H30::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C14H30::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C14H30::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C14H30::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C14H30::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C14H30::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C14H30::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C14H30::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C14H30::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C14H30::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C16H34/C16H34.C b/src/thermophysicalModels/liquids/C16H34/C16H34.C index 7c394c898b78c00c8adc0460919ded10cfc5cc90..af1a86a186519aba492fa9861c0be63608acc247 100644 --- a/src/thermophysicalModels/liquids/C16H34/C16H34.C +++ b/src/thermophysicalModels/liquids/C16H34/C16H34.C @@ -27,19 +27,124 @@ License #include "C16H34.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C16H34, 0); + addToRunTimeSelectionTable(liquid, C16H34,); + addToRunTimeSelectionTable(liquid, C16H34, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::C16H34::C16H34() +: + liquid + ( + 226.446, + 720.60, + 1.4186e+6, + 0.93, + 0.22, + 291.32, + 8.7467e-2, + 560.01, + 0.0, + 0.7471, + 1.6052e+4 + ), + rho_(61.94656776, 0.25442, 720.6, 0.3238), + pv_(233.1, -17346, -32.251, 0.02407, 1.0), + hl_(720.60, 430654.548987397, 0.4122, 0.0, 0.0, 0.0), + cp_ + ( + 3769.90540791182, + -12.5871068599136, + 0.0247211255663602, + 0.0, + 0.0, + 0.0 + ), + h_ + ( + -2777201.30410301, + 3769.90540791182, + -6.29355342995681, + 0.00824037518878673, + 0.0, + 0.0 + ), + cpg_(1128.74592618108, 3600.8584828171, -1429.7, 2259.69988429913, 679.0), + B_ + ( + 0.0025091191718997, + -2.46668079807106, + -1704070.72767901, + -3.00623548219001e+19, + 7.07320950690231e+21 + ), + mu_(-18.388, 2056.8, 0.98681, 0.0, 0.0), + mug_(1.2463e-07, 0.7322, 395.0, 6000.0), + K_(0.1963, -0.00019, 0.0, 0.0, 0.0, 0.0), + Kg_(3.075e-06, 1.552, 678.0, 0.0), + sigma_(720.60, 0.05699, 1.3929, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 226.446, 28.0) // note: Same as nHeptane +{} + + +Foam::C16H34::C16H34 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C16H34, 0); -addToRunTimeSelectionTable(liquid, C16H34,); -addToRunTimeSelectionTable(liquid, C16H34, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C16H34::C16H34(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C16H34/C16H34.H b/src/thermophysicalModels/liquids/C16H34/C16H34.H index 9cbc69541bda278558e4a299b02b47138cfcb127..5f2b8831635c6434817e3377c18fb9b999f626a2 100644 --- a/src/thermophysicalModels/liquids/C16H34/C16H34.H +++ b/src/thermophysicalModels/liquids/C16H34/C16H34.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - C16H34() - : - liquid(226.446, 720.60, 1.4186e+6, 0.93, 0.22, 291.32, 8.7467e-2, 560.01, 0, 0.7471, 1.6052e+4), - rho_(61.94656776, 0.25442, 720.6, 0.3238), - pv_(233.1, -17346, -32.251, 0.02407, 1), - hl_(720.60, 430654.548987397, 0.4122, 0, 0, 0), - cp_(3769.90540791182, -12.5871068599136, 0.0247211255663602, 0, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-2777201.30410301, 3769.90540791182, -6.29355342995681, 0.00824037518878673, 0, 0), - cpg_(1128.74592618108, 3600.8584828171, -1429.7, 2259.69988429913, 679), - B_(0.0025091191718997, -2.46668079807106, -1704070.72767901, -3.00623548219001e+19, 7.07320950690231e+21), - mu_(-18.388, 2056.8, 0.98681, 0, 0), - mug_(1.2463e-07, 0.7322, 395, 6000), - K_(0.1963, -0.00019, 0, 0, 0, 0), - Kg_(3.075e-06, 1.552, 678, 0), - sigma_(720.60, 0.05699, 1.3929, 0, 0, 0), - D_(147.18, 20.1, 226.446, 28) // NN: Same as nHeptane - {} + C16H34(); + + //- Construct from components C16H34 ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C16H34(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C16H34(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C16H34& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C16H34I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C16H34/C16H34I.H b/src/thermophysicalModels/liquids/C16H34/C16H34I.H new file mode 100644 index 0000000000000000000000000000000000000000..66a19bb3d4877ca9511b6102d41f38dc445e103b --- /dev/null +++ b/src/thermophysicalModels/liquids/C16H34/C16H34I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C16H34::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C16H34::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C16H34::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C16H34::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C16H34::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C16H34::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C16H34::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C16H34::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C16H34::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C16H34::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C16H34::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C16H34::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C16H34::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C2H5OH/C2H5OH.C b/src/thermophysicalModels/liquids/C2H5OH/C2H5OH.C index e5943b893ef16f7342f68363f8242961c05a199b..c5bfbe37e49503ac5c975df63d13e1255b67fb15 100644 --- a/src/thermophysicalModels/liquids/C2H5OH/C2H5OH.C +++ b/src/thermophysicalModels/liquids/C2H5OH/C2H5OH.C @@ -27,19 +27,124 @@ License #include "C2H5OH.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C2H5OH, 0); + addToRunTimeSelectionTable(liquid, C2H5OH,); + addToRunTimeSelectionTable(liquid, C2H5OH, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::C2H5OH::C2H5OH() +: + liquid + ( + 46.069, + 516.25, + 6.3835e+6, + 0.16692, + 0.248, + 159.05, + 7.1775e-5, + 351.44, + 5.6372e-30, + 0.6371, + 2.6421e+4 + ), + rho_(70.1308387, 0.26395, 516.25, 0.2367), + pv_(59.796, -6595, -5.0474, 6.3e-07, 2), + hl_(516.25, 958345.091059064, -0.4134, 0.75362, 0.0, 0.0), + cp_ + ( + 2052.57331394213, + -1.21990926653498, + 0.00714146172046278, + 5.20523562482363e-05, + 0.0, + 0.0 + ), + h_ + ( + -6752827.25039109, + 2052.57331394213, + -0.60995463326749, + 0.00238048724015426, + 1.30130890620591e-05, + 0.0 + ), + cpg_(909.505307256507, 3358.00646855803, 1530, 2029.56434912848, 640), + B_ + ( + -0.00358158414552085, + 3.90718270420456, + -1180837.43949293, + 9.81136990166923e+18, + -3.58592545963663e+21 + ), + mu_(8.049, 776, -3.068, 0.0, 0.0), + mug_(1.0613e-07, 0.8066, 52.7, 0.0), + K_(0.253, -0.000281, 0.0, 0.0, 0.0, 0.0), + Kg_(-3.12, 0.7152, -3550000.0, 0.0), + sigma_(516.25, 0.04064, -4.34e-05, -6.42e-08, 0.0, 0.0), + D_(147.18, 20.1, 46.069, 28) // note: Same as nHeptane +{} + + +Foam::C2H5OH::C2H5OH +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C2H5OH, 0); -addToRunTimeSelectionTable(liquid, C2H5OH,); -addToRunTimeSelectionTable(liquid, C2H5OH, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C2H5OH::C2H5OH(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C2H5OH/C2H5OH.H b/src/thermophysicalModels/liquids/C2H5OH/C2H5OH.H index 8e4867006457f13efadec823decb99416a306b1e..88a7099446da793a5393b42cdf254060fa1c7887 100644 --- a/src/thermophysicalModels/liquids/C2H5OH/C2H5OH.H +++ b/src/thermophysicalModels/liquids/C2H5OH/C2H5OH.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - C2H5OH() - : - liquid(46.069, 516.25, 6.3835e+6, 0.16692, 0.248, 159.05, 7.1775e-5, 351.44, 5.6372e-30, 0.6371, 2.6421e+4), - rho_(70.1308387, 0.26395, 516.25, 0.2367), - pv_(59.796, -6595, -5.0474, 6.3e-07, 2), - hl_(516.25, 958345.091059064, -0.4134, 0.75362, 0, 0), - cp_(2052.57331394213, -1.21990926653498, 0.00714146172046278, 5.20523562482363e-05, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-6752827.25039109, 2052.57331394213, -0.60995463326749, 0.00238048724015426, 1.30130890620591e-05, 0), - cpg_(909.505307256507, 3358.00646855803, 1530, 2029.56434912848, 640), - B_(-0.00358158414552085, 3.90718270420456, -1180837.43949293, 9.81136990166923e+18, -3.58592545963663e+21), - mu_(8.049, 776, -3.068, 0, 0), - mug_(1.0613e-07, 0.8066, 52.7, 0), - K_(0.253, -0.000281, 0, 0, 0, 0), - Kg_(-3.12, 0.7152, -3550000.0, 0), - sigma_(516.25, 0.04064, -4.34e-05, -6.42e-08, 0, 0), - D_(147.18, 20.1, 46.069, 28) // NN: Same as nHeptane - {} + C2H5OH(); + + //- Construct from components C2H5OH ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C2H5OH(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C2H5OH(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C2H5OH& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C2H5OHI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C2H5OH/C2H5OHI.H b/src/thermophysicalModels/liquids/C2H5OH/C2H5OHI.H new file mode 100644 index 0000000000000000000000000000000000000000..cf051eea9c8cf30a3d5d000be0c9af9aeca5b8e3 --- /dev/null +++ b/src/thermophysicalModels/liquids/C2H5OH/C2H5OHI.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C2H5OH::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C2H5OH::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C2H5OH::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C2H5OH::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C2H5OH::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C2H5OH::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C2H5OH::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C2H5OH::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C2H5OH::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C2H5OH::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C2H5OH::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C2H5OH::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C2H5OH::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C2H6/C2H6.C b/src/thermophysicalModels/liquids/C2H6/C2H6.C index 8859c637be4f507d42f66f74471ea9d36fddf4fa..659144b76406545185205471fcafae760b968654 100644 --- a/src/thermophysicalModels/liquids/C2H6/C2H6.C +++ b/src/thermophysicalModels/liquids/C2H6/C2H6.C @@ -27,19 +27,115 @@ License #include "C2H6.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C2H6, 0); + addToRunTimeSelectionTable(liquid, C2H6,); + addToRunTimeSelectionTable(liquid, C2H6, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::C2H6::C2H6() +: + liquid + ( + 30.070, + 305.32, + 4.872e+6, + 0.14550, + 0.279, + 90.35, + 1.13, + 184.55, + 0.0, + 0.0995, + 1.24e+4 + ), + rho_(57.499854, 0.27937, 305.32, 0.29187), + pv_(51.857, -2598.7, -5.1283, 1.4913e-05, 2.0), + hl_(305.32, 701396.740937812, 0.60646, -0.55492, 0.32799, 0.0), + cp_ + ( + 305.32, + 8.02554965861611, + 2983.63817758563, + 167.548325566287, + -343.93389207094 + ), + h_(0.0, 0.0, 0.0, 0.0, 0.0, 0.0), + cpg_(1341.07083471899, 4463.58496840705, 1655.5, 2435.08480212837, 752.87), + B_ + ( + 0.00269205187894912, + -2.05221150648487, + -47721.9820419022, + 2.24808779514466e+15, + -3.23910874625873e+17 + ), + mu_(-3.4134, 197.05, -1.2193, -9.2023e-26, 10.0), + mug_(2.5906e-07, 0.67988, 98.902, 0.0), + K_(0.35758, -0.0011458, 6.1866e-07, 0.0, 0.0, 0.0), + Kg_(7.3869e-05, 1.1689, 500.73, 0.0), + sigma_(305.32, 0.048643, 1.1981, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 30.070, 28) // note: Same as nHeptane +{} + + +Foam::C2H6::C2H6 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc14& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C2H6, 0); -addToRunTimeSelectionTable(liquid, C2H6,); -addToRunTimeSelectionTable(liquid, C2H6, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C2H6::C2H6(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C2H6/C2H6.H b/src/thermophysicalModels/liquids/C2H6/C2H6.H index 48200af5908303c92f33085379c4b60af6eac002..728c362732ec9249476fdddbf41561e9e047781b 100644 --- a/src/thermophysicalModels/liquids/C2H6/C2H6.H +++ b/src/thermophysicalModels/liquids/C2H6/C2H6.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - C2H6() - : - liquid(30.070, 305.32, 4.872e+6, 0.14550, 0.279, 90.35, 1.13, 184.55, 0.0, 0.0995, 1.24e+4), - rho_(57.499854, 0.27937, 305.32, 0.29187), - pv_(51.857, -2598.7, -5.1283, 1.4913e-05, 2), - hl_(305.32, 701396.740937812, 0.60646, -0.55492, 0.32799, 0), - cp_(305.32, 8.02554965861611, 2983.63817758563, 167.548325566287, -343.93389207094), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(0, 0, 0, 0, 0, 0), - cpg_(1341.07083471899, 4463.58496840705, 1655.5, 2435.08480212837, 752.87), - B_(0.00269205187894912, -2.05221150648487, -47721.9820419022, 2.24808779514466e+15, -3.23910874625873e+17), - mu_(-3.4134, 197.05, -1.2193, -9.2023e-26, 10), - mug_(2.5906e-07, 0.67988, 98.902, 0), - K_(0.35758, -0.0011458, 6.1866e-07, 0, 0, 0), - Kg_(7.3869e-05, 1.1689, 500.73, 0), - sigma_(305.32, 0.048643, 1.1981, 0, 0, 0), - D_(147.18, 20.1, 30.070, 28) // NN: Same as nHeptane - {} + C2H6(); + + //- Construct from components C2H6 ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C2H6(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C2H6(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C2H6& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C2H6I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C2H6/C2H6I.H b/src/thermophysicalModels/liquids/C2H6/C2H6I.H new file mode 100644 index 0000000000000000000000000000000000000000..a788413b0efafe6f73aa17984020a267069a8885 --- /dev/null +++ b/src/thermophysicalModels/liquids/C2H6/C2H6I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C2H6::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C2H6O/C2H6O.C b/src/thermophysicalModels/liquids/C2H6O/C2H6O.C index d4de1a8c1b8fddd0202bdcea08fb3529bb61f9cf..8cc2a83df0b03bd414b3f1d0a52fea166a68be30 100644 --- a/src/thermophysicalModels/liquids/C2H6O/C2H6O.C +++ b/src/thermophysicalModels/liquids/C2H6O/C2H6O.C @@ -27,19 +27,124 @@ License #include "C2H6O.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C2H6O, 0); + addToRunTimeSelectionTable(liquid, C2H6O,); + addToRunTimeSelectionTable(liquid, C2H6O, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::C2H6O::C2H6O() +: + liquid + ( + 46.069, + 400.10, + 5.3702e+6, + 0.17, + 0.274, + 131.65, + 3.0849, + 248.31, + 4.3363e-30, + 0.2036, + 1.7572e+4 + ), + rho_(69.472052, 0.26325, 400.1, 0.2806), + pv_(51.566, -3664.4, -4.653, 5.9e-06, 2), + hl_(400.10, 608435.173326966, 0.2477, -0.089, 0.203, 0), + cp_ + ( + 1491.24139877141, + 11.3099915344375, + -0.067273003538171, + 0.000136556035511949, + 0.0, + 0.0 + ), + h_ + ( + -5024829.22619402, + 1491.24139877141, + 5.65499576721874, + -0.0224243345127237, + 3.41390088779874e-05, + 0.0 + ), + cpg_(950.747791356443, 3160.47667628991, 1284, 1291.5409494454, 520), + B_ + ( + 0.00235082159369641, + -2.26616596843865, + -123293.320888233, + -8.87364605266014e+16, + 1.46389111984198e+19 + ), + mu_(-10.62, 448.99, 8.3967e-05, 0.0, 0.0), + mug_(7.27, 0.1091, 440600000, 0.0), + K_(0.31276, -0.0005677, 0.0, 0.0, 0.0, 0.0), + Kg_(0.2247, 0.1026, 997.06, 1762900), + sigma_(400.10, 0.06096, 1.2286, 0, 0, 0), + D_(147.18, 20.1, 46.069, 28) // note: Same as nHeptane +{} + + +Foam::C2H6O::C2H6O +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C2H6O, 0); -addToRunTimeSelectionTable(liquid, C2H6O,); -addToRunTimeSelectionTable(liquid, C2H6O, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C2H6O::C2H6O(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C2H6O/C2H6O.H b/src/thermophysicalModels/liquids/C2H6O/C2H6O.H index 8017e404377ac34e17a3e55e797d5665991ef4ea..690f68d9e4f68d7e1f1b5e31156e72ef89247621 100644 --- a/src/thermophysicalModels/liquids/C2H6O/C2H6O.H +++ b/src/thermophysicalModels/liquids/C2H6O/C2H6O.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - C2H6O() - : - liquid(46.069, 400.10, 5.3702e+6, 0.17, 0.274, 131.65, 3.0849, 248.31, 4.3363e-30, 0.2036, 1.7572e+4), - rho_(69.472052, 0.26325, 400.1, 0.2806), - pv_(51.566, -3664.4, -4.653, 5.9e-06, 2), - hl_(400.10, 608435.173326966, 0.2477, -0.089, 0.203, 0), - cp_(1491.24139877141, 11.3099915344375, -0.067273003538171, 0.000136556035511949, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-5024829.22619402, 1491.24139877141, 5.65499576721874, -0.0224243345127237, 3.41390088779874e-05, 0), - cpg_(950.747791356443, 3160.47667628991, 1284, 1291.5409494454, 520), - B_(0.00235082159369641, -2.26616596843865, -123293.320888233, -8.87364605266014e+16, 1.46389111984198e+19), - mu_(-10.62, 448.99, 8.3967e-05, 0, 0), - mug_(7.27, 0.1091, 440600000, 0), - K_(0.31276, -0.0005677, 0, 0, 0, 0), - Kg_(0.2247, 0.1026, 997.06, 1762900), - sigma_(400.10, 0.06096, 1.2286, 0, 0, 0), - D_(147.18, 20.1, 46.069, 28) // NN: Same as nHeptane - {} + C2H6O(); + + //- Construct from components C2H6O ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C2H6O(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C2H6O(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C2H6O& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C2H6OI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C2H6O/C2H6OI.H b/src/thermophysicalModels/liquids/C2H6O/C2H6OI.H new file mode 100644 index 0000000000000000000000000000000000000000..5e2b7cadc707d912433a31fdf7bd64989b90d11a --- /dev/null +++ b/src/thermophysicalModels/liquids/C2H6O/C2H6OI.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C2H6O::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6O::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6O::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6O::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6O::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6O::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6O::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6O::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6O::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6O::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6O::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6O::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C2H6O::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C3H6O/C3H6O.C b/src/thermophysicalModels/liquids/C3H6O/C3H6O.C index 9e128206ced0d9dcc0930317a3a0aa697140c092..2e2b29b6e0b31c9dd8438b291aa3bb6363459985 100644 --- a/src/thermophysicalModels/liquids/C3H6O/C3H6O.C +++ b/src/thermophysicalModels/liquids/C3H6O/C3H6O.C @@ -27,19 +27,124 @@ License #include "C3H6O.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C3H6O, 0); + addToRunTimeSelectionTable(liquid, C3H6O,); + addToRunTimeSelectionTable(liquid, C3H6O, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::C3H6O::C3H6O() +: + liquid + ( + 58.08, + 508.20, + 4.7015e+6, + 0.209, + 0.233, + 178.45, + 2.5938, + 329.44, + 9.6066e-30, + 0.3064, + 1.9774e+4 + ), + rho_(71.426784, 0.2576, 508.2, 0.29903), + pv_(70.72, -5.685, -7.351, 6.3e-06, 2.0), + hl_(508.20, 846590.909090909, 1.036, -1.294, 0.672, 0.0), + cp_ + ( + 2334.71074380165, + -3.04752066115702, + 0.00488464187327824, + 1.18629476584022e-05, + 0.0, + 0.0 + ), + h_ + ( + 2571201.780143, + 2334.71074380165, + -1.52376033057851, + 0.00162821395775941, + 2.96573691460055e-06, + 0.0 + ), + cpg_(828.512396694215, 2830.57851239669, 1250.0, 1234.50413223141, -524.4), + B_ + ( + 0.00190599173553719, + -1.70798898071625, + -525826.446280992, + 1.70282369146006e+17, + -2.83298898071625e+20 + ), + mu_(-14.918, 1023.4, 0.5961, 0.0, 0.0), + mug_(3.1005e-08, 0.9762, 23.139, 0.0), + K_(0.2502, -0.000298, 0.0, 0.0, 0.0, 0.0), + Kg_(-26.8, 0.9098, -126500000, 0.0), + sigma_(508.20, 0.0622, 1.124, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 58.08, 28) // note: Same as nHeptane +{} + + +Foam::C3H6O::C3H6O +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C3H6O, 0); -addToRunTimeSelectionTable(liquid, C3H6O,); -addToRunTimeSelectionTable(liquid, C3H6O, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C3H6O::C3H6O(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C3H6O/C3H6O.H b/src/thermophysicalModels/liquids/C3H6O/C3H6O.H index 86cb9c5998757aa0919449f278bade06453bd618..b08db3fc0b4c68c76ecd10d48f73868127940569 100644 --- a/src/thermophysicalModels/liquids/C3H6O/C3H6O.H +++ b/src/thermophysicalModels/liquids/C3H6O/C3H6O.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - C3H6O() - : - liquid(58.08, 508.20, 4.7015e+6, 0.209, 0.233, 178.45, 2.5938, 329.44, 9.6066e-30, 0.3064, 1.9774e+4), - rho_(71.426784, 0.2576, 508.2, 0.29903), - pv_(70.72, -5.685, -7.351, 6.3e-06, 2), - hl_(508.20, 846590.909090909, 1.036, -1.294, 0.672, 0), - cp_(2334.71074380165, -3.04752066115702, 0.00488464187327824, 1.18629476584022e-05, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(2571201.780143, 2334.71074380165, -1.52376033057851, 0.00162821395775941, 2.96573691460055e-06, 0), - cpg_(828.512396694215, 2830.57851239669, 1250, 1234.50413223141, -524.4), - B_(0.00190599173553719, -1.70798898071625, -525826.446280992, 1.70282369146006e+17, -2.83298898071625e+20), - mu_(-14.918, 1023.4, 0.5961, 0, 0), - mug_(3.1005e-08, 0.9762, 23.139, 0), - K_(0.2502, -0.000298, 0, 0, 0, 0), - Kg_(-26.8, 0.9098, -126500000, 0), - sigma_(508.20, 0.0622, 1.124, 0, 0, 0), - D_(147.18, 20.1, 58.08, 28) // NN: Same as nHeptane - {} + C3H6O(); + + //- Construct from compoents C3H6O ( const liquid& l, @@ -123,124 +106,55 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C3H6O(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C3H6O(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + + // I-O //- Write the function coefficients void writeData(Ostream& os) const @@ -260,8 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C3H6O& l) { @@ -277,6 +190,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C3H6OI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C3H6O/C3H6OI.H b/src/thermophysicalModels/liquids/C3H6O/C3H6OI.H new file mode 100644 index 0000000000000000000000000000000000000000..a02afbde380980732218ea7374f4923ae9c28462 --- /dev/null +++ b/src/thermophysicalModels/liquids/C3H6O/C3H6OI.H @@ -0,0 +1,104 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C3H6O::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C3H6O::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C3H6O::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C3H6O::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C3H6O::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C3H6O::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C3H6O::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C3H6O::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C3H6O::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C3H6O::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C3H6O::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C3H6O::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C3H6O::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C3H8/C3H8.C b/src/thermophysicalModels/liquids/C3H8/C3H8.C index 6293a16b5205c07b965df9caad38dcd047993b89..936af6e463068826cba70eeb5258e07dc84bc4f8 100644 --- a/src/thermophysicalModels/liquids/C3H8/C3H8.C +++ b/src/thermophysicalModels/liquids/C3H8/C3H8.C @@ -27,19 +27,113 @@ License #include "C3H8.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C3H8, 0); + addToRunTimeSelectionTable(liquid, C3H8,); + addToRunTimeSelectionTable(liquid, C3H8, Istream); +} +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +Foam::C3H8::C3H8() +: + liquid + ( + 44.096, + 369.83, + 4.248e+6, + 0.2, 0.276, + 85.47, + 1.685e-4, + 231.11, + 0.0, + 0.1523, + 1.31e+4 + ), + rho_(60.6628672, 0.27453, 369.83, 0.29359), + pv_(59.078, -3492.6, -6.0669, 1.0919e-05, 2.0), + hl_(369.83, 662395.682148041, 0.78237, -0.77319, 0.39246, 0.0), + cp_ + ( + 369.83, + 9.48470319647089, + 2576.87772133527, + 95.3560311677331, + -131.535634282099 + ), + h_(0.0, 0.0, 0.0, 0.0, 0.0, 0.0), + cpg_(1177.43105950653, 4364.34143686502, 1626.5, 2648.76632801161, 723.6), + B_ + ( + 0.00255578737300435, + -2.24963715529753, + -102276.850507983, + 7.00743831640058e+15, + -1.59878447024673e+18 + ), + mu_(-6.9281, 420.76, -0.63276, -1.713e-26, 10.0), + mug_(2.4993e-07, 0.68612, 179.34, -8254.6), + K_(0.26755, -0.00066457, 2.774e-07, 0.0, 0.0, 0.0), + Kg_(-1.12, 0.10972, -9834.6, -7535800), + sigma_(369.83, 0.05092, 1.2197, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 44.096, 28) // note: Same as nHeptane +{} + + +Foam::C3H8::C3H8 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc14& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C3H8, 0); -addToRunTimeSelectionTable(liquid, C3H8,); -addToRunTimeSelectionTable(liquid, C3H8, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C3H8::C3H8(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C3H8/C3H8.H b/src/thermophysicalModels/liquids/C3H8/C3H8.H index 878ea72ad1b1f49fc92762eb5c4c7a57221271f0..27477b01c67e73c72c0958e3dd007968004fbb2f 100644 --- a/src/thermophysicalModels/liquids/C3H8/C3H8.H +++ b/src/thermophysicalModels/liquids/C3H8/C3H8.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - C3H8() - : - liquid(44.096, 369.83, 4.248e+6, 0.2, 0.276, 85.47, 1.685e-4, 231.11, 0.0, 0.1523, 1.31e+4), - rho_(60.6628672, 0.27453, 369.83, 0.29359), - pv_(59.078, -3492.6, -6.0669, 1.0919e-05, 2), - hl_(369.83, 662395.682148041, 0.78237, -0.77319, 0.39246, 0), - cp_(369.83, 9.48470319647089, 2576.87772133527, 95.3560311677331, -131.535634282099), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(0, 0, 0, 0, 0, 0), - cpg_(1177.43105950653, 4364.34143686502, 1626.5, 2648.76632801161, 723.6), - B_(0.00255578737300435, -2.24963715529753, -102276.850507983, 7.00743831640058e+15, -1.59878447024673e+18), - mu_(-6.9281, 420.76, -0.63276, -1.713e-26, 10), - mug_(2.4993e-07, 0.68612, 179.34, -8254.6), - K_(0.26755, -0.00066457, 2.774e-07, 0, 0, 0), - Kg_(-1.12, 0.10972, -9834.6, -7535800), - sigma_(369.83, 0.05092, 1.2197, 0, 0, 0), - D_(147.18, 20.1, 44.096, 28) // NN: Same as nHeptane - {} + C3H8(); + + //- Construct from components C3H8 ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C3H8(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C3H8(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C3H8& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C3H8I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C3H8/C3H8I.H b/src/thermophysicalModels/liquids/C3H8/C3H8I.H new file mode 100644 index 0000000000000000000000000000000000000000..7ba1f47a74bc50d3a6370b59bcf1e93aafb90279 --- /dev/null +++ b/src/thermophysicalModels/liquids/C3H8/C3H8I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C3H8::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C3H8::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C3H8::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C3H8::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C3H8::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C3H8::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C3H8::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C3H8::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C3H8::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C3H8::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C3H8::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C3H8::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C3H8::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C4H10O/C4H10O.C b/src/thermophysicalModels/liquids/C4H10O/C4H10O.C index 330dbf21c296a03c8e879181f6eaf94a288b31de..83a7dd2aa693ca66f855519317cc00d2f21819ef 100644 --- a/src/thermophysicalModels/liquids/C4H10O/C4H10O.C +++ b/src/thermophysicalModels/liquids/C4H10O/C4H10O.C @@ -27,19 +27,124 @@ License #include "C4H10O.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C4H10O, 0); + addToRunTimeSelectionTable(liquid, C4H10O,); + addToRunTimeSelectionTable(liquid, C4H10O, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::C4H10O::C4H10O() +: + liquid + ( + 74.123, + 466.70, + 3.6376e+6, + 0.28, + 0.262, + 156.85, + 4.0709e-1, + 307.58, + 3.836e-30, + 0.2846, + 1.5532e+4 + ), + rho_(75.2793188, 0.27608, 466.7, 0.29358), + pv_(101.03, -6311.5, -12.27, 1.377e-05, 2), + hl_(466.70, 566355.921913576, 0.40717, 0, 0, 0), + cp_ + ( + 599.004357621791, + 17.5519069654493, + -0.0742009902459426, + 0.00011822241409549, + 0.0, + 0.0 + ), + h_ + ( + -4312350.92187216, + 599.004357621791, + 8.77595348272466, + -0.0247336634153142, + 2.95556035238725e-05, + 0.0 + ), + cpg_(1163.06679438231, 3441.57683849817, 1541.3, 1938.66950878944, -688.9), + B_ + ( + 0.00215992337061371, + -1.810504162001, + -276972.0599544, + -2.12349742994752e+17, + 3.1016013922804e+19 + ), + mu_(10.197, -63.8, -3.226, 0.0, 0.0), + mug_(1.948e-06, 0.41, 495.8, 0.0), + K_(0.249, -0.0004005, 0.0, 0.0, 0.0, 0.0), + Kg_(-0.0044894, 0.6155, -3266.3, 0.0), + sigma_(466.70, 0.057356, 1.288, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 74.123, 28) // note: Same as nHeptane +{} + + +Foam::C4H10O::C4H10O +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C4H10O, 0); -addToRunTimeSelectionTable(liquid, C4H10O,); -addToRunTimeSelectionTable(liquid, C4H10O, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C4H10O::C4H10O(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C4H10O/C4H10O.H b/src/thermophysicalModels/liquids/C4H10O/C4H10O.H index 1c9257ea64081928b1c0af8c003cde8c68fc3ce0..b2da44684940020f18a07764986d19d399fd96dd 100644 --- a/src/thermophysicalModels/liquids/C4H10O/C4H10O.H +++ b/src/thermophysicalModels/liquids/C4H10O/C4H10O.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - C4H10O() - : - liquid(74.123, 466.70, 3.6376e+6, 0.28, 0.262, 156.85, 4.0709e-1, 307.58, 3.836e-30, 0.2846, 1.5532e+4), - rho_(75.2793188, 0.27608, 466.7, 0.29358), - pv_(101.03, -6311.5, -12.27, 1.377e-05, 2), - hl_(466.70, 566355.921913576, 0.40717, 0, 0, 0), - cp_(599.004357621791, 17.5519069654493, -0.0742009902459426, 0.00011822241409549, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-4312350.92187216, 599.004357621791, 8.77595348272466, -0.0247336634153142, 2.95556035238725e-05, 0), - cpg_(1163.06679438231, 3441.57683849817, 1541.3, 1938.66950878944, -688.9), - B_(0.00215992337061371, -1.810504162001, -276972.0599544, -2.12349742994752e+17, 3.1016013922804e+19), - mu_(10.197, -63.8, -3.226, 0, 0), - mug_(1.948e-06, 0.41, 495.8, 0), - K_(0.249, -0.0004005, 0, 0, 0, 0), - Kg_(-0.0044894, 0.6155, -3266.3, 0), - sigma_(466.70, 0.057356, 1.288, 0, 0, 0), - D_(147.18, 20.1, 74.123, 28) // NN: Same as nHeptane - {} + C4H10O(); + + //- Construct from components C4H10O ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C4H10O(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C4H10O(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C4H10O& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C4H10OI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C4H10O/C4H10OI.H b/src/thermophysicalModels/liquids/C4H10O/C4H10OI.H new file mode 100644 index 0000000000000000000000000000000000000000..bc067ebaffa5bf7d3cc2e5b4a6406a62c314ce19 --- /dev/null +++ b/src/thermophysicalModels/liquids/C4H10O/C4H10OI.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C4H10O::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C4H10O::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C4H10O::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C4H10O::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C4H10O::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C4H10O::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C4H10O::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C4H10O::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C4H10O::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C4H10O::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C4H10O::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C4H10O::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C4H10O::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C6H14/C6H14.C b/src/thermophysicalModels/liquids/C6H14/C6H14.C index d78e28c0dfb45760ae91ae4a53490e3b9b0d7b6e..6e82c98871ac62c0973dfe9f416f0087caa34014 100644 --- a/src/thermophysicalModels/liquids/C6H14/C6H14.C +++ b/src/thermophysicalModels/liquids/C6H14/C6H14.C @@ -27,19 +27,124 @@ License #include "C6H14.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C6H14, 0); + addToRunTimeSelectionTable(liquid, C6H14,); + addToRunTimeSelectionTable(liquid, C6H14, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::C6H14::C6H14() +: + liquid + ( + 86.177, + 507.60, + 3.025e+6, + 0.371, + 0.266, + 177.83, + 9.017e-1, + 341.88, + 0.0, + 0.3013, + 1.49e+4 + ), + rho_(61.03399848, 0.26411, 507.6, 0.27537), + pv_(104.65, -6995.5, -12.702, 1.2381e-05, 2.0), + hl_(507.60, 527286.863084118, 0.39002, 0.0, 0.0, 0.0), + cp_ + ( + 1997.28465831951, + -2.13258758137322, + 0.0102964828202421, + 0.0, + 0.0, + 0.0 + ), + h_ + ( + -2902186.5403246, + 1997.28465831951, + -1.06629379068661, + 0.00343216094008069, + 0.0, + 0.0 + ), + cpg_(1211.4601343746, 4088.0977523005, 1694.6, 2748.99335089409, 761.6), + B_ + ( + 0.0022859927822969, + -2.32080485512376, + -430509.300625457, + 1.93787205402834e+17, + -7.17128700233241e+19 + ), + mu_(-20.715, 1207.5, 1.4993, 0.0, 0.0), + mug_(1.7514e-07, 0.70737, 157.14, 0.0), + K_(0.22492, -0.0003533, 0.0, 0.0, 0.0, 0.0), + Kg_(-650.5, 0.8053, -1412100000, 0.0), + sigma_(507.60, 0.055003, 1.2674, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 86.177, 28) // note: Same as nHeptane +{} + + +Foam::C6H14::C6H14 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C6H14, 0); -addToRunTimeSelectionTable(liquid, C6H14,); -addToRunTimeSelectionTable(liquid, C6H14, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C6H14::C6H14(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C6H14/C6H14.H b/src/thermophysicalModels/liquids/C6H14/C6H14.H index 46f1c0766ca8db147c5e34156826d58971dfd7d6..919d68bfd68e5381c126e7fb250ae8348b23aa9a 100644 --- a/src/thermophysicalModels/liquids/C6H14/C6H14.H +++ b/src/thermophysicalModels/liquids/C6H14/C6H14.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - C6H14() - : - liquid(86.177, 507.60, 3.025e+6, 0.371, 0.266, 177.83, 9.017e-1, 341.88, 0.0, 0.3013, 1.49e+4), - rho_(61.03399848, 0.26411, 507.6, 0.27537), - pv_(104.65, -6995.5, -12.702, 1.2381e-05, 2), - hl_(507.60, 527286.863084118, 0.39002, 0, 0, 0), - cp_(1997.28465831951, -2.13258758137322, 0.0102964828202421, 0, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-2902186.5403246, 1997.28465831951, -1.06629379068661, 0.00343216094008069, 0, 0), - cpg_(1211.4601343746, 4088.0977523005, 1694.6, 2748.99335089409, 761.6), - B_(0.0022859927822969, -2.32080485512376, -430509.300625457, 1.93787205402834e+17, -7.17128700233241e+19), - mu_(-20.715, 1207.5, 1.4993, 0, 0), - mug_(1.7514e-07, 0.70737, 157.14, 0), - K_(0.22492, -0.0003533, 0, 0, 0, 0), - Kg_(-650.5, 0.8053, -1412100000, 0), - sigma_(507.60, 0.055003, 1.2674, 0, 0, 0), - D_(147.18, 20.1, 86.177, 28) // NN: Same as nHeptane - {} + C6H14(); + + //- Construct from components C6H14 ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C6H14(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C6H14(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C6H14& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C6H14I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C6H14/C6H14I.H b/src/thermophysicalModels/liquids/C6H14/C6H14I.H new file mode 100644 index 0000000000000000000000000000000000000000..144648c0a71c2d091f0635e1800a8e2129569857 --- /dev/null +++ b/src/thermophysicalModels/liquids/C6H14/C6H14I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C6H14::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C6H14::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C6H14::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C6H14::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C6H14::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C6H14::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C6H14::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C6H14::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C6H14::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C6H14::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C6H14::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C6H14::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C6H14::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C6H6/C6H6.C b/src/thermophysicalModels/liquids/C6H6/C6H6.C index 3e17819e6ad2204649c453122e257154e6f79b46..4b3abbd24d0bce010596f09bd4960078e96de0ba 100644 --- a/src/thermophysicalModels/liquids/C6H6/C6H6.C +++ b/src/thermophysicalModels/liquids/C6H6/C6H6.C @@ -27,19 +27,124 @@ License #include "C6H6.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C6H6, 0); + addToRunTimeSelectionTable(liquid, C6H6,); + addToRunTimeSelectionTable(liquid, C6H6, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::C6H6::C6H6() +: + liquid + ( + 78.114, + 562.16, + 4.898e+6, + 0.25894, + 0.271, + 278.68, + 4.7961e+3, + 353.24, + 0.0, + 0.2108, + 1.8706e+4 + ), + rho_(80.5511568, 0.2667, 562.16, 0.2818), + pv_(78.05, -6275.5, -8.4443, 6.26e-06, 2), + hl_(562.16, 649435.440510024, 0.7616, -0.5052, 0.1564, 0), + cp_ + ( + 1386.69124612745, + -0.416058581048212, + 0.00542796425736744, + 0.0, + 0.0, + 0.0 + ), + h_ + ( + 186141.395065592, + 1386.69124612745, + -0.208029290524106, + 0.00180932141912248, + 0.0, + 0.0 + ), + cpg_(568.656066774202, 2970.65826868423, 1494.6, 2203.57426325627, -678.15), + B_ + ( + 0.00184089919860716, + -2.30176408838364, + -309176.332027549, + -5.12072099751645e+15, + -2.90216862534245e+19 + ), + mu_(6.764, 336.4, -2.687, 0.0, 0.0), + mug_(3.134e-08, 0.9676, 7.9, 0.0), + K_(0.2407, -0.0003202, 0.0, 0.0, 0.0, 0.0), + Kg_(1.652e-05, 1.3117, 491, 0.0), + sigma_(562.16, 0.07195, 1.2389, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 78.114, 28) // note: Same as nHeptane +{} + + +Foam::C6H6::C6H6 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C6H6, 0); -addToRunTimeSelectionTable(liquid, C6H6,); -addToRunTimeSelectionTable(liquid, C6H6, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C6H6::C6H6(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C6H6/C6H6.H b/src/thermophysicalModels/liquids/C6H6/C6H6.H index 58b04a293946f7c4def35c2a74721c83abd95e71..cc9c5ac1f100fbcf7760351d49e022a651ca3e46 100644 --- a/src/thermophysicalModels/liquids/C6H6/C6H6.H +++ b/src/thermophysicalModels/liquids/C6H6/C6H6.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - C6H6() - : - liquid(78.114, 562.16, 4.898e+6, 0.25894, 0.271, 278.68, 4.7961e+3, 353.24, 0.0, 0.2108, 1.8706e+4), - rho_(80.5511568, 0.2667, 562.16, 0.2818), - pv_(78.05, -6275.5, -8.4443, 6.26e-06, 2), - hl_(562.16, 649435.440510024, 0.7616, -0.5052, 0.1564, 0), - cp_(1386.69124612745, -0.416058581048212, 0.00542796425736744, 0, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(186141.395065592, 1386.69124612745, -0.208029290524106, 0.00180932141912248, 0, 0), - cpg_(568.656066774202, 2970.65826868423, 1494.6, 2203.57426325627, -678.15), - B_(0.00184089919860716, -2.30176408838364, -309176.332027549, -5.12072099751645e+15, -2.90216862534245e+19), - mu_(6.764, 336.4, -2.687, 0, 0), - mug_(3.134e-08, 0.9676, 7.9, 0), - K_(0.2407, -0.0003202, 0, 0, 0, 0), - Kg_(1.652e-05, 1.3117, 491, 0), - sigma_(562.16, 0.07195, 1.2389, 0, 0, 0), - D_(147.18, 20.1, 78.114, 28) // NN: Same as nHeptane - {} + C6H6(); + + //- Comstruct from components C6H6 ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C6H6(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C6H6(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; - //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + //- Liquid thermal conductivity [W/(m K)] + inline scalar K(scalar p, scalar T) const; - //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + //- Vapour thermal conductivity [W/(m K)] + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C6H6& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C6H6I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C6H6/C6H6I.H b/src/thermophysicalModels/liquids/C6H6/C6H6I.H new file mode 100644 index 0000000000000000000000000000000000000000..3aca0ee525af1a8bc688967efa34596ad0fa4914 --- /dev/null +++ b/src/thermophysicalModels/liquids/C6H6/C6H6I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C6H6::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C6H6::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C6H6::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C6H6::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C6H6::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C6H6::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C6H6::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C6H6::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C6H6::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C6H6::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C6H6::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C6H6::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C6H6::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C7H16/C7H16.C b/src/thermophysicalModels/liquids/C7H16/C7H16.C index 0cc7e69f0ab412c63440f9e4412d00155ae8c85f..846671927b899f9d641a205856cfa24f11423c23 100644 --- a/src/thermophysicalModels/liquids/C7H16/C7H16.C +++ b/src/thermophysicalModels/liquids/C7H16/C7H16.C @@ -27,19 +27,115 @@ License #include "C7H16.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C7H16, 0); + addToRunTimeSelectionTable(liquid, C7H16,); + addToRunTimeSelectionTable(liquid, C7H16, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::C7H16::C7H16() +: + liquid + ( + 100.204, + 540.20, + 2.74e+6, + 0.428, + 0.261, + 182.57, + 1.8269e-1, + 371.58, + 0.0, + 0.3495, + 1.52e+4 + ), + rho_(61.38396836, 0.26211, 540.2, 0.28141), + pv_(87.829, -6996.4, -9.8802, 7.2099e-06, 2.0), + hl_(540.20, 499121.791545248, 0.38795, 0.0, 0.0, 0.0), + cp_ + ( + 540.20, + 6.11976102401216, + 3137.69909384855, + 182.274175063868, + -254.530511150515 + ), + h_(-3.1469964e+6,7.3072e+3,-3.52884e+1,1.10637e-1,-1.634831e-4,9.64941e-8), + cpg_(1199.05392998284, 3992.85457666361, 1676.6, 2734.42177956968, 756.4), + B_ + ( + 0.00274040956448844, + -2.90407568560137, + -440900.562851782, + -8.78208454752305e+17, + 1.28238393676899e+20 + ), + mu_(-24.451, 1533.1, 2.0087, 0.0, 0.0), + mug_(6.672e-08, 0.82837, 85.752, 0.0), + K_(0.215, -0.000303, 0.0, 0.0, 0.0, 0.0), + Kg_(-0.070028, 0.38068, -7049.9, -2400500.0), + sigma_(540.20, 0.054143, 1.2512, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 100.204, 28.0) // note: Same as C7H16 +{} + + +Foam::C7H16::C7H16 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc14& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C7H16, 0); -addToRunTimeSelectionTable(liquid, C7H16,); -addToRunTimeSelectionTable(liquid, C7H16, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C7H16::C7H16(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C7H16/C7H16.H b/src/thermophysicalModels/liquids/C7H16/C7H16.H index 64264aebfba0246ca129b915c1d37c50396f4c38..617cffb04b39d36f12b19fbbcdf430ccec09edaa 100644 --- a/src/thermophysicalModels/liquids/C7H16/C7H16.H +++ b/src/thermophysicalModels/liquids/C7H16/C7H16.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - C7H16() - : - liquid(100.204, 540.20, 2.74e+6, 0.428, 0.261, 182.57, 1.8269e-1, 371.58, 0, 0.3495, 1.52e+4), - rho_(61.38396836, 0.26211, 540.2, 0.28141), - pv_(87.829, -6996.4, -9.8802, 7.2099e-06, 2), - hl_(540.20, 499121.791545248, 0.38795, 0, 0, 0), - cp_(540.20, 6.11976102401216, 3137.69909384855, 182.274175063868, -254.530511150515), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-3.1469964e+6,7.3072e+3,-3.52884e+1,1.10637e-1,-1.634831e-4,9.64941e-8), - cpg_(1199.05392998284, 3992.85457666361, 1676.6, 2734.42177956968, 756.4), - B_(0.00274040956448844, -2.90407568560137, -440900.562851782, -8.78208454752305e+17, 1.28238393676899e+20), - mu_(-24.451, 1533.1, 2.0087, 0, 0), - mug_(6.672e-08, 0.82837, 85.752, 0), - K_(0.215, -0.000303, 0, 0, 0, 0), - Kg_(-0.070028, 0.38068, -7049.9, -2400500), - sigma_(540.20, 0.054143, 1.2512, 0, 0, 0), - D_(147.18, 20.1, 100.204, 28) // NN: Same as C7H16 - {} + C7H16(); + + //- Construct from components C7H16 ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C7H16(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C7H16(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C7H16& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C7H16I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C7H16/C7H16I.H b/src/thermophysicalModels/liquids/C7H16/C7H16I.H new file mode 100644 index 0000000000000000000000000000000000000000..27eb0761e148398225f7b796263e7043f975c6ab --- /dev/null +++ b/src/thermophysicalModels/liquids/C7H16/C7H16I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C7H16::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C7H16::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C7H16::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C7H16::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C7H16::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C7H16::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C7H16::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C7H16::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C7H16::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C7H16::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C7H16::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C7H16::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C7H16::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C7H8/C7H8.C b/src/thermophysicalModels/liquids/C7H8/C7H8.C index cfa8bda4b7a93d5bcbeb3bdf1dc268d22eb5cff2..9d58afe0143c7c6ab8b3d2a82e979dd66b7ac3c7 100644 --- a/src/thermophysicalModels/liquids/C7H8/C7H8.C +++ b/src/thermophysicalModels/liquids/C7H8/C7H8.C @@ -27,19 +27,124 @@ License #include "C7H8.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C7H8, 0); + addToRunTimeSelectionTable(liquid, C7H8,); + addToRunTimeSelectionTable(liquid, C7H8, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::C7H8::C7H8() +: + liquid + ( + 92.141, + 591.79, + 4.1086e+6, + 0.31579, + 0.264, + 178.18, + 4.1009e-2, + 383.78, + 1.2008e-30, + 0.2641, + 1.8346e+4 + ), + rho_(81.32088237, 0.27108, 591.79, 0.29889), + pv_(83.359, -6995, -9.1635, 6.225e-06, 2.0), + hl_(591.79, 544383.065085033, 0.3834, 0.0, 0.0, 0.0), + cp_ + ( + 2066.83235476064, + -8.14664481609707, + 0.0322581695445024, + -3.01223125427334e-05, + 0.0, + 0.0 + ), + h_ + ( + -353094.830249075, + 2066.83235476064, + -4.07332240804853, + 0.0107527231815008, + -7.53057813568336e-06, + 0.0 + ), + cpg_(630.989461803106, 3107.19440856947, 1440.6, 2059.88647833212, -650.43), + B_ + ( + 0.00191120131103418, + -2.24970425760519, + -482293.441573241, + -7.62309938029759e+17, + 1.00986531511488e+20 + ), + mu_(-13.362, 1183, 0.333, 0.0, 0.0), + mug_(2.919e-08, 0.9648, 0.0, 0.0), + K_(0.2043, -0.000239, 0.0, 0.0, 0.0, 0.0), + Kg_(2.392e-05, 1.2694, 537, 0.0), + sigma_(591.79, 0.06685, 1.2456, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 92.141, 28) // note: Same as nHeptane +{} + + +Foam::C7H8::C7H8 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C7H8, 0); -addToRunTimeSelectionTable(liquid, C7H8,); -addToRunTimeSelectionTable(liquid, C7H8, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C7H8::C7H8(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C7H8/C7H8.H b/src/thermophysicalModels/liquids/C7H8/C7H8.H index 1e8e6ac734d19c61f2b87b9ae50f94edbcdfacd4..8d0afcf8cb2cfbc5e0aee953142244cc2fc6237f 100644 --- a/src/thermophysicalModels/liquids/C7H8/C7H8.H +++ b/src/thermophysicalModels/liquids/C7H8/C7H8.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - C7H8() - : - liquid(92.141, 591.79, 4.1086e+6, 0.31579, 0.264, 178.18, 4.1009e-2, 383.78, 1.2008e-30, 0.2641, 1.8346e+4), - rho_(81.32088237, 0.27108, 591.79, 0.29889), - pv_(83.359, -6995, -9.1635, 6.225e-06, 2), - hl_(591.79, 544383.065085033, 0.3834, 0, 0, 0), - cp_(2066.83235476064, -8.14664481609707, 0.0322581695445024, -3.01223125427334e-05, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-353094.830249075, 2066.83235476064, -4.07332240804853, 0.0107527231815008, -7.53057813568336e-06, 0), - cpg_(630.989461803106, 3107.19440856947, 1440.6, 2059.88647833212, -650.43), - B_(0.00191120131103418, -2.24970425760519, -482293.441573241, -7.62309938029759e+17, 1.00986531511488e+20), - mu_(-13.362, 1183, 0.333, 0, 0), - mug_(2.919e-08, 0.9648, 0, 0), - K_(0.2043, -0.000239, 0, 0, 0, 0), - Kg_(2.392e-05, 1.2694, 537, 0), - sigma_(591.79, 0.06685, 1.2456, 0, 0, 0), - D_(147.18, 20.1, 92.141, 28) // NN: Same as nHeptane - {} + C7H8(); + + //- Construct from components C7H8 ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C7H8(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C7H8(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C7H8& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C7H8I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C7H8/C7H8I.H b/src/thermophysicalModels/liquids/C7H8/C7H8I.H new file mode 100644 index 0000000000000000000000000000000000000000..02813a18f8feb5b33e3e296f22ff7564b2a9b622 --- /dev/null +++ b/src/thermophysicalModels/liquids/C7H8/C7H8I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C7H8::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C7H8::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C7H8::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C7H8::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C7H8::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C7H8::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C7H8::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C7H8::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C7H8::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C7H8::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C7H8::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C7H8::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C7H8::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C8H10/C8H10.C b/src/thermophysicalModels/liquids/C8H10/C8H10.C index 7b0bbede52314acba7f993ac35b9de6f5016b504..09263031d6dea4782142434f506e767a4fc1e5fb 100644 --- a/src/thermophysicalModels/liquids/C8H10/C8H10.C +++ b/src/thermophysicalModels/liquids/C8H10/C8H10.C @@ -27,19 +27,124 @@ License #include "C8H10.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C8H10, 0); + addToRunTimeSelectionTable(liquid, C8H10,); + addToRunTimeSelectionTable(liquid, C8H10, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::C8H10::C8H10() +: + liquid + ( + 106.167, + 617.17, + 3.6094e+6, + 0.37381, + 0.263, + 178.15, + 4.038e-3, + 409.35, + 1.9680e-30, + 0.3036, + 1.8043e+4 + ), + rho_(76.3765398, 0.26438, 617.17, 0.2921), + pv_(88.246, -7691.1, -9.797, 5.931e-06, 2.0), + hl_(617.17, 516167.924119547, 0.3882, 0.0, 0.0, 0.0), + cp_ + ( + 818.521762883005, + 6.66873887366131, + -0.0248005500767658, + 4.23860521631015e-05, + 0.0, + 0.0 + ), + h_ + ( + -524002.612929508, + 818.521762883005, + 3.33436943683065, + -0.00826685002558862, + 1.05965130407754e-05, + 0.0 + ), + cpg_(738.835984816374, 3201.5598067196, 1559, 2285.07916772632, -702.0), + B_ + ( + 0.00165776559571242, + -2.77958310962917, + -388067.855359952, + -5.86905535618412e+18, + 1.58052878954854e+21 + ), + mu_(-10.452, 1048.4, -0.0715, 0.0, 0.0), + mug_(1.2e-06, 0.4518, 439.0, 0.0), + K_(0.20149, -0.00023988, 0.0, 0.0, 0.0, 0.0), + Kg_(1.708e-05, 1.319, 565.6, 0.0), + sigma_(617.17, 0.066, 1.268, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 106.167, 28.0) // note: Same as nHeptane +{} + + +Foam::C8H10::C8H10 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C8H10, 0); -addToRunTimeSelectionTable(liquid, C8H10,); -addToRunTimeSelectionTable(liquid, C8H10, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C8H10::C8H10(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C8H10/C8H10.H b/src/thermophysicalModels/liquids/C8H10/C8H10.H index a08832ab7c267da69ef6d3a4480389d59356dcc5..6301c555cc71bf048d5c8fb816904536aaccd0c4 100644 --- a/src/thermophysicalModels/liquids/C8H10/C8H10.H +++ b/src/thermophysicalModels/liquids/C8H10/C8H10.H @@ -86,26 +86,9 @@ public: // Constructors //- Construct null - C8H10() - : - liquid(106.167, 617.17, 3.6094e+6, 0.37381, 0.263, 178.15, 4.038e-3, 409.35, 1.9680e-30, 0.3036, 1.8043e+4), - rho_(76.3765398, 0.26438, 617.17, 0.2921), - pv_(88.246, -7691.1, -9.797, 5.931e-06, 2), - hl_(617.17, 516167.924119547, 0.3882, 0, 0, 0), - cp_(818.521762883005, 6.66873887366131, -0.0248005500767658, 4.23860521631015e-05, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-524002.612929508, 818.521762883005, 3.33436943683065, -0.00826685002558862, 1.05965130407754e-05, 0), - cpg_(738.835984816374, 3201.5598067196, 1559, 2285.07916772632, -702), - B_(0.00165776559571242, -2.77958310962917, -388067.855359952, -5.86905535618412e+18, 1.58052878954854e+21), - mu_(-10.452, 1048.4, -0.0715, 0, 0), - mug_(1.2e-06, 0.4518, 439, 0), - K_(0.20149, -0.00023988, 0, 0, 0, 0), - Kg_(1.708e-05, 1.319, 565.6, 0), - sigma_(617.17, 0.066, 1.268, 0, 0, 0), - D_(147.18, 20.1, 106.167, 28) // NN: Same as nHeptane - {} + C8H10(); + + // Construct from components C8H10 ( const liquid& l, @@ -122,125 +105,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C8H10(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C8H10(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -259,9 +173,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C8H10& l) { l.writeData(os); @@ -276,6 +188,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C8H10I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C8H10/C8H10I.H b/src/thermophysicalModels/liquids/C8H10/C8H10I.H new file mode 100644 index 0000000000000000000000000000000000000000..58ee6c81a94e85971fb006bdd67ab0bea82353a9 --- /dev/null +++ b/src/thermophysicalModels/liquids/C8H10/C8H10I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C8H10::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C8H10::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C8H10::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C8H10::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C8H10::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C8H10::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C8H10::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C8H10::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C8H10::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C8H10::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C8H10::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C8H10::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C8H10::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C8H18/C8H18.C b/src/thermophysicalModels/liquids/C8H18/C8H18.C index dac83519ca9b7611a91f909c30be9d5e85cc9751..ea9c3f3ed5581dca9e0c6788cf00567aaaaeb754 100644 --- a/src/thermophysicalModels/liquids/C8H18/C8H18.C +++ b/src/thermophysicalModels/liquids/C8H18/C8H18.C @@ -27,19 +27,124 @@ License #include "C8H18.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C8H18, 0); + addToRunTimeSelectionTable(liquid, C8H18,); + addToRunTimeSelectionTable(liquid, C8H18, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::C8H18::C8H18() +: + liquid + ( + 114.231, + 568.70, + 2.49e+6, + 0.486, + 0.256, + 216.38, + 2.1083, + 398.83, + 0.0, + 0.3996, + 1.54e+4 + ), + rho_(61.37745861, 0.26115, 568.7, 0.28034), + pv_(96.084, -7900.2, -11.003, 7.1802e-06, 2.0), + hl_(568.70, 483056.263186, 0.38467, 0.0, 0.0, 0.0), + cp_ + ( + 1968.20477803749, + -1.63379467920267, + 0.00839448135795012, + 0.0, + 0.0, + 0.0 + ), + h_ + ( + -2778787.734126, + 1968.20477803749, + -0.816897339601334, + 0.00279816045265004, + 0.0, + 0.0 + ), + cpg_(1186.54305748877, 3878.9820626625, 1635.6, 2673.52995246474, 746.4), + B_ + ( + 0.00239777293379205, + -2.81394717721109, + -585042.589139551, + -1.11265768486663e+18, + 1.40968738783693e+20 + ), + mu_(-20.463, 1497.4, 1.379, 0.0, 0.0), + mug_(3.1191e-08, 0.92925, 55.092, 0.0), + K_(0.2156, -0.00029483, 0.0, 0.0, 0.0, 0.0), + Kg_(-8758, 0.8448, -27121000000.0, 0.0), + sigma_(568.70, 0.052789, 1.2323, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 114.231, 28.0) // note: Same as nHeptane +{} + + +Foam::C8H18::C8H18 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C8H18, 0); -addToRunTimeSelectionTable(liquid, C8H18,); -addToRunTimeSelectionTable(liquid, C8H18, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C8H18::C8H18(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C8H18/C8H18.H b/src/thermophysicalModels/liquids/C8H18/C8H18.H index 4656d86236675fe3459cc96d2e186ed1e1caa821..20f4f5aa111df78e22bf8185f306a120c5a3791c 100644 --- a/src/thermophysicalModels/liquids/C8H18/C8H18.H +++ b/src/thermophysicalModels/liquids/C8H18/C8H18.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - C8H18() - : - liquid(114.231, 568.70, 2.49e+6, 0.486, 0.256, 216.38, 2.1083, 398.83, 0.0, 0.3996, 1.54e+4), - rho_(61.37745861, 0.26115, 568.7, 0.28034), - pv_(96.084, -7900.2, -11.003, 7.1802e-06, 2), - hl_(568.70, 483056.263186, 0.38467, 0, 0, 0), - cp_(1968.20477803749, -1.63379467920267, 0.00839448135795012, 0, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-2778787.734126, 1968.20477803749, -0.816897339601334, 0.00279816045265004, 0, 0), - cpg_(1186.54305748877, 3878.9820626625, 1635.6, 2673.52995246474, 746.4), - B_(0.00239777293379205, -2.81394717721109, -585042.589139551, -1.11265768486663e+18, 1.40968738783693e+20), - mu_(-20.463, 1497.4, 1.379, 0, 0), - mug_(3.1191e-08, 0.92925, 55.092, 0), - K_(0.2156, -0.00029483, 0, 0, 0, 0), - Kg_(-8758, 0.8448, -27121000000.0, 0), - sigma_(568.70, 0.052789, 1.2323, 0, 0, 0), - D_(147.18, 20.1, 114.231, 28) // NN: Same as nHeptane - {} + C8H18(); + + //- Construct from components C8H18 ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C8H18(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C8H18(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; - //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + //- Vapour pressure [Pa]; + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C8H18& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C8H18I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C8H18/C8H18I.H b/src/thermophysicalModels/liquids/C8H18/C8H18I.H new file mode 100644 index 0000000000000000000000000000000000000000..3844155a37b548a5ff54892e01afb253c4da56dc --- /dev/null +++ b/src/thermophysicalModels/liquids/C8H18/C8H18I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C8H18::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C8H18::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C8H18::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C8H18::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C8H18::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C8H18::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C8H18::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C8H18::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C8H18::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C8H18::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C8H18::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C8H18::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C8H18::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C9H20/C9H20.C b/src/thermophysicalModels/liquids/C9H20/C9H20.C index c9e321e46b05834302f42b2a53aa2eb26811e6e1..a2e6309c9917b78089d0397cb76e11519b82d004 100644 --- a/src/thermophysicalModels/liquids/C9H20/C9H20.C +++ b/src/thermophysicalModels/liquids/C9H20/C9H20.C @@ -27,19 +27,124 @@ License #include "C9H20.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(C9H20, 0); + addToRunTimeSelectionTable(liquid, C9H20,); + addToRunTimeSelectionTable(liquid, C9H20, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::C9H20::C9H20() +: + liquid + ( + 128.258, + 594.60, + 2.29e+6, + 0.544, + 0.252, + 219.66, + 4.3058e-1, + 423.97, + 0.0, + 0.4435, + 1.56e+4 + ), + rho_(62.06019846, 0.26147, 594.6, 0.28281), + pv_(109.35, -90304.0, -12.882, 7.8544e-06, 2.0), + hl_(594.60, 470691.886665939, 0.38522, 0.0, 0.0, 0.0), + cp_ + ( + 2986.79224687739, + -8.88677509395125, + 0.0211300659607978, + 0.0, + 0.0, + 0.0 + ), + h_ + ( + -2825628.50868792, + 2986.79224687739, + -4.44338754697563, + 0.00704335532026592, + 0.0, + 0.0 + ), + cpg_(1183.16206396482, 3832.11963386299, 1644.8, 2705.48425829188, 749.6), + B_ + ( + 0.00304542406711472, + -3.65357326638494, + -520825.211682702, + -6.15400208953827e+18, + 1.41901479829718e+21 + ), + mu_(-21.149, 1658, 1.454, 0.0, 0.0), + mug_(1.0344e-07, 0.77301, 220.47, 0.0), + K_(0.209, -0.000264, 0.0, 0.0, 0.0, 0.0), + Kg_(-0.065771, 0.27198, -3482.3, -1580300.0), + sigma_(594.60, 0.054975, 1.2897, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 128.258, 28.0) // note: Same as nHeptane +{} + + +Foam::C9H20::C9H20 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(C9H20, 0); -addToRunTimeSelectionTable(liquid, C9H20,); -addToRunTimeSelectionTable(liquid, C9H20, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::C9H20::C9H20(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C9H20/C9H20.H b/src/thermophysicalModels/liquids/C9H20/C9H20.H index 015bde640fff3f37cbcf9457537eb1c627adb0a6..be28728d4f763f057aadc9722424d2f42c3f2361 100644 --- a/src/thermophysicalModels/liquids/C9H20/C9H20.H +++ b/src/thermophysicalModels/liquids/C9H20/C9H20.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - C9H20() - : - liquid(128.258, 594.60, 2.29e+6, 0.544, 0.252, 219.66, 4.3058e-1, 423.97, 0, 0.4435, 1.56e+4), - rho_(62.06019846, 0.26147, 594.6, 0.28281), - pv_(109.35, -90304, -12.882, 7.8544e-06, 2), - hl_(594.60, 470691.886665939, 0.38522, 0, 0, 0), - cp_(2986.79224687739, -8.88677509395125, 0.0211300659607978, 0, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-2825628.50868792, 2986.79224687739, -4.44338754697563, 0.00704335532026592, 0, 0), - cpg_(1183.16206396482, 3832.11963386299, 1644.8, 2705.48425829188, 749.6), - B_(0.00304542406711472, -3.65357326638494, -520825.211682702, -6.15400208953827e+18, 1.41901479829718e+21), - mu_(-21.149, 1658, 1.454, 0, 0), - mug_(1.0344e-07, 0.77301, 220.47, 0), - K_(0.209, -0.000264, 0, 0, 0, 0), - Kg_(-0.065771, 0.27198, -3482.3, -1580300), - sigma_(594.60, 0.054975, 1.2897, 0, 0, 0), - D_(147.18, 20.1, 128.258, 28) // NN: Same as nHeptane - {} + C9H20(); + + //- Construct from components C9H20 ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - C9H20(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + C9H20(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const C9H20& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "C9H20I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C9H20/C9H20I.H b/src/thermophysicalModels/liquids/C9H20/C9H20I.H new file mode 100644 index 0000000000000000000000000000000000000000..d478264307aded97e58186360134438e7ca8859c --- /dev/null +++ b/src/thermophysicalModels/liquids/C9H20/C9H20I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::C9H20::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::C9H20::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::C9H20::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::C9H20::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::C9H20::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::C9H20::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::C9H20::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::C9H20::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::C9H20::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::C9H20::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::C9H20::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::C9H20::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::C9H20::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/CH3OH/CH3OH.C b/src/thermophysicalModels/liquids/CH3OH/CH3OH.C index 8a562084d7a28be283ebdf75221b42be7cbad59f..64f322b4b1909630ff6ab67b020495c4a5b3f166 100644 --- a/src/thermophysicalModels/liquids/CH3OH/CH3OH.C +++ b/src/thermophysicalModels/liquids/CH3OH/CH3OH.C @@ -27,19 +27,124 @@ License #include "CH3OH.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(CH3OH, 0); + addToRunTimeSelectionTable(liquid, CH3OH,); + addToRunTimeSelectionTable(liquid, CH3OH, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::CH3OH::CH3OH() +: + liquid + ( + 32.042, + 512.58, + 8.0959e+6, + 0.1178, + 0.224, + 175.47, + 1.054e-1, + 337.85, + 5.6706e-30, + 0.5656, + 2.9523e+4 + ), + rho_(73.952936, 0.27192, 512.58, 0.2331), + pv_(109.93, -7471.3, -13.988, 0.015281, 1.0), + hl_(512.58, 1644716.30984333, 0.3766, 0.0, 0.0, 0.0), + cp_ + ( + 3358.09250358904, + -11.8781599151114, + 0.0305536483365583, + 0.0, + 0.0, + 0.0 + ), + h_ + ( + -8190474.32066862, + 3358.09250358904, + -5.93907995755571, + 0.0101845494455194, + 0.0, + 0.0 + ), + cpg_(1226.9521253355, 2772.92303851195, 1963, 1733.66206853505, 909.6), + B_ + ( + -0.0199737844079645, + 19.3496036452157, + -3342487.98452032, + 2.40808938268523e+19, + -6.85787404032208e+21 + ), + mu_(-7.288, 1065.3, -0.6657, 0.0, 0.0), + mug_(3.0663e-07, 0.69655, 205.0, 0.0), + K_(0.2837, -0.000281, 0.0, 0.0, 0.0, 0.0), + Kg_(-7.763, 1.0279, -74360000.0, 6770000000.0), + sigma_(512.58, 0.056, -0.00014583, 1.08e-07, 0.0, 0.0), + D_(147.18, 20.1, 32.042, 28.0) // note: Same as nHeptane +{} + + +Foam::CH3OH::CH3OH +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(CH3OH, 0); -addToRunTimeSelectionTable(liquid, CH3OH,); -addToRunTimeSelectionTable(liquid, CH3OH, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::CH3OH::CH3OH(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/CH3OH/CH3OH.H b/src/thermophysicalModels/liquids/CH3OH/CH3OH.H index 9fe8d3db96e8a5b25f06be989acffe40559c0211..11deb6a8617afda836335894044d13924e744cb0 100644 --- a/src/thermophysicalModels/liquids/CH3OH/CH3OH.H +++ b/src/thermophysicalModels/liquids/CH3OH/CH3OH.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - CH3OH() - : - liquid(32.042, 512.58, 8.0959e+6, 0.1178, 0.224, 175.47, 1.054e-1, 337.85, 5.6706e-30, 0.5656, 2.9523e+4), - rho_(73.952936, 0.27192, 512.58, 0.2331), - pv_(109.93, -7471.3, -13.988, 0.015281, 1), - hl_(512.58, 1644716.30984333, 0.3766, 0, 0, 0), - cp_(3358.09250358904, -11.8781599151114, 0.0305536483365583, 0, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-8190474.32066862, 3358.09250358904, -5.93907995755571, 0.0101845494455194, 0, 0), - cpg_(1226.9521253355, 2772.92303851195, 1963, 1733.66206853505, 909.6), - B_(-0.0199737844079645, 19.3496036452157, -3342487.98452032, 2.40808938268523e+19, -6.85787404032208e+21), - mu_(-7.288, 1065.3, -0.6657, 0, 0), - mug_(3.0663e-07, 0.69655, 205, 0), - K_(0.2837, -0.000281, 0, 0, 0, 0), - Kg_(-7.763, 1.0279, -74360000.0, 6770000000.0), - sigma_(512.58, 0.056, -0.00014583, 1.08e-07, 0, 0), - D_(147.18, 20.1, 32.042, 28) // NN: Same as nHeptane - {} + CH3OH(); + + //- Construct from components CH3OH ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - CH3OH(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + CH3OH(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const CH3OH& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "CH3OHI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/CH3OH/CH3OHI.H b/src/thermophysicalModels/liquids/CH3OH/CH3OHI.H new file mode 100644 index 0000000000000000000000000000000000000000..28c56dde5481f408930a5a17c743597d82375f18 --- /dev/null +++ b/src/thermophysicalModels/liquids/CH3OH/CH3OHI.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::CH3OH::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::CH3OH::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::CH3OH::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::CH3OH::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::CH3OH::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::CH3OH::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::CH3OH::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::CH3OH::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::CH3OH::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::CH3OH::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::CH3OH::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::CH3OH::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::CH3OH::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/CH4N2O/CH4N2O.C b/src/thermophysicalModels/liquids/CH4N2O/CH4N2O.C index 32e601952ffbfc9c2a297c58fd235802cf4a5540..d1b0ac261006c113e0e05ad56b5edb5986ed2ce9 100644 --- a/src/thermophysicalModels/liquids/CH4N2O/CH4N2O.C +++ b/src/thermophysicalModels/liquids/CH4N2O/CH4N2O.C @@ -30,19 +30,108 @@ Description #include "CH4N2O.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(CH4N2O, 0); + addToRunTimeSelectionTable(liquid, CH4N2O,); + addToRunTimeSelectionTable(liquid, CH4N2O, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::CH4N2O::CH4N2O() +: + liquid + ( + 60.056, + 705.0, + 9.050e+6, + 0.218, + 0.337, + 405.85, + 9.3131e+1, + 465.0, + 1.52e-29, + 0.3449, + 4.7813e+4 + ), + rho_(1230.006936, 0.0, 0.0, 0.0, 0.0, 0.0), + pv_(3015.15611544, -185497.059684, -430.223621983, 0.00017405122622, 2.0), + hl_(705.0, 2534249.0, 0.5, 0.0, 0.0, 0.0), + cp_(2006.46063673904, 0.0, 0.0, 0.0, 0.0, 0.0), + h_(-6154107.41641135, 2006.46063673904, 0.0, 0.0, 0.0, 0.0), + cpg_(811.875582789397, 2099.04089516451, 1627.3, 1603.63660583455, 724.41), + B_ + ( + -0.000383641934194752, + 0.447249234048222, + -469062.208605302, + 5.5628080458239e+18, + -2.3040162514986e+21 + ), + mu_(-51.964, 3670.6, 5.7331, -5.3495e-29, 10.0), + mug_(2.6986e-06, 0.498, 1257.7, -19570.0), + K_(-0.4267, 0.0056903, -8.0065e-06, 1.815e-09, 0.0, 0.0), + Kg_(6.977e-05, 1.1243, 844.9, -148850.0), + sigma_(705.0, 1.0, 0.0, 0.0, 0.0, 0.0), // note: set to constant + D_(147.18, 20.1, 60.056, 28.0) // note: Same as nHeptane +{} + + +Foam::CH4N2O::CH4N2O +( + const liquid& l, + const NSRDSfunc0& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(CH4N2O, 0); -addToRunTimeSelectionTable(liquid, CH4N2O,); -addToRunTimeSelectionTable(liquid, CH4N2O, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::CH4N2O::CH4N2O(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/CH4N2O/CH4N2O.H b/src/thermophysicalModels/liquids/CH4N2O/CH4N2O.H index 2b5b4f4ae5259d787b165eb4777ddb913bf727f6..bcfbbd62ef4dfa66fd4c4e8c6e40f4f144e0f1fc 100644 --- a/src/thermophysicalModels/liquids/CH4N2O/CH4N2O.H +++ b/src/thermophysicalModels/liquids/CH4N2O/CH4N2O.H @@ -26,7 +26,8 @@ Class Foam::CH4N2O Description - urea, note that some of the properties are unavailable in the literature and have been copied from water. + urea, note that some of the properties are unavailable in the literature + and have been copied from water. SourceFiles CH4N2O.C @@ -86,23 +87,9 @@ public: // Constructors //- Construct null - CH4N2O() - : - liquid(60.056, 705.0, 9.050e+6, 0.218, 0.337, 405.85, 9.3131e+1, 465.0, 1.52e-29, 0.3449, 4.7813e+4), - rho_(1230.006936, 0, 0, 0, 0, 0), - pv_(3015.15611544, -185497.059684, -430.223621983, 0.00017405122622, 2.0), - hl_(705.0, 2534249.0, 0.5, 0.0, 0.0, 0.0), - cp_(2006.46063673904, 0, 0, 0, 0, 0), - h_(-6154107.41641135, 2006.46063673904, 0, 0, 0, 0), - cpg_(811.875582789397, 2099.04089516451, 1627.3, 1603.63660583455, 724.41), - B_(-0.000383641934194752, 0.447249234048222, -469062.208605302, 5.5628080458239e+18, -2.3040162514986e+21), - mu_(-51.964, 3670.6, 5.7331, -5.3495e-29, 10), - mug_(2.6986e-06, 0.498, 1257.7, -19570), - K_(-0.4267, 0.0056903, -8.0065e-06, 1.815e-09, 0, 0), - Kg_(6.977e-05, 1.1243, 844.9, -148850), - sigma_(705.0, 1.0, 0.0, 0.0, 0.0, 0), // set to constant - D_(147.18, 20.1, 60.056, 28) // Same as nHeptane - {} + CH4N2O(); + + //- Construct from components CH4N2O ( const liquid& l, @@ -119,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - CH4N2O(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + CH4N2O(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -256,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const CH4N2O& l) { l.writeData(os); @@ -273,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "CH4N2OI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/CH4N2O/CH4N2OI.H b/src/thermophysicalModels/liquids/CH4N2O/CH4N2OI.H new file mode 100644 index 0000000000000000000000000000000000000000..b04233aad1d846ca3b1e0f0827804180a26cc302 --- /dev/null +++ b/src/thermophysicalModels/liquids/CH4N2O/CH4N2OI.H @@ -0,0 +1,106 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::CH4N2O::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::CH4N2O::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::CH4N2O::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::CH4N2O::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::CH4N2O::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::CH4N2O::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::CH4N2O::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::CH4N2O::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::CH4N2O::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::CH4N2O::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::CH4N2O::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::CH4N2O::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::CH4N2O::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // + diff --git a/src/thermophysicalModels/liquids/H2O/H2O.C b/src/thermophysicalModels/liquids/H2O/H2O.C index ae3de412f23c0c44505577586fa91b819fb52c2a..861b39bc4f10f557f57b839adc3c34ad46588881 100644 --- a/src/thermophysicalModels/liquids/H2O/H2O.C +++ b/src/thermophysicalModels/liquids/H2O/H2O.C @@ -27,19 +27,131 @@ License #include "H2O.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(H2O, 0); + addToRunTimeSelectionTable(liquid, H2O,); + addToRunTimeSelectionTable(liquid, H2O, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::H2O::H2O() +: + liquid + ( + 18.015, + 647.13, + 2.2055e+7, + 0.05595, + 0.229, + 273.16, + 6.113e+2, + 373.15, + 6.1709e-30, + 0.3449, + 4.7813e+4 + ), + rho_(98.343885, 0.30542, 647.13, 0.081), + pv_(73.649, -7258.2, -7.3037, 4.1653e-06, 2), + hl_(647.13, 2889425.47876769, 0.3199, -0.212, 0.25795, 0), + cp_ + ( + 15341.1046350264, + -116.019983347211, + 0.451013044684985, + -0.000783569247849015, + 5.20127671384957e-07, + 0 + ), + h_ + ( + -17957283.7993676, + 15341.1046350264, + -58.0099916736053, + 0.150337681561662, + -0.000195892311962254, + 1.04025534276991e-07 + ), + cpg_ + ( + 1851.73466555648, + 1487.53816264224, + 2609.3, + 493.366638912018, + 1167.6 + ), + B_ + ( + -0.0012789342214821, + 1.4909797391063, + -1563696.91923397, + 1.85445462114904e+19, + -7.68082153760755e+21 + ), + mu_(-51.964, 3670.6, 5.7331, -5.3495e-29, 10), + mug_(2.6986e-06, 0.498, 1257.7, -19570), + K_(-0.4267, 0.0056903, -8.0065e-06, 1.815e-09, 0, 0), + Kg_(6.977e-05, 1.1243, 844.9, -148850), + sigma_(647.13, 0.18548, 2.717, -3.554, 2.047, 0), + D_(147.18, 20.1, 18.015, 28) // note: Same as nHeptane +{} + + +Foam::H2O::H2O +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(H2O, 0); -addToRunTimeSelectionTable(liquid, H2O,); -addToRunTimeSelectionTable(liquid, H2O, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::H2O::H2O(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/H2O/H2O.H b/src/thermophysicalModels/liquids/H2O/H2O.H index 698056356151f6d0eedd0db6a0ef918c36dc017a..92287b22161b8c587f8e3735f5b07bc82e18dbd9 100644 --- a/src/thermophysicalModels/liquids/H2O/H2O.H +++ b/src/thermophysicalModels/liquids/H2O/H2O.H @@ -86,26 +86,9 @@ public: // Constructors //- Construct null - H2O() - : - liquid(18.015, 647.13, 2.2055e+7, 0.05595, 0.229, 273.16, 6.113e+2, 373.15, 6.1709e-30, 0.3449, 4.7813e+4), - rho_(98.343885, 0.30542, 647.13, 0.081), - pv_(73.649, -7258.2, -7.3037, 4.1653e-06, 2), - hl_(647.13, 2889425.47876769, 0.3199, -0.212, 0.25795, 0), - cp_(15341.1046350264, -116.019983347211, 0.451013044684985, -0.000783569247849015, 5.20127671384957e-07, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-17957283.7993676, 15341.1046350264, -58.0099916736053, 0.150337681561662, -0.000195892311962254, 1.04025534276991e-07), - cpg_(1851.73466555648, 1487.53816264224, 2609.3, 493.366638912018, 1167.6), - B_(-0.0012789342214821, 1.4909797391063, -1563696.91923397, 1.85445462114904e+19, -7.68082153760755e+21), - mu_(-51.964, 3670.6, 5.7331, -5.3495e-29, 10), - mug_(2.6986e-06, 0.498, 1257.7, -19570), - K_(-0.4267, 0.0056903, -8.0065e-06, 1.815e-09, 0, 0), - Kg_(6.977e-05, 1.1243, 844.9, -148850), - sigma_(647.13, 0.18548, 2.717, -3.554, 2.047, 0), - D_(147.18, 20.1, 18.015, 28) // NN: Same as nHeptane - {} + H2O(); + + //- Construct from components H2O ( const liquid& l, @@ -122,124 +105,55 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - H2O(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + H2O(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + + // I-O //- Write the function coefficients void writeData(Ostream& os) const @@ -260,8 +174,7 @@ public: } - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const H2O& l) { l.writeData(os); @@ -276,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "H2OI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/H2O/H2OI.H b/src/thermophysicalModels/liquids/H2O/H2OI.H new file mode 100644 index 0000000000000000000000000000000000000000..bc5c4bff5ab8268e39ff7761c9f2d8931356a911 --- /dev/null +++ b/src/thermophysicalModels/liquids/H2O/H2OI.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::H2O::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::H2O::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::H2O::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::H2O::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::H2O::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::H2O::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::H2O::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::H2O::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::H2O::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::H2O::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::H2O::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::H2O::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::H2O::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/IC8H18/IC8H18.C b/src/thermophysicalModels/liquids/IC8H18/IC8H18.C index 713bada8d0c16205cc3610bff8ab9041592dff6c..483e6c24660a5ef2320620fb2d71691f0150ac1d 100644 --- a/src/thermophysicalModels/liquids/IC8H18/IC8H18.C +++ b/src/thermophysicalModels/liquids/IC8H18/IC8H18.C @@ -27,19 +27,124 @@ License #include "IC8H18.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(IC8H18, 0); + addToRunTimeSelectionTable(liquid, IC8H18,); + addToRunTimeSelectionTable(liquid, IC8H18, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::IC8H18::IC8H18() +: + liquid + ( + 114.231, + 543.96, + 2.5676e+6, + 0.468, + 0.266, + 165.78, + 1.4464e-2, + 372.39, + 0.0, + 0.3031, + 1.4051e+4 + ), + rho_(67.2363666, 0.27373, 543.96, 0.2846), + pv_(120.81, -7550, -16.111, 0.017099, 1.0), + hl_(543.96, 375379.713037617, 0.1549, 0.138, 0.0666, 0.0), + cp_ + ( + 1219.89652546156, + 1.67205049417409, + 0.00414073237562483, + 0.0, + 0.0, + 0.0 + ), + h_ + ( + -2743275.10767575, + 1219.89652546156, + 0.836025247087043, + 0.00138024412520828, + 0.0, + 0.0 + ), + cpg_(997.10236275617, 4627.4653990598, 1594, 2933.52942721328, 677.94), + B_ + ( + 0.00234936225718063, + -2.83381919093766, + -413154.047500241, + -3.49703670632315e+17, + 3.13750207912038e+19 + ), + mu_(-15.811, 1282.5, 0.67791, -3.8617e-28, 10.0), + mug_(1.107e-07, 0.746, 72.4, 0.0), + K_(0.1508, -0.0001712, 0.0, 0.0, 0.0, 0.0), + Kg_(1.758e-05, 1.3114, 392.9, 0.0), + sigma_(543.96, 0.047434, 1.1975, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 114.231, 28.0) // note: Same as nHeptane +{} + + +Foam::IC8H18::IC8H18 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(IC8H18, 0); -addToRunTimeSelectionTable(liquid, IC8H18,); -addToRunTimeSelectionTable(liquid, IC8H18, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::IC8H18::IC8H18(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/IC8H18/IC8H18.H b/src/thermophysicalModels/liquids/IC8H18/IC8H18.H index 742f1c4c5ffa2c3b44630bce45afa2f2c3d1939d..48de18edbed52466ba8874fb8b42f69d972c71dd 100644 --- a/src/thermophysicalModels/liquids/IC8H18/IC8H18.H +++ b/src/thermophysicalModels/liquids/IC8H18/IC8H18.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - IC8H18() - : - liquid(114.231, 543.96, 2.5676e+6, 0.468, 0.266, 165.78, 1.4464e-2, 372.39, 0.0, 0.3031, 1.4051e+4), - rho_(67.2363666, 0.27373, 543.96, 0.2846), - pv_(120.81, -7550, -16.111, 0.017099, 1), - hl_(543.96, 375379.713037617, 0.1549, 0.138, 0.0666, 0), - cp_(1219.89652546156, 1.67205049417409, 0.00414073237562483, 0, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-2743275.10767575, 1219.89652546156, 0.836025247087043, 0.00138024412520828, 0, 0), - cpg_(997.10236275617, 4627.4653990598, 1594, 2933.52942721328, 677.94), - B_(0.00234936225718063, -2.83381919093766, -413154.047500241, -3.49703670632315e+17, 3.13750207912038e+19), - mu_(-15.811, 1282.5, 0.67791, -3.8617e-28, 10), - mug_(1.107e-07, 0.746, 72.4, 0), - K_(0.1508, -0.0001712, 0, 0, 0, 0), - Kg_(1.758e-05, 1.3114, 392.9, 0), - sigma_(543.96, 0.047434, 1.1975, 0, 0, 0), - D_(147.18, 20.1, 114.231, 28) // NN: Same as nHeptane - {} + IC8H18(); + + //- Construct from components IC8H18 ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - IC8H18(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + IC8H18(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; - //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + //- Liquid thermal conductivity [W/(m K)] + inline scalar K(scalar p, scalar T) const; - //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + //- Vapour thermal conductivity [W/(m K)] + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const IC8H18& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "IC8H18I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/IC8H18/IC8H18I.H b/src/thermophysicalModels/liquids/IC8H18/IC8H18I.H new file mode 100644 index 0000000000000000000000000000000000000000..ac53685cb8dbda889d444828a048422b6adadfa2 --- /dev/null +++ b/src/thermophysicalModels/liquids/IC8H18/IC8H18I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::IC8H18::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::IC8H18::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::IC8H18::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::IC8H18::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::IC8H18::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::IC8H18::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::IC8H18::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::IC8H18::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::IC8H18::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::IC8H18::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::IC8H18::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::IC8H18::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::IC8H18::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/IDEA/IDEA.C b/src/thermophysicalModels/liquids/IDEA/IDEA.C index cd2560c2dc4b1443d4b390b400e0f4bae34f679d..f58a625ec5533724899bd6463376b9305cce8124 100644 --- a/src/thermophysicalModels/liquids/IDEA/IDEA.C +++ b/src/thermophysicalModels/liquids/IDEA/IDEA.C @@ -27,19 +27,144 @@ License #include "IDEA.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(IDEA, 0); + addToRunTimeSelectionTable(liquid, IDEA,); + addToRunTimeSelectionTable(liquid, IDEA, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::IDEA::IDEA() +: + liquid + ( + 142.26, + 618.074, + 2.11e+6, + 0.523, + 0.247, + 242.67, + 3.4929e-2, + 447.3, + 1.7012e-30, + 0.3478, + 1.57e+4 + ), + rho_(152.012105, 3.87150382e-1, 618.073893, 4.00790044e-1), + pv_ + ( + 8.4817774623e+01, + -8.6782398353e+03, + -9.1277694857, + 4.6153144498e-06, + 2.0 + ), + hl_ + ( + 618.074, + 2.1671983789e+05, + -4.2413153435e+00, + 1.1656811532e+01, + -1.1656446689e+01, + 4.3667661492 + ), + cp_(1.6604957e+3, -6.250871e-1, 6.1778552e-3, 0.0, 0.0, 0.0), + h_(0.0, 0.0, 0.0, 0.0, 0.0, 0.0), + cpg_ + ( + 1.0457515243e+03, + 3.4410492875e+03, + 1.5976862298e+03, + 2.4697705752e+03, + 7.3699710536e+02 + ), + B_ + ( + 0.00337351091119935, + -4.13606494008504, + -534560.916470464, + -1.13364022911762e+19, + 2.80704220402713e+21 + ), + mu_(-6.9645853822e+01, 4.4390635942e+03, 8.4680722718e+00, 0.0, 0.0), + mug_(4.2629382158e-08, 8.8144402122e-01, 9.6918097636e+01, 0.0), + K_(2.03684e-01, -2.3168e-04, 0.0, 0.0, 0.0, 0.0), + Kg_ + ( + -5.664925956707e+02, + 8.896721676320e-01, + -2.849783998688e+09, + 6.914935658053e+05 + ), + sigma_ + ( + 618.074, + 8.3846525429e-03, + -1.0044759047e+01, + 2.7261918781e+01, + -2.5529134309e+01, + 8.6488806234 + ), + D_(147.18, 20.1, 142.2, 28.0) // note: Same as nHeptane +{} + + +Foam::IDEA::IDEA +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(IDEA, 0); -addToRunTimeSelectionTable(liquid, IDEA,); -addToRunTimeSelectionTable(liquid, IDEA, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::IDEA::IDEA(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/IDEA/IDEA.H b/src/thermophysicalModels/liquids/IDEA/IDEA.H index a623416f8e78ac0ba86b845ed345c5da90c665c5..a51aa86cbf2123bbbaeb91b71da63d11c23803a0 100644 --- a/src/thermophysicalModels/liquids/IDEA/IDEA.H +++ b/src/thermophysicalModels/liquids/IDEA/IDEA.H @@ -109,26 +109,9 @@ public: // Constructors //- Construct null - IDEA() - : - liquid(142.26, 618.074, 2.11e+6, 0.523, 0.247, 242.67, 3.4929e-2, 447.3, 1.7012e-30, 0.3478, 1.57e+4), - rho_(152.012105, 3.87150382e-1, 618.073893, 4.00790044e-1), - pv_(8.4817774623e+01, -8.6782398353e+03, -9.1277694857, 4.6153144498e-06, 2.0), - hl_(618.074,2.1671983789e+05, -4.2413153435e+00, 1.1656811532e+01, -1.1656446689e+01, 4.3667661492), - cp_(1.6604957e+3, -6.250871e-1, 6.1778552e-3, 0.0, 0.0, 0.0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // For this fuel I've put it to zero because I was lazy at the time... - h_(0.0, 0.0, 0.0, 0.0, 0.0, 0.0), - cpg_(1.0457515243e+03, 3.4410492875e+03, 1.5976862298e+03, 2.4697705752e+03, 7.3699710536e+02), - B_(0.00337351091119935, -4.13606494008504, -534560.916470464, -1.13364022911762e+19, 2.80704220402713e+21), - mu_(-6.9645853822e+01, 4.4390635942e+03, 8.4680722718e+00, 0.0, 0.0), - mug_(4.2629382158e-08, 8.8144402122e-01, 9.6918097636e+01, 0.0), - K_(2.03684e-01, -2.3168e-04, 0.0, 0.0, 0.0, 0.0), - Kg_(-5.664925956707e+02, 8.896721676320e-01, -2.849783998688e+09, 6.914935658053e+05), - sigma_(618.074, 8.3846525429e-03, -1.0044759047e+01, 2.7261918781e+01, -2.5529134309e+01, 8.6488806234), - D_(147.18, 20.1, 142.2, 28) // NN: Same as nHeptane - {} + IDEA(); + + // Construct from components IDEA ( const liquid& l, @@ -145,125 +128,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - IDEA(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + IDEA(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -281,9 +195,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const IDEA& l) { l.writeData(os); @@ -298,6 +210,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "IDEAI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/IDEA/IDEAI.H b/src/thermophysicalModels/liquids/IDEA/IDEAI.H new file mode 100644 index 0000000000000000000000000000000000000000..865d7babfe422c5be25b20c27cae0a99904709e2 --- /dev/null +++ b/src/thermophysicalModels/liquids/IDEA/IDEAI.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::IDEA::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::IDEA::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::IDEA::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::IDEA::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::IDEA::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::IDEA::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::IDEA::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::IDEA::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::IDEA::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::IDEA::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::IDEA::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::IDEA::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::IDEA::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/MB/MB.C b/src/thermophysicalModels/liquids/MB/MB.C index 0328ef010391ba91da8c3f555b8a9bdeb54a7827..b5df86262c20a750b32d639a227cf678b2346571 100644 --- a/src/thermophysicalModels/liquids/MB/MB.C +++ b/src/thermophysicalModels/liquids/MB/MB.C @@ -27,19 +27,108 @@ License #include "MB.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(MB, 0); + addToRunTimeSelectionTable(liquid, MB,); + addToRunTimeSelectionTable(liquid, MB, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::MB::MB() +: + liquid + ( + 102.133, + 554.5, + 3.4734e+6, + 0.34, + 0.256, + 187.35, + 1.0102e-1, + 375.90, + 5.7373e-30, + 0.3807, + 1.7713e+4 + ), + rho_(76.6099633, 0.257, 554.5, 0.2772), + pv_(107.51, -8112.9, -12.77, 9.2919e-06, 2.0), + hl_(554.5, 508307.794738233, 0.392, 0.0, 0.0, 0.0), + cp_(1135.77394182096, 2.89818178257762, 0.0, 0.0, 0.0, 0.0), + h_(-5255966.14542938, 1135.77394182096, 1.44909089128881, 0.0, 0.0, 0.0), + cpg_(875.329227575808, 2849.22600922327, 1570.0, 2029.70636327142, 678.3), + B_ + ( + 0.00220496803188, + -2.42184210783978, + -401045.695318849, + -2.85079259397061e+17, + -3.57377145486767e+19 + ), + mu_(-12.206, 1141.7, 0.15014, 0.0, 0.0), + mug_(3.733e-07, 0.6177, 256.5, 0.0), + K_(0.2298, -0.0003002, 0.0, 0.0, 0.0, 0.0), + Kg_(1333.1, 0.9962, 12317000000.0, 0.0), + sigma_(554.5, 0.064084, 1.2418, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 102.133, 28.0) // note: Same as nHeptane +{} + + +Foam::MB::MB +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(MB, 0); -addToRunTimeSelectionTable(liquid, MB,); -addToRunTimeSelectionTable(liquid, MB, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::MB::MB(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/MB/MB.H b/src/thermophysicalModels/liquids/MB/MB.H index 4fb918ea02ab9421c27e86e6622fd22e8bd211cc..e9e4703e3d5d362bcc8ec7eba78e1b6a342807e9 100644 --- a/src/thermophysicalModels/liquids/MB/MB.H +++ b/src/thermophysicalModels/liquids/MB/MB.H @@ -31,8 +31,7 @@ Description SourceFiles MB.C -*/ -// ------------------------------------------------------------------------- // +\*---------------------------------------------------------------------------*/ #ifndef MB_H #define MB_H @@ -88,26 +87,9 @@ public: // Constructors //- Construct null - MB() - : - liquid(102.133, 554.5, 3.4734e+6, 0.34, 0.256, 187.35, 1.0102e-1, 375.90, 5.7373e-30, 0.3807, 1.7713e+4), - rho_(76.6099633, 0.257, 554.5, 0.2772), - pv_(107.51, -8112.9, -12.77, 9.2919e-06, 2), - hl_(554.5, 508307.794738233, 0.392, 0, 0, 0), - cp_(1135.77394182096, 2.89818178257762, 0, 0, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-5255966.14542938, 1135.77394182096, 1.44909089128881, 0, 0, 0), - cpg_(875.329227575808, 2849.22600922327, 1570, 2029.70636327142, 678.3), - B_(0.00220496803188, -2.42184210783978, -401045.695318849, -2.85079259397061e+17, -3.57377145486767e+19), - mu_(-12.206, 1141.7, 0.15014, 0, 0), - mug_(3.733e-07, 0.6177, 256.5, 0), - K_(0.2298, -0.0003002, 0, 0, 0, 0), - Kg_(1333.1, 0.9962, 12317000000.0, 0), - sigma_(554.5, 0.064084, 1.2418, 0, 0, 0), - D_(147.18, 20.1, 102.133, 28) // NN: Same as nHeptane - {} + MB(); + + //- Construct from components MB ( const liquid& l, @@ -124,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - MB(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + MB(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -261,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const MB& l) { l.writeData(os); @@ -278,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "MBI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/MB/MBI.H b/src/thermophysicalModels/liquids/MB/MBI.H new file mode 100644 index 0000000000000000000000000000000000000000..058d2c9f26b9d737d34af97b7c031b371b8fbb82 --- /dev/null +++ b/src/thermophysicalModels/liquids/MB/MBI.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::MB::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::MB::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::MB::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::MB::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::MB::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::MB::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::MB::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::MB::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::MB::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::MB::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::MB::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::MB::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::MB::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/N2/N2.C b/src/thermophysicalModels/liquids/N2/N2.C index 3a2c2a1e4ea433d3e46221c7d55ef248799ea517..f3458d825ebe96f3d4ca310c17fc0c6a38fa5931 100644 --- a/src/thermophysicalModels/liquids/N2/N2.C +++ b/src/thermophysicalModels/liquids/N2/N2.C @@ -27,19 +27,124 @@ License #include "N2.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(N2, 0); + addToRunTimeSelectionTable(liquid, N2,); + addToRunTimeSelectionTable(liquid, N2, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::N2::N2() +: + liquid + ( + 28.014, + 126.10, + 3.3944e+6, + 0.0901, + 0.292, + 63.15, + 1.2517e+4, + 77.35, + 0.0, + 0.0403, + 9.0819e+3 + ), + rho_(88.8716136, 0.28479, 126.1, 0.2925), + pv_(59.826, -1097.6, -8.6689, 0.046346, 1.0), + hl_(126.10, 336617.405582923, 1.201, -1.4811, 0.7085, 0.0), + cp_ + ( + -1192.26101235097, + 125.187406296852, + -1.66702363104162, + 0.00759263225530092, + 0.0, + 0.0 + ), + h_ + ( + -5480656.55276541, + -1192.26101235097, + 62.5937031484258, + -0.555674543680541, + 0.00189815806382523, + 0.0 + ), + cpg_(1038.94481330763, 307.52123938031, 1701.6, 3.69351038766331, 909.79), + B_ + ( + 0.00166702363104162, + -0.533661740558292, + -2182.12322410223, + 2873563218390.8, + -165274505604341.0 + ), + mu_(32.165, 496.9, 3.9069, -1.08e-21, 10.0), + mug_(7.632e-07, 0.58823, 67.75, 0.0), + K_(0.7259, -0.016728, 0.00016215, -5.7605e-07, 0.0, 0.0), + Kg_(0.000351, 0.7652, 25.767, 0.0), + sigma_(126.10, 0.02898, 1.2457, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 28.014, 28.0) // note: Same as nHeptane +{} + + +Foam::N2::N2 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(N2, 0); -addToRunTimeSelectionTable(liquid, N2,); -addToRunTimeSelectionTable(liquid, N2, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::N2::N2(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/N2/N2.H b/src/thermophysicalModels/liquids/N2/N2.H index 972b97dd545e864eb8a7f1cb554f9e448abb34ea..3595320ce87def7da1aab0f8d5c0587ec49f7ce4 100644 --- a/src/thermophysicalModels/liquids/N2/N2.H +++ b/src/thermophysicalModels/liquids/N2/N2.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - N2() - : - liquid(28.014, 126.10, 3.3944e+6, 0.0901, 0.292, 63.15, 1.2517e+4, 77.35, 0.0, 0.0403, 9.0819e+3), - rho_(88.8716136, 0.28479, 126.1, 0.2925), - pv_(59.826, -1097.6, -8.6689, 0.046346, 1), - hl_(126.10, 336617.405582923, 1.201, -1.4811, 0.7085, 0), - cp_(-1192.26101235097, 125.187406296852, -1.66702363104162, 0.00759263225530092, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-5480656.55276541, -1192.26101235097, 62.5937031484258, -0.555674543680541, 0.00189815806382523, 0), - cpg_(1038.94481330763, 307.52123938031, 1701.6, 3.69351038766331, 909.79), - B_(0.00166702363104162, -0.533661740558292, -2182.12322410223, 2873563218390.8, -165274505604341.0), - mu_(32.165, 496.9, 3.9069, -1.08e-21, 10), - mug_(7.632e-07, 0.58823, 67.75, 0), - K_(0.7259, -0.016728, 0.00016215, -5.7605e-07, 0, 0), - Kg_(0.000351, 0.7652, 25.767, 0), - sigma_(126.10, 0.02898, 1.2457, 0, 0, 0), - D_(147.18, 20.1, 28.014, 28) // NN: Same as nHeptane - {} + N2(); + + //- Construct from components N2 ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - N2(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + N2(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; - //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + //- Liquid thermal conductivity [W/(m K)] + inline scalar K(scalar p, scalar T) const; - //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + //- Vapour thermal conductivity [W/(m K)] + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const N2& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "N2I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/N2/N2I.H b/src/thermophysicalModels/liquids/N2/N2I.H new file mode 100644 index 0000000000000000000000000000000000000000..757f99d29395d48ee9407d33555b907ba3633b79 --- /dev/null +++ b/src/thermophysicalModels/liquids/N2/N2I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::N2::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::N2::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::N2::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::N2::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::N2::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::N2::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::N2::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::N2::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::N2::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::N2::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::N2::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::N2::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::N2::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.C b/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.C index 45364056f1b7a2c40fcbcba71b1203fe88adc060..4edbe582a25d455cf0112ba9c47275dec87a03fa 100644 --- a/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.C +++ b/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.C @@ -27,19 +27,116 @@ License #include "aC10H7CH3.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(aC10H7CH3, 0); + addToRunTimeSelectionTable(liquid, aC10H7CH3,); + addToRunTimeSelectionTable(liquid, aC10H7CH3, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::aC10H7CH3::aC10H7CH3() +: + liquid + ( + 142.2, + 772.04, + 3.66e+6, + 0.523, + 0.298, + 242.67, + 3.4929e-2, + 517.83, + 1.7012e-30, + 0.3478, + 2.0176e+4 + ), + rho_(60.92559, 0.22408, 772.04, 0.25709), + pv_(73.716, -9103.2, -7.2253, 2.062e-06, 2), + hl_(772.04, 511744.022503516, 0.4164, 0, 0, 0), + cp_(965.893108298172, 1.16216596343179, 0.00298523206751055, 0, 0, 0), + h_ + ( + 38161.6838138517, + 965.893108298172, + 0.581082981715893, + 0.00099507735583685, + 0, + 0 + ), + cpg_(743.389592123769, 2703.5864978903, 1548.5, 2031.64556962025, 722.06), + B_ + ( + 0.00205555555555556, + -3.34423347398031, + -931153.305203938, + 1.87601969057665e+18, + -2.06448663853727e+21 + ), + mu_(-93.6, 5784, 12, 0, 0), + mug_(2.5672e-06, 0.3566, 825.54, 0), + K_(0.19758, -0.0001796, 0, 0, 0, 0), + Kg_(0.3911, -0.1051, -213.52, 2318300), + sigma_(772.04, 0.076, 1.33, 0, 0, 0), + D_(147.18, 20.1, 142.2, 28) // note: Same as nHeptane +{} + + +Foam::aC10H7CH3::aC10H7CH3 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(aC10H7CH3, 0); -addToRunTimeSelectionTable(liquid, aC10H7CH3,); -addToRunTimeSelectionTable(liquid, aC10H7CH3, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::aC10H7CH3::aC10H7CH3(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.H b/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.H index 97eb8051ba21da7ba4f0a44c43036d7f3aa1d476..7489d6a0e4da24a569b81adf7d0ad6f10e097897 100644 --- a/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.H +++ b/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.H @@ -54,7 +54,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class aC10H7CH3 Declaration + Class aC10H7CH3 Declaration \*---------------------------------------------------------------------------*/ class aC10H7CH3 @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - aC10H7CH3() - : - liquid(142.2, 772.04, 3.66e+6, 0.523, 0.298, 242.67, 3.4929e-2, 517.83, 1.7012e-30, 0.3478, 2.0176e+4), - rho_(60.92559, 0.22408, 772.04, 0.25709), - pv_(73.716, -9103.2, -7.2253, 2.062e-06, 2), - hl_(772.04, 511744.022503516, 0.4164, 0, 0, 0), - cp_(965.893108298172, 1.16216596343179, 0.00298523206751055, 0, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(38161.6838138517, 965.893108298172, 0.581082981715893, 0.00099507735583685, 0, 0), - cpg_(743.389592123769, 2703.5864978903, 1548.5, 2031.64556962025, 722.06), - B_(0.00205555555555556, -3.34423347398031, -931153.305203938, 1.87601969057665e+18, -2.06448663853727e+21), - mu_(-93.6, 5784, 12, 0, 0), - mug_(2.5672e-06, 0.3566, 825.54, 0), - K_(0.19758, -0.0001796, 0, 0, 0, 0), - Kg_(0.3911, -0.1051, -213.52, 2318300), - sigma_(772.04, 0.076, 1.33, 0, 0, 0), - D_(147.18, 20.1, 142.2, 28) // NN: Same as nHeptane - {} + aC10H7CH3(); + + //- Constrcut from components aC10H7CH3 ( const liquid& l, @@ -123,124 +106,55 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - aC10H7CH3(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + aC10H7CH3(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + + // I-O //- Write the function coefficients void writeData(Ostream& os) const @@ -261,8 +175,7 @@ public: } - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const aC10H7CH3& l) { l.writeData(os); @@ -277,6 +190,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "aC10H7CH3I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3I.H b/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3I.H new file mode 100644 index 0000000000000000000000000000000000000000..4cf642cc0be9d1e8e39607a66d0055d295615bae --- /dev/null +++ b/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::aC10H7CH3::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::aC10H7CH3::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::aC10H7CH3::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::aC10H7CH3::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::aC10H7CH3::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::aC10H7CH3::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::aC10H7CH3::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::aC10H7CH3::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::aC10H7CH3::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::aC10H7CH3::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::aC10H7CH3::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::aC10H7CH3::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::aC10H7CH3::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.C b/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.C index a24626852dec8814b82f314e046500810a5b089b..545176895d89112d0e0d49a248e1091c964338e4 100644 --- a/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.C +++ b/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.C @@ -27,19 +27,116 @@ License #include "bC10H7CH3.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(bC10H7CH3, 0); + addToRunTimeSelectionTable(liquid, bC10H7CH3,); + addToRunTimeSelectionTable(liquid, bC10H7CH3, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::bC10H7CH3::bC10H7CH3() +: + liquid + ( + 142.2, + 761.0, + 3.25e+6, + 0.507, + 0.260, + 307.73, + 1.7374e+1, + 514.20, + 1.4010e-30, + 0.3459, + 1.987e+4 + ), + rho_(67.36014, 0.23843, 761, 0.2559), + pv_(134.31, -12103, -16.195, 6.9659e-06, 2), + hl_(761.0, 513150.492264416, 0.4044, 0.0, 0.0, 0.0), + cp_(811.322081575246, 2.30225035161744, 0.0008628691983122, 0.0, 0.0, 0.0), + h_ + ( + 45001.2311880177, + 811.322081575246, + 1.15112517580872, + 0.000287623066104079, + 0.0, + 0.0 + ), + cpg_(760.126582278481, 2699.08579465542, 1564.1, 1994.51476793249, 727.49), + B_ + ( + 0.00229430379746835, + -3.53720112517581, + -1067158.93108298, + 2.29746835443038e+18, + -2.68438818565401e+21 + ), + mu_(-63.276, 4219, 7.5549, 0.0, 0.0), + mug_(2.1791e-06, 0.3717, 712.53, 0.0), + K_(0.1962, -0.00018414, 0.0, 0.0, 0.0, 0.0), + Kg_(0.4477, -0.1282, -345.89, 2340100), + sigma_(761.0, 0.066442, 1.2634, 0.0, 0.0, 0.0), + D_(147.18, 20.1, 142.2, 28) // note: Same as nHeptane +{} + + +Foam::bC10H7CH3::bC10H7CH3 +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc6& surfaceTension, + const APIdiffCoefFunc& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(bC10H7CH3, 0); -addToRunTimeSelectionTable(liquid, bC10H7CH3,); -addToRunTimeSelectionTable(liquid, bC10H7CH3, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::bC10H7CH3::bC10H7CH3(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.H b/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.H index 4fffdd559c784fef183ca966e2958a043e68c318..add7fa7e934136e2587b89c2a80173bba0b3bbf2 100644 --- a/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.H +++ b/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.H @@ -87,26 +87,9 @@ public: // Constructors //- Construct null - bC10H7CH3() - : - liquid(142.2, 761.0, 3.25e+6, 0.507, 0.260, 307.73, 1.7374e+1, 514.20, 1.4010e-30, 0.3459, 1.987e+4), - rho_(67.36014, 0.23843, 761, 0.2559), - pv_(134.31, -12103, -16.195, 6.9659e-06, 2), - hl_(761.0, 513150.492264416, 0.4044, 0, 0, 0), - cp_(811.322081575246, 2.30225035161744, 0.000862869198312236, 0, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(45001.2311880177, 811.322081575246, 1.15112517580872, 0.000287623066104079, 0, 0), - cpg_(760.126582278481, 2699.08579465542, 1564.1, 1994.51476793249, 727.49), - B_(0.00229430379746835, -3.53720112517581, -1067158.93108298, 2.29746835443038e+18, -2.68438818565401e+21), - mu_(-63.276, 4219, 7.5549, 0, 0), - mug_(2.1791e-06, 0.3717, 712.53, 0), - K_(0.1962, -0.00018414, 0, 0, 0, 0), - Kg_(0.4477, -0.1282, -345.89, 2340100), - sigma_(761.0, 0.066442, 1.2634, 0, 0, 0), - D_(147.18, 20.1, 142.2, 28) // NN: Same as nHeptane - {} + bC10H7CH3(); + + //- Construct from components bC10H7CH3 ( const liquid& l, @@ -123,125 +106,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc6& surfaceTension, const APIdiffCoefFunc& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - bC10H7CH3(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + bC10H7CH3(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; - //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + //- Liquid thermal conductivity [W/(m K)] + inline scalar K(scalar p, scalar T) const; - //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + //- Vapour thermal conductivity [W/(m K)] + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -260,9 +174,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const bC10H7CH3& l) { l.writeData(os); @@ -277,6 +189,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "bC10H7CH3I.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3I.H b/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3I.H new file mode 100644 index 0000000000000000000000000000000000000000..1be40b2f2d61f3b6c0bd0c32fb8d1e056174e36d --- /dev/null +++ b/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3I.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::bC10H7CH3::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::bC10H7CH3::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::bC10H7CH3::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::bC10H7CH3::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::bC10H7CH3::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::bC10H7CH3::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::bC10H7CH3::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::bC10H7CH3::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::bC10H7CH3::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::bC10H7CH3::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::bC10H7CH3::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::bC10H7CH3::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::bC10H7CH3::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/iC3H8O/iC3H8O.C b/src/thermophysicalModels/liquids/iC3H8O/iC3H8O.C index 0cc62cedb91d645aaf0feaeecaa4b0ce1a06026f..f3985234601a2e733a45cacba016299ffd5b0efd 100644 --- a/src/thermophysicalModels/liquids/iC3H8O/iC3H8O.C +++ b/src/thermophysicalModels/liquids/iC3H8O/iC3H8O.C @@ -24,25 +24,129 @@ License Description -------------------------------------------------------------------------------- -*/ +\*---------------------------------------------------------------------------*/ #include "iC3H8O.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(iC3H8O, 0); + addToRunTimeSelectionTable(liquid, iC3H8O,); + addToRunTimeSelectionTable(liquid, iC3H8O, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::iC3H8O::iC3H8O() +: + liquid + ( + 60.096, + 508.31, + 4.7643e+6, + 0.22013, + 0.248, + 185.28, + 3.20e-2, + 355.41, + 5.5372e-30, + 0.6689, + 2.3575e+4 + ), + rho_(70.91328, 0.26475, 508.31, 0.243), + pv_(92.935, -8177.1, -10.031, 3.9988e-06, 2.0), + hl_(508.31, 948149.627263046, 0.087, 0.3007, 0.0, 0.0), + cp_ + ( + 7760.91586794462, + -68.3672790202343, + 0.241380457933972, + -0.000235057241746539, + 0.0, + 0.0 + ), + h_ + ( + -6227786.27583977, + 7760.91586794462, + -34.1836395101172, + 0.0804601526446574, + -5.87643104366347e-05, + 0.0 + ), + cpg_(789.73642172524, 3219.8482428115, 1124, 1560.83599574015, 460.0), + B_ + ( + 0.000502529286474973, + -0.104665867944622, + -717185.83599574, + 3.3047124600639e+18, + -1.43270766773163e+21 + ), + mu_(-8.23, 2282.2, -0.98495, 0.0, 0.0), + mug_(1.993e-07, 0.7233, 178.0, 0.0), + K_(0.2029, -0.0002278, 0.0, 0.0, 0.0, 0.0), + Kg_(-80.642, -1.4549, -604.42, 0.0), + sigma_(0.03818, -3.818e-05, -6.51e-08, 0.0, 0.0, 0.0), + D_(4.75e-10, 1.75, 0.0, 0.0, 0.0) +{} + + +Foam::iC3H8O::iC3H8O +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc0& surfaceTension, + const NSRDSfunc1& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(iC3H8O, 0); -addToRunTimeSelectionTable(liquid, iC3H8O,); -addToRunTimeSelectionTable(liquid, iC3H8O, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::iC3H8O::iC3H8O(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/iC3H8O/iC3H8O.H b/src/thermophysicalModels/liquids/iC3H8O/iC3H8O.H index ffa2acb32e301048288fbefe2b01aa89a78a9a6f..d6f59b9568aa9b2ce300d1327f03800a9c7be779 100644 --- a/src/thermophysicalModels/liquids/iC3H8O/iC3H8O.H +++ b/src/thermophysicalModels/liquids/iC3H8O/iC3H8O.H @@ -85,26 +85,9 @@ public: // Constructors //- Construct null - iC3H8O() - : - liquid(60.096, 508.31, 4.7643e+6, 0.22013, 0.248, 185.28, 3.20e-2, 355.41, 5.5372e-30, 0.6689, 2.3575e+4), - rho_(70.91328, 0.26475, 508.31, 0.243), - pv_(92.935, -8177.1, -10.031, 3.9988e-06, 2), - hl_(508.31, 948149.627263046, 0.087, 0.3007, 0, 0), - cp_(7760.91586794462, -68.3672790202343, 0.241380457933972, -0.000235057241746539, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-6227786.27583977, 7760.91586794462, -34.1836395101172, 0.0804601526446574, -5.87643104366347e-05, 0), - cpg_(789.73642172524, 3219.8482428115, 1124, 1560.83599574015, 460), - B_(0.000502529286474973, -0.104665867944622, -717185.83599574, 3.3047124600639e+18, -1.43270766773163e+21), - mu_(-8.23, 2282.2, -0.98495, 0, 0), - mug_(1.993e-07, 0.7233, 178, 0), - K_(0.2029, -0.0002278, 0, 0, 0, 0), - Kg_(-80.642, -1.4549, -604.42, 0), - sigma_(0.03818, -3.818e-05, -6.51e-08, 0, 0, 0), - D_(4.75e-10, 1.75, 0.0, 0.0, 0.0) // NN. same as iC3H8O - {} + iC3H8O(); + + //- Constrcut from components iC3H8O ( const liquid& l, @@ -121,125 +104,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc0& surfaceTension, const NSRDSfunc1& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - iC3H8O(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + iC3H8O(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + inline scalar K(scalar p, scalar T) const; //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -258,9 +172,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const iC3H8O& l) { l.writeData(os); @@ -275,6 +187,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "iC3H8OI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/iC3H8O/iC3H8OI.H b/src/thermophysicalModels/liquids/iC3H8O/iC3H8OI.H new file mode 100644 index 0000000000000000000000000000000000000000..3ec8bd368df335a009bdc1ec9642bc81c8ea8f4e --- /dev/null +++ b/src/thermophysicalModels/liquids/iC3H8O/iC3H8OI.H @@ -0,0 +1,106 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::iC3H8O::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::iC3H8O::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::iC3H8O::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::iC3H8O::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::iC3H8O::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::iC3H8O::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::iC3H8O::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::iC3H8O::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::iC3H8O::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::iC3H8O::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::iC3H8O::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::iC3H8O::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::iC3H8O::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // + diff --git a/src/thermophysicalModels/liquids/liquid/liquid.C b/src/thermophysicalModels/liquids/liquid/liquid.C index e4ffc44b010412a060395ad7ccc2e645b3ab1e06..c2b5f8b3fad858d6e93fb1f06aad83b680dd23ba 100644 --- a/src/thermophysicalModels/liquids/liquid/liquid.C +++ b/src/thermophysicalModels/liquids/liquid/liquid.C @@ -33,16 +33,14 @@ License namespace Foam { - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -defineTypeNameAndDebug(liquid, 0); -defineRunTimeSelectionTable(liquid,); -defineRunTimeSelectionTable(liquid, Istream); + defineTypeNameAndDebug(liquid, 0); + defineRunTimeSelectionTable(liquid,); + defineRunTimeSelectionTable(liquid, Istream); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -autoPtr<liquid> liquid::New(Istream& is) +Foam::autoPtr<Foam::liquid> Foam::liquid::New(Istream& is) { if (debug) { @@ -64,8 +62,8 @@ autoPtr<liquid> liquid::New(Istream& is) { FatalErrorIn("liquid::New(Istream&)") << "Unknown liquid type " << liquidType - << endl << endl - << "Valid liquid types are :" << endl + << nl << nl + << "Valid liquid types are:" << nl << ConstructorTablePtr_->toc() << abort(FatalError); } @@ -82,7 +80,7 @@ autoPtr<liquid> liquid::New(Istream& is) FatalErrorIn("liquid::New(Istream&)") << "Unknown liquid type " << liquidType << endl << endl - << "Valid liquid types are :" << endl + << "Valid liquid types are:" << nl << IstreamConstructorTablePtr_->toc() << abort(FatalError); } @@ -102,8 +100,4 @@ autoPtr<liquid> liquid::New(Istream& is) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/liquid/liquid.H b/src/thermophysicalModels/liquids/liquid/liquid.H index 4c4769026fda617feb2904d4b8b28fba9de29cd7..0973f2b45efff5ea9e4f65329be893cea8542567 100644 --- a/src/thermophysicalModels/liquids/liquid/liquid.H +++ b/src/thermophysicalModels/liquids/liquid/liquid.H @@ -162,10 +162,9 @@ public: static autoPtr<liquid> New(Istream& is); - // Destructor - - virtual ~liquid() - {} + //- Destructor + virtual ~liquid() + {} // Member Functions @@ -173,70 +172,37 @@ public: // Physical constants which define the specie //- Molecular weight [kg/kmol] - scalar W() const - { - return W_; - } + inline scalar W() const; //- Critical temperature [K] - scalar Tc() const - { - return Tc_; - } + inline scalar Tc() const; //- Critical pressure [Pa] - scalar Pc() const - { - return Pc_; - } + inline scalar Pc() const; //- Critical volume [m^3/mol] - scalar Vc() const - { - return Vc_; - } + inline scalar Vc() const; //- Critical compressibilty factor - scalar Zc() const - { - return Zc_; - } + inline scalar Zc() const; //- Triple point temperature [K] - scalar Tt() const - { - return Tt_; - } + inline scalar Tt() const; //- Triple point pressure [Pa] - scalar Pt() const - { - return Pt_; - } + inline scalar Pt() const; //- Normal boiling temperature [K] - scalar Tb() const - { - return Tb_; - } + inline scalar Tb() const; //- Dipole moment [] - scalar dipm() const - { - return dipm_; - } + inline scalar dipm() const; //- Pitzer's ascentric factor [] - scalar omega() const - { - return omega_; - } + inline scalar omega() const; //- Solubility parameter [(J/m^3)^(1/2)] - scalar delta() const - { - return delta_; - } + inline scalar delta() const; // Physical property pure virtual functions @@ -278,6 +244,8 @@ public: virtual scalar D(scalar p, scalar T) const = 0; + // I-O + //- Write the function coefficients virtual void writeData(Ostream& os) const { @@ -290,9 +258,7 @@ public: << delta_; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const liquid& l) { l.writeData(os); diff --git a/src/thermophysicalModels/liquids/liquid/liquidI.H b/src/thermophysicalModels/liquids/liquid/liquidI.H new file mode 100644 index 0000000000000000000000000000000000000000..cf941d79bfbae49886b7ea62d4086d1faecb2606 --- /dev/null +++ b/src/thermophysicalModels/liquids/liquid/liquidI.H @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::liquid::W() const +{ + return W_; +} + + +inline Foam::scalar Foam::liquid::Tc() const +{ + return Tc_; +} + + +inline Foam::scalar Foam::liquid::Pc() const +{ + return Pc_; +} + + +inline Foam::scalar Foam::liquid::Vc() const +{ + return Vc_; +} + + +inline Foam::scalar Foam::liquid::Zc() const +{ + return Zc_; +} + + +inline Foam::scalar Foam::liquid::Tt() const +{ + return Tt_; +} + + +inline Foam::scalar Foam::liquid::Pt() const +{ + return Pt_; +} + + +inline Foam::scalar Foam::liquid::Tb() const +{ + return Tb_; +} + + +inline Foam::scalar Foam::liquid::dipm() const +{ + return dipm_; +} + + +inline Foam::scalar Foam::liquid::omega() const +{ + return omega_; +} + + +inline Foam::scalar Foam::liquid::delta() const +{ + return delta_; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/nC3H8O/nC3H8O.C b/src/thermophysicalModels/liquids/nC3H8O/nC3H8O.C index cdf81e6b947f2559c742e9d9ba383669b09cc4bd..5b4be350ea8ecb5db495c21454fc0f090d11f5a5 100644 --- a/src/thermophysicalModels/liquids/nC3H8O/nC3H8O.C +++ b/src/thermophysicalModels/liquids/nC3H8O/nC3H8O.C @@ -22,27 +22,129 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - -------------------------------------------------------------------------------- -*/ +\*---------------------------------------------------------------------------*/ #include "nC3H8O.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + defineTypeNameAndDebug(nC3H8O, 0); + addToRunTimeSelectionTable(liquid, nC3H8O,); + addToRunTimeSelectionTable(liquid, nC3H8O, Istream); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::nC3H8O::nC3H8O() +: + liquid + ( + 60.096, + 536.71, + 5.1696e+6, + 0.21853, + 0.253, + 146.95, + 6.5112e-7, + 370.35, + 5.6039e-30, + 0.6279, + 2.4557e+4 + ), + rho_(75.300288, 0.272, 536.71, 0.2494), + pv_(77.46, -7960, -7.5235, 3e-07, 2.0), + hl_(536.71, 1098242.8115016, 0.647, -0.783, 0.613, 0.0), + cp_ + ( + 216.320553780618, + 18.5203674121406, + -0.0751797124600639, + 0.000126464323748669, + 0.0, + 0.0 + ), + h_ + ( + -5533091.96851587, + 216.320553780618, + 9.26018370607029, + -0.0250599041533546, + 3.16160809371672e-05, + 0.0 + ), + cpg_(961.794462193823, 3467.78487752929, 1542, 2046.72523961661, 649), + B_ + ( + 0.000933506389776358, + -1.09325079872204, + -531649.361022364, + -2.32627795527157e+17, + -3.81888977635783e+20 + ), + mu_(0.571, 1521, -2.0894, 0.0, 0.0), + mug_(7.942e-07, 0.5491, 415.8, 0.0), + K_(0.204, -0.000169, 0.0, 0.0, 0.0, 0.0), + Kg_(-613.84, 0.7927, -1157400000.0, 0.0), + sigma_(0.04533, -6.88e-05, -1.6e-08, 0.0, 0.0, 0.0), + D_(4.75e-10, 1.75, 0.0, 0.0, 0.0) // note: same as iC3H8O +{} + + +Foam::nC3H8O::nC3H8O +( + const liquid& l, + const NSRDSfunc5& density, + const NSRDSfunc1& vapourPressure, + const NSRDSfunc6& heatOfVapourisation, + const NSRDSfunc0& heatCapacity, + const NSRDSfunc0& enthalpy, + const NSRDSfunc7& idealGasHeatCapacity, + const NSRDSfunc4& secondVirialCoeff, + const NSRDSfunc1& dynamicViscosity, + const NSRDSfunc2& vapourDynamicViscosity, + const NSRDSfunc0& thermalConductivity, + const NSRDSfunc2& vapourThermalConductivity, + const NSRDSfunc0& surfaceTension, + const NSRDSfunc1& vapourDiffussivity +) +: + liquid(l), + rho_(density), + pv_(vapourPressure), + hl_(heatOfVapourisation), + cp_(heatCapacity), + h_(enthalpy), + cpg_(idealGasHeatCapacity), + B_(secondVirialCoeff), + mu_(dynamicViscosity), + mug_(vapourDynamicViscosity), + K_(thermalConductivity), + Kg_(vapourThermalConductivity), + sigma_(surfaceTension), + D_(vapourDiffussivity) +{} -defineTypeNameAndDebug(nC3H8O, 0); -addToRunTimeSelectionTable(liquid, nC3H8O,); -addToRunTimeSelectionTable(liquid, nC3H8O, Istream); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Foam::nC3H8O::nC3H8O(Istream& is) +: + liquid(is), + rho_(is), + pv_(is), + hl_(is), + cp_(is), + h_(is), + cpg_(is), + B_(is), + mu_(is), + mug_(is), + K_(is), + Kg_(is), + sigma_(is), + D_(is) +{} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/nC3H8O/nC3H8O.H b/src/thermophysicalModels/liquids/nC3H8O/nC3H8O.H index 5bb5ba21d7900ed355f6b7dddbb3bf8a44c5a6d8..27601bc5481a498b8968366e9b0b045644d6e651 100644 --- a/src/thermophysicalModels/liquids/nC3H8O/nC3H8O.H +++ b/src/thermophysicalModels/liquids/nC3H8O/nC3H8O.H @@ -85,26 +85,9 @@ public: // Constructors //- Construct null - nC3H8O() - : - liquid(60.096, 536.71, 5.1696e+6, 0.21853, 0.253, 146.95, 6.5112e-7, 370.35, 5.6039e-30, 0.6279, 2.4557e+4), - rho_(75.300288, 0.272, 536.71, 0.2494), - pv_(77.46, -7960, -7.5235, 3e-07, 2), - hl_(536.71, 1098242.8115016, 0.647, -0.783, 0.613, 0), - cp_(216.320553780618, 18.5203674121406, -0.0751797124600639, 0.000126464323748669, 0, 0), - // NN: enthalpy, h_, is not used in the sprayModel. - // For consistency, the enthalpy is derived from hlat and hl. - // It is, however, convenient to have it available. - h_(-5533091.96851587, 216.320553780618, 9.26018370607029, -0.0250599041533546, 3.16160809371672e-05, 0), - cpg_(961.794462193823, 3467.78487752929, 1542, 2046.72523961661, 649), - B_(0.000933506389776358, -1.09325079872204, -531649.361022364, -2.32627795527157e+17, -3.81888977635783e+20), - mu_(0.571, 1521, -2.0894, 0, 0), - mug_(7.942e-07, 0.5491, 415.8, 0), - K_(0.204, -0.000169, 0, 0, 0, 0), - Kg_(-613.84, 0.7927, -1157400000, 0), - sigma_(0.04533, -6.88e-05, -1.6e-08, 0, 0, 0), - D_(4.75e-10, 1.75, 0.0, 0.0, 0.0) // NN. same as iC3H8O - {} + nC3H8O(); + + //- Construct from components nC3H8O ( const liquid& l, @@ -121,125 +104,56 @@ public: const NSRDSfunc2& vapourThermalConductivity, const NSRDSfunc0& surfaceTension, const NSRDSfunc1& vapourDiffussivity - ) - : - liquid(l), - rho_(density), - pv_(vapourPressure), - hl_(heatOfVapourisation), - cp_(heatCapacity), - h_(enthalpy), - cpg_(idealGasHeatCapacity), - B_(secondVirialCoeff), - mu_(dynamicViscosity), - mug_(vapourDynamicViscosity), - K_(thermalConductivity), - Kg_(vapourThermalConductivity), - sigma_(surfaceTension), - D_(vapourDiffussivity) - {} + ); //- Construct from Istream - nC3H8O(Istream& is) - : - liquid(is), - rho_(is), - pv_(is), - hl_(is), - cp_(is), - h_(is), - cpg_(is), - B_(is), - mu_(is), - mug_(is), - K_(is), - Kg_(is), - sigma_(is), - D_(is) - {} + nC3H8O(Istream& is); // Member Functions //- Liquid density [kg/m^3] - scalar rho(scalar p, scalar T) const - { - return rho_.f(p, T); - } + inline scalar rho(scalar p, scalar T) const; //- Vapour pressure [Pa] - scalar pv(scalar p, scalar T) const - { - return pv_.f(p, T); - } + inline scalar pv(scalar p, scalar T) const; //- Heat of vapourisation [J/kg] - scalar hl(scalar p, scalar T) const - { - return hl_.f(p, T); - } + inline scalar hl(scalar p, scalar T) const; //- Liquid heat capacity [J/(kg K)] - scalar cp(scalar p, scalar T) const - { - return cp_.f(p, T); - } + inline scalar cp(scalar p, scalar T) const; //- Liquid Enthalpy [J/(kg)] - scalar h(scalar p, scalar T) const - { - return h_.f(p, T); - } + inline scalar h(scalar p, scalar T) const; //- Ideal gas heat capacity [J/(kg K)] - scalar cpg(scalar p, scalar T) const - { - return cpg_.f(p, T); - } + inline scalar cpg(scalar p, scalar T) const; //- Second Virial Coefficient [m^3/kg] - scalar B(scalar p, scalar T) const - { - return B_.f(p, T); - } + inline scalar B(scalar p, scalar T) const; //- Liquid viscosity [Pa s] - scalar mu(scalar p, scalar T) const - { - return mu_.f(p, T); - } + inline scalar mu(scalar p, scalar T) const; //- Vapour viscosity [Pa s] - scalar mug(scalar p, scalar T) const - { - return mug_.f(p, T); - } + inline scalar mug(scalar p, scalar T) const; - //- Liquid thermal conductivity [W/(m K)] - scalar K(scalar p, scalar T) const - { - return K_.f(p, T); - } + //- Liquid thermal conductivity [W/(m K)] + inline scalar K(scalar p, scalar T) const; - //- Vapour thermal conductivity [W/(m K)] - scalar Kg(scalar p, scalar T) const - { - return Kg_.f(p, T); - } + //- Vapour thermal conductivity [W/(m K)] + inline scalar Kg(scalar p, scalar T) const; //- Surface tension [N/m] - scalar sigma(scalar p, scalar T) const - { - return sigma_.f(p, T); - } + inline scalar sigma(scalar p, scalar T) const; //- Vapour diffussivity [m2/s] - scalar D(scalar p, scalar T) const - { - return D_.f(p, T); - } + inline scalar D(scalar p, scalar T) const; + // I-O + //- Write the function coefficients void writeData(Ostream& os) const { @@ -258,9 +172,7 @@ public: D_.writeData(os); os << endl; } - - // Ostream Operator - + //- Ostream Operator friend Ostream& operator<<(Ostream& os, const nC3H8O& l) { l.writeData(os); @@ -275,6 +187,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "nC3H8OI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/nC3H8O/nC3H8OI.H b/src/thermophysicalModels/liquids/nC3H8O/nC3H8OI.H new file mode 100644 index 0000000000000000000000000000000000000000..ec850eddf8d4c9f39de477e59fc4e94d3dd5ca2f --- /dev/null +++ b/src/thermophysicalModels/liquids/nC3H8O/nC3H8OI.H @@ -0,0 +1,106 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::scalar Foam::nC3H8O::rho(scalar p, scalar T) const +{ + return rho_.f(p, T); +} + + +inline Foam::scalar Foam::nC3H8O::pv(scalar p, scalar T) const +{ + return pv_.f(p, T); +} + + +inline Foam::scalar Foam::nC3H8O::hl(scalar p, scalar T) const +{ + return hl_.f(p, T); +} + + +inline Foam::scalar Foam::nC3H8O::cp(scalar p, scalar T) const +{ + return cp_.f(p, T); +} + + +inline Foam::scalar Foam::nC3H8O::h(scalar p, scalar T) const +{ + return h_.f(p, T); +} + + +inline Foam::scalar Foam::nC3H8O::cpg(scalar p, scalar T) const +{ + return cpg_.f(p, T); +} + + +inline Foam::scalar Foam::nC3H8O::B(scalar p, scalar T) const +{ + return B_.f(p, T); +} + + +inline Foam::scalar Foam::nC3H8O::mu(scalar p, scalar T) const +{ + return mu_.f(p, T); +} + + +inline Foam::scalar Foam::nC3H8O::mug(scalar p, scalar T) const +{ + return mug_.f(p, T); +} + + +inline Foam::scalar Foam::nC3H8O::K(scalar p, scalar T) const +{ + return K_.f(p, T); +} + + +inline Foam::scalar Foam::nC3H8O::Kg(scalar p, scalar T) const +{ + return Kg_.f(p, T); +} + + +inline Foam::scalar Foam::nC3H8O::sigma(scalar p, scalar T) const +{ + return sigma_.f(p, T); +} + + +inline Foam::scalar Foam::nC3H8O::D(scalar p, scalar T) const +{ + return D_.f(p, T); +} + + +// ************************************************************************* // + diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C index 006e45b588b265d3f43ed8da174bc7d6efd2d5e5..cafc62c4946e8bff9c0e15c07aa14efdb7c23830 100644 --- a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C @@ -114,6 +114,7 @@ makeReactionThermo perfectGas ); + makeReactionThermo ( hReactionThermo, @@ -135,6 +136,14 @@ makeReactionMixtureThermo icoPoly8ThermoPhysics ); +makeReactionMixtureThermo +( + hReactionThermo, + hRhoMixtureThermo, + multiComponentMixture, + gasThermoPhysics +); + // Multi-component reaction thermo @@ -146,6 +155,14 @@ makeReactionMixtureThermo icoPoly8ThermoPhysics ); +makeReactionMixtureThermo +( + hReactionThermo, + hRhoMixtureThermo, + reactingMixture, + gasThermoPhysics +); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/solids/C/C.C b/src/thermophysicalModels/solids/C/C.C index bc701872b76382487d792168f6904dd315bec87b..1dbcfd2eed25f46a5948eef699d2717d5c5a0169 100644 --- a/src/thermophysicalModels/solids/C/C.C +++ b/src/thermophysicalModels/solids/C/C.C @@ -27,16 +27,14 @@ License #include "C.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(C, 0); -addToRunTimeSelectionTable(solid, C,); -addToRunTimeSelectionTable(solid, C, Istream); + defineTypeNameAndDebug(C, 0); + addToRunTimeSelectionTable(solid, C,); + addToRunTimeSelectionTable(solid, C, Istream); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -72,15 +70,11 @@ void Foam::C::writeData(Ostream& os) const // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // -Foam::Ostream& operator<<(Ostream& os, const C& s) +Foam::Ostream& Foam::operator<<(Ostream& os, const C& s) { s.writeData(os); return os; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/solids/CaCO3/CaCO3.C b/src/thermophysicalModels/solids/CaCO3/CaCO3.C index 36dcdd3d5c907f2ecf8b2e8f3731850a61d34e2e..77a4398322a48c74123ed77f490721d16ced4751 100644 --- a/src/thermophysicalModels/solids/CaCO3/CaCO3.C +++ b/src/thermophysicalModels/solids/CaCO3/CaCO3.C @@ -27,16 +27,14 @@ License #include "CaCO3.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(CaCO3, 0); -addToRunTimeSelectionTable(solid, CaCO3,); -addToRunTimeSelectionTable(solid, CaCO3, Istream); + defineTypeNameAndDebug(CaCO3, 0); + addToRunTimeSelectionTable(solid, CaCO3,); + addToRunTimeSelectionTable(solid, CaCO3, Istream); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -72,15 +70,11 @@ void Foam::CaCO3::writeData(Ostream& os) const // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // -Foam::Ostream& operator<<(Ostream& os, const CaCO3& s) +Foam::Ostream& Foam::operator<<(Ostream& os, const CaCO3& s) { s.writeData(os); return os; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/solids/ash/ash.C b/src/thermophysicalModels/solids/ash/ash.C index 42da228d2c17168f474323522dd18a0b84f999e0..c904131aab258699500b7aee1175dc63bd96c71b 100644 --- a/src/thermophysicalModels/solids/ash/ash.C +++ b/src/thermophysicalModels/solids/ash/ash.C @@ -27,16 +27,14 @@ License #include "ash.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(ash, 0); -addToRunTimeSelectionTable(solid, ash,); -addToRunTimeSelectionTable(solid, ash, Istream); + defineTypeNameAndDebug(ash, 0); + addToRunTimeSelectionTable(solid, ash,); + addToRunTimeSelectionTable(solid, ash, Istream); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -72,15 +70,11 @@ void Foam::ash::writeData(Ostream& os) const // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // -Foam::Ostream& operator<<(Ostream& os, const ash& s) +Foam::Ostream& Foam::operator<<(Ostream& os, const ash& s) { s.writeData(os); return os; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/solids/solid/solid.C b/src/thermophysicalModels/solids/solid/solid.C index 8d617154651995bce9961bb3b32acd55b7037fec..5a9da6b875131714701557fecddd1569584bf8da 100644 --- a/src/thermophysicalModels/solids/solid/solid.C +++ b/src/thermophysicalModels/solids/solid/solid.C @@ -26,16 +26,14 @@ License #include "solid.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(solid, 0); -defineRunTimeSelectionTable(solid,); -defineRunTimeSelectionTable(solid, Istream); + defineTypeNameAndDebug(solid, 0); + defineRunTimeSelectionTable(solid,); + defineRunTimeSelectionTable(solid, Istream); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -80,15 +78,11 @@ void Foam::solid::writeData(Ostream& os) const // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // -Foam::Ostream& operator<<(Ostream& os, const solid& s) +Foam::Ostream& Foam::operator<<(Ostream& os, const solid& s) { s.writeData(os); return os; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/specie/include/reactionTypes.H b/src/thermophysicalModels/specie/include/reactionTypes.H index 531c9760bf1783a33d7a9f001906370ee9bb63b6..6ea8803c79d2071bdbe0af57095127df7ef3a93f 100644 --- a/src/thermophysicalModels/specie/include/reactionTypes.H +++ b/src/thermophysicalModels/specie/include/reactionTypes.H @@ -37,7 +37,7 @@ Description #include "Reaction.H" #include "icoPolynomial.H" -#include "polynomialThermo.H" +#include "hPolynomialThermo.H" #include "polynomialTransport.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H b/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H index 2b85b224747d1657f80d868b583331307be3b6e4..502958b505b8459b9d3245656e3a7767038a84f3 100644 --- a/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H +++ b/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H @@ -41,7 +41,7 @@ Description #include "constTransport.H" #include "icoPolynomial.H" -#include "polynomialThermo.H" +#include "hPolynomialThermo.H" #include "polynomialTransport.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -58,7 +58,7 @@ namespace Foam < specieThermo < - polynomialThermo + hPolynomialThermo < icoPolynomial<8>, 8 diff --git a/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermo.H b/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermo.H index 89cf9875d037aa6bc17c131113ee0edb14cd644f..6d982155c7d48f30f671585112e5d1ecc105430a 100644 --- a/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermo.H +++ b/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermo.H @@ -46,7 +46,7 @@ Description #include "perfectGas.H" #include "polynomialTransport.H" -#include "polynomialThermo.H" +#include "hPolynomialThermo.H" #include "icoPolynomial.H" #include "addToRunTimeSelectionTable.H" diff --git a/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.C b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C similarity index 89% rename from src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.C rename to src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C index c764426bbece5b913f6c6386ddaa8884ded89270..294a96005a397a24e43c2e87d9643083aa90bb5a 100644 --- a/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.C +++ b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C @@ -24,13 +24,13 @@ License \*---------------------------------------------------------------------------*/ -#include "polynomialThermo.H" +#include "hPolynomialThermo.H" #include "IOstreams.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class EquationOfState, int PolySize> -Foam::polynomialThermo<EquationOfState, PolySize>::polynomialThermo(Istream& is) +Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo(Istream& is) : EquationOfState(is), Hf_(readScalar(is)), @@ -47,7 +47,7 @@ template<class EquationOfState, int PolySize> Foam::Ostream& Foam::operator<< ( Ostream& os, - const polynomialThermo<EquationOfState, PolySize>& pt + const hPolynomialThermo<EquationOfState, PolySize>& pt ) { os << static_cast<const EquationOfState&>(pt) << tab @@ -59,7 +59,7 @@ Foam::Ostream& Foam::operator<< os.check ( - "operator<<(Ostream& os, const polynomialThermo<EquationOfState>& pt)" + "operator<<(Ostream& os, const hPolynomialThermo<EquationOfState>& pt)" ); return os; diff --git a/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.H b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H similarity index 69% rename from src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.H rename to src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H index 5f76a826d7735ea915038a937db2cbb27209d9ef..ec3c752f24bc7273dfd7b9460f7429fd6018b603 100644 --- a/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.H +++ b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::polynomialThermo + Foam::hPolynomialThermo Description Thermodynamics package templated on the equation of state, using polynomial @@ -32,13 +32,13 @@ Description Polynomials for h and s derived from cp SourceFiles - polynomialThermoI.H - polynomialThermo.C + hPolynomialThermoI.H + hPolynomialThermo.C \*---------------------------------------------------------------------------*/ -#ifndef polynomialThermo_H -#define polynomialThermo_H +#ifndef hPolynomialThermo_H +#define hPolynomialThermo_H #include "scalar.H" #include "Polynomial.H" @@ -51,50 +51,50 @@ namespace Foam // Forward declaration of friend functions and operators template<class EquationOfState, int PolySize> -class polynomialThermo; +class hPolynomialThermo; template<class EquationOfState, int PolySize> -inline polynomialThermo<EquationOfState, PolySize> operator+ +inline hPolynomialThermo<EquationOfState, PolySize> operator+ ( - const polynomialThermo<EquationOfState, PolySize>&, - const polynomialThermo<EquationOfState, PolySize>& + const hPolynomialThermo<EquationOfState, PolySize>&, + const hPolynomialThermo<EquationOfState, PolySize>& ); template<class EquationOfState, int PolySize> -inline polynomialThermo<EquationOfState, PolySize> operator- +inline hPolynomialThermo<EquationOfState, PolySize> operator- ( - const polynomialThermo<EquationOfState, PolySize>&, - const polynomialThermo<EquationOfState, PolySize>& + const hPolynomialThermo<EquationOfState, PolySize>&, + const hPolynomialThermo<EquationOfState, PolySize>& ); template<class EquationOfState, int PolySize> -inline polynomialThermo<EquationOfState, PolySize> operator* +inline hPolynomialThermo<EquationOfState, PolySize> operator* ( const scalar, - const polynomialThermo<EquationOfState, PolySize>& + const hPolynomialThermo<EquationOfState, PolySize>& ); template<class EquationOfState, int PolySize> -inline polynomialThermo<EquationOfState, PolySize> operator== +inline hPolynomialThermo<EquationOfState, PolySize> operator== ( - const polynomialThermo<EquationOfState, PolySize>&, - const polynomialThermo<EquationOfState, PolySize>& + const hPolynomialThermo<EquationOfState, PolySize>&, + const hPolynomialThermo<EquationOfState, PolySize>& ); template<class EquationOfState, int PolySize> Ostream& operator<< ( Ostream&, - const polynomialThermo<EquationOfState, PolySize>& + const hPolynomialThermo<EquationOfState, PolySize>& ); /*---------------------------------------------------------------------------*\ - Class polynomialThermo Declaration + Class hPolynomialThermo Declaration \*---------------------------------------------------------------------------*/ template<class EquationOfState, int PolySize> -class polynomialThermo +class hPolynomialThermo : public EquationOfState { @@ -119,7 +119,7 @@ class polynomialThermo // Private member functions //- Construct from components - inline polynomialThermo + inline hPolynomialThermo ( const EquationOfState& pt, const scalar Hf, @@ -135,10 +135,10 @@ public: // Constructors //- Construct from dictionary - polynomialThermo(Istream& is); + hPolynomialThermo(Istream& is); //- Construct as a named copy - inline polynomialThermo(const word&, const polynomialThermo&); + inline hPolynomialThermo(const word&, const hPolynomialThermo&); // Member Functions @@ -161,34 +161,34 @@ public: // Member operators - inline void operator+=(const polynomialThermo&); - inline void operator-=(const polynomialThermo&); + inline void operator+=(const hPolynomialThermo&); + inline void operator-=(const hPolynomialThermo&); // Friend operators - friend polynomialThermo operator+ <EquationOfState, PolySize> + friend hPolynomialThermo operator+ <EquationOfState, PolySize> ( - const polynomialThermo&, - const polynomialThermo& + const hPolynomialThermo&, + const hPolynomialThermo& ); - friend polynomialThermo operator- <EquationOfState, PolySize> + friend hPolynomialThermo operator- <EquationOfState, PolySize> ( - const polynomialThermo&, - const polynomialThermo& + const hPolynomialThermo&, + const hPolynomialThermo& ); - friend polynomialThermo operator* <EquationOfState, PolySize> + friend hPolynomialThermo operator* <EquationOfState, PolySize> ( const scalar, - const polynomialThermo& + const hPolynomialThermo& ); - friend polynomialThermo operator== <EquationOfState, PolySize> + friend hPolynomialThermo operator== <EquationOfState, PolySize> ( - const polynomialThermo&, - const polynomialThermo& + const hPolynomialThermo&, + const hPolynomialThermo& ); @@ -197,7 +197,7 @@ public: friend Ostream& operator<< <EquationOfState, PolySize> ( Ostream&, - const polynomialThermo& + const hPolynomialThermo& ); }; @@ -208,10 +208,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "polynomialThermoI.H" +#include "hPolynomialThermoI.H" #ifdef NoRepository -# include "polynomialThermo.C" +# include "hPolynomialThermo.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermoI.H b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H similarity index 75% rename from src/thermophysicalModels/specie/thermo/polynomial/polynomialThermoI.H rename to src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H index 28e80c5d5fc6741abf56786622d59e858db4bfe6..1382c6f3ecea86c65370e60741630ad03d3eabab 100644 --- a/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H @@ -24,12 +24,12 @@ License \*---------------------------------------------------------------------------*/ -#include "polynomialThermo.H" +#include "hPolynomialThermo.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template<class EquationOfState, int PolySize> -inline Foam::polynomialThermo<EquationOfState, PolySize>::polynomialThermo +inline Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo ( const EquationOfState& pt, const scalar Hf, @@ -51,10 +51,10 @@ inline Foam::polynomialThermo<EquationOfState, PolySize>::polynomialThermo // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class EquationOfState, int PolySize> -inline Foam::polynomialThermo<EquationOfState, PolySize>::polynomialThermo +inline Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo ( const word& name, - const polynomialThermo& pt + const hPolynomialThermo& pt ) : EquationOfState(name, pt), @@ -69,7 +69,7 @@ inline Foam::polynomialThermo<EquationOfState, PolySize>::polynomialThermo // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class EquationOfState, int PolySize> -inline Foam::scalar Foam::polynomialThermo<EquationOfState, PolySize>::cp +inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::cp ( const scalar T ) const @@ -79,7 +79,7 @@ inline Foam::scalar Foam::polynomialThermo<EquationOfState, PolySize>::cp template<class EquationOfState, int PolySize> -inline Foam::scalar Foam::polynomialThermo<EquationOfState, PolySize>::h +inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::h ( const scalar T ) const @@ -89,7 +89,7 @@ inline Foam::scalar Foam::polynomialThermo<EquationOfState, PolySize>::h template<class EquationOfState, int PolySize> -inline Foam::scalar Foam::polynomialThermo<EquationOfState, PolySize>::hs +inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::hs ( const scalar T ) const @@ -99,7 +99,7 @@ inline Foam::scalar Foam::polynomialThermo<EquationOfState, PolySize>::hs template<class EquationOfState, int PolySize> -inline Foam::scalar Foam::polynomialThermo<EquationOfState, PolySize>::hc() +inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::hc() const { return Hf_*this->W(); @@ -107,7 +107,7 @@ const template<class EquationOfState, int PolySize> -inline Foam::scalar Foam::polynomialThermo<EquationOfState, PolySize>::s +inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::s ( const scalar T ) const @@ -119,9 +119,9 @@ inline Foam::scalar Foam::polynomialThermo<EquationOfState, PolySize>::s // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template<class EquationOfState, int PolySize> -inline void Foam::polynomialThermo<EquationOfState, PolySize>::operator+= +inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator+= ( - const polynomialThermo<EquationOfState, PolySize>& pt + const hPolynomialThermo<EquationOfState, PolySize>& pt ) { scalar molr1 = this->nMoles(); @@ -140,9 +140,9 @@ inline void Foam::polynomialThermo<EquationOfState, PolySize>::operator+= template<class EquationOfState, int PolySize> -inline void Foam::polynomialThermo<EquationOfState, PolySize>::operator-= +inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator-= ( - const polynomialThermo<EquationOfState, PolySize>& pt + const hPolynomialThermo<EquationOfState, PolySize>& pt ) { scalar molr1 = this->nMoles(); @@ -163,10 +163,10 @@ inline void Foam::polynomialThermo<EquationOfState, PolySize>::operator-= // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // template<class EquationOfState, int PolySize> -inline Foam::polynomialThermo<EquationOfState, PolySize> Foam::operator+ +inline Foam::hPolynomialThermo<EquationOfState, PolySize> Foam::operator+ ( - const polynomialThermo<EquationOfState, PolySize>& pt1, - const polynomialThermo<EquationOfState, PolySize>& pt2 + const hPolynomialThermo<EquationOfState, PolySize>& pt1, + const hPolynomialThermo<EquationOfState, PolySize>& pt2 ) { EquationOfState eofs @@ -177,7 +177,7 @@ inline Foam::polynomialThermo<EquationOfState, PolySize> Foam::operator+ scalar molr1 = pt1.nMoles()/eofs.nMoles(); scalar molr2 = pt2.nMoles()/eofs.nMoles(); - return polynomialThermo<EquationOfState, PolySize> + return hPolynomialThermo<EquationOfState, PolySize> ( eofs, molr1*pt1.Hf_ + molr2*pt2.Hf_, @@ -190,10 +190,10 @@ inline Foam::polynomialThermo<EquationOfState, PolySize> Foam::operator+ template<class EquationOfState, int PolySize> -inline Foam::polynomialThermo<EquationOfState, PolySize> Foam::operator- +inline Foam::hPolynomialThermo<EquationOfState, PolySize> Foam::operator- ( - const polynomialThermo<EquationOfState, PolySize>& pt1, - const polynomialThermo<EquationOfState, PolySize>& pt2 + const hPolynomialThermo<EquationOfState, PolySize>& pt1, + const hPolynomialThermo<EquationOfState, PolySize>& pt2 ) { EquationOfState eofs @@ -204,7 +204,7 @@ inline Foam::polynomialThermo<EquationOfState, PolySize> Foam::operator- scalar molr1 = pt1.nMoles()/eofs.nMoles(); scalar molr2 = pt2.nMoles()/eofs.nMoles(); - return polynomialThermo<EquationOfState, PolySize> + return hPolynomialThermo<EquationOfState, PolySize> ( eofs, molr1*pt1.Hf_ - molr2*pt2.Hf_, @@ -217,13 +217,13 @@ inline Foam::polynomialThermo<EquationOfState, PolySize> Foam::operator- template<class EquationOfState, int PolySize> -inline Foam::polynomialThermo<EquationOfState, PolySize> Foam::operator* +inline Foam::hPolynomialThermo<EquationOfState, PolySize> Foam::operator* ( const scalar s, - const polynomialThermo<EquationOfState, PolySize>& pt + const hPolynomialThermo<EquationOfState, PolySize>& pt ) { - return polynomialThermo<EquationOfState, PolySize> + return hPolynomialThermo<EquationOfState, PolySize> ( s*static_cast<const EquationOfState&>(pt), pt.Hf_, @@ -236,10 +236,10 @@ inline Foam::polynomialThermo<EquationOfState, PolySize> Foam::operator* template<class EquationOfState, int PolySize> -inline Foam::polynomialThermo<EquationOfState, PolySize> Foam::operator== +inline Foam::hPolynomialThermo<EquationOfState, PolySize> Foam::operator== ( - const polynomialThermo<EquationOfState, PolySize>& pt1, - const polynomialThermo<EquationOfState, PolySize>& pt2 + const hPolynomialThermo<EquationOfState, PolySize>& pt1, + const hPolynomialThermo<EquationOfState, PolySize>& pt2 ) { return pt2 - pt1; diff --git a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/Allrun b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/Allrun index 0d8c6de9d1b4ecf76f0d6b46642adac9dd514c8c..59649516d94c727094c0725e9dd028a7c0a864d1 100755 --- a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/Allrun +++ b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/Allrun @@ -5,11 +5,11 @@ application="mdEquilibrationFoam" -# cd periodicCubeArgon -# runApplication blockMesh -# runApplication mdInitialise -# runApplication $application -# cd .. +cd periodicCubeArgon + runApplication blockMesh + runApplication mdInitialise + runApplication $application +cd .. cd periodicCubeWater runApplication blockMesh diff --git a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/system/mdEquilibrationDict b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/system/mdEquilibrationDict index e044b8378542974b38127b812d5a4e04aa9e2ac3..bbdbb899ec8d9cd8de0b2329c76e18c55db5e73b 100644 --- a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/system/mdEquilibrationDict +++ b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/system/mdEquilibrationDict @@ -14,6 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -equilibrationTargetTemperature 300.0; +targetTemperature 300.0; + +// ************************************************************************* // -// ************************************************************************* // \ No newline at end of file diff --git a/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/system/controlDict b/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/system/controlDict index 8a3ba006163857eb4fafe09388c1ae873b0f23bf..51a42ecc0e828d90fd725f5c361eae36c95f5f15 100644 --- a/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/system/controlDict +++ b/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/system/controlDict @@ -20,7 +20,7 @@ startTime 0; stopAt endTime; -endTime 1e-10; +endTime 5e-12; deltaT 1e-15; diff --git a/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/system/mdInitialiseDict b/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/system/mdInitialiseDict index ac85160f5cb2e1cbc774f42df6b87eb70ccd320d..0d91d5a08b1413b4a02ccb5d22d096df67b3a500 100644 --- a/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/system/mdInitialiseDict +++ b/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/system/mdInitialiseDict @@ -27,7 +27,7 @@ FoamFile sectionA { - massDensity 980; + massDensity 1004; temperature 298; bulkVelocity (0.0 0.0 0.0); latticeIds @@ -46,7 +46,7 @@ sectionA sectionB { - massDensity 980; + massDensity 1004; temperature 298; bulkVelocity (0.0 0.0 0.0); latticeIds @@ -65,7 +65,7 @@ sectionB sectionC { - massDensity 980; + massDensity 1004; temperature 298; bulkVelocity (0.0 0.0 0.0); latticeIds diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties index 8f53d4c4b002c03c44517a65d7bf6f7c18153540..7fcb35b37cdbb0c9869e1f8609128292b10628be 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties @@ -80,9 +80,7 @@ particleForces { gravity on; virtualMass off; - Cvm 0.5; pressureGradient off; - gradU gradU; } ManualInjectionCoeffs diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties index 51e1df08101c3ce45839e94cdfa1168e2f9a7d66..a76ed5115f88135a593f6a2cfa45a9ffe1e740a5 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties @@ -66,9 +66,7 @@ particleForces { gravity on; virtualMass off; - Cvm 0.5; pressureGradient off; - gradU gradU; } ManualInjectionCoeffs diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactingCloud1Properties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactingCloud1Properties index d33cf9f91c5231a7ebe6270c19343006e7ac1b55..76e55a95ea9d854c439e0880f8f9548284ad34d6 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactingCloud1Properties @@ -74,9 +74,7 @@ particleForces { gravity on; virtualMass off; - Cvm 0.5; pressureGradient off; - gradU gradU; } ManualInjectionCoeffs diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/fvSolution b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/fvSolution index 1f65036d6404ad5570b5430c0e2de26b84d95544..e01611490e05bff98b886adef03b424b5e8f8569 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/fvSolution +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/fvSolution @@ -131,6 +131,13 @@ PISO // nUCorrectors 2; } +additional +{ + dpdt true; + hWork true; + eWork true; +} + relaxationFactors { /* diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties index a669b9451b705d096ce6446f143b251ebba37fb9..6a53da3143fdf612841edcd3042fd4a4f2b68737 100644 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties @@ -74,9 +74,7 @@ particleForces { gravity on; virtualMass off; - Cvm 0.5; pressureGradient off; - gradU gradU; } ManualInjectionCoeffs diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties index 8c69fb42b5812561e5fc746eceec85ae1481a22b..93a7d43a9deb93b410aec659c9c4672a2ac54c4f 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties @@ -54,9 +54,7 @@ particleForces { gravity on; virtualMass off; - Cvm 0.5; pressureGradient off; - gradU gradU; } ManualInjectionCoeffs diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties index a7c19443e21a00f8964ab6b167621c7cd8090d33..ea9f237fb590ab5d94a7fecdfbff7d631037b782 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties @@ -66,9 +66,7 @@ particleForces { gravity on; virtualMass off; - Cvm 0.5; pressureGradient off; - gradU gradU; } ManualInjectionCoeffs