diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C index 3d2c18e6684fa8a570f5a5b3f23ff80489bd3809..b58df5402e39ac354eadf4f075ca861156d595b9 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C @@ -31,7 +31,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "psiThermo.H" +#include "rhoThermo.H" #include "RASModel.H" #include "radiationModel.H" #include "simpleControl.H" diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H index bb7a65cb1d28ac920674974f91563447637874e1..ffbf0059161793005bff91d76c7f28d69d0e72f6 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H @@ -1,10 +1,10 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr<psiThermo> pThermo + autoPtr<rhoThermo> pThermo ( - psiThermo::New(mesh) + rhoThermo::New(mesh) ); - psiThermo& thermo = pThermo(); + rhoThermo& thermo = pThermo(); thermo.validate(args.executable(), "h", "e"); volScalarField rho diff --git a/applications/solvers/heatTransfer/thermoFoam/EEqn.H b/applications/solvers/heatTransfer/thermoFoam/EEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..51232bf0bec20f7dfead229401a45bc5ca2ec706 --- /dev/null +++ b/applications/solvers/heatTransfer/thermoFoam/EEqn.H @@ -0,0 +1,34 @@ +{ + volScalarField& he = thermo.he(); + + fvScalarMatrix EEqn + ( + fvm::ddt(rho, he) + fvm::div(phi, he) + + fvc::ddt(rho, K) + fvc::div(phi, K) + + ( + he.name() == "e" + ? fvc::div + ( + fvc::absolute(phi/fvc::interpolate(rho), U), + p, + "div(phiv,p)" + ) + : -dpdt + ) + - fvm::laplacian(alphaEff, he) + == + radiation->Sh(thermo) + + fvOptions(rho, he) + ); + + EEqn.relax(); + + fvOptions.constrain(EEqn); + + EEqn.solve(); + + fvOptions.correct(he); + + thermo.correct(); + radiation->correct(); +} diff --git a/applications/solvers/heatTransfer/thermoFoam/Make/files b/applications/solvers/heatTransfer/thermoFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..825ed0cba8ac5e0819ccb568cc7541d5f8085262 --- /dev/null +++ b/applications/solvers/heatTransfer/thermoFoam/Make/files @@ -0,0 +1,3 @@ +thermoFoam.C + +EXE = $(FOAM_APPBIN)/thermoFoam diff --git a/applications/solvers/heatTransfer/thermoFoam/Make/options b/applications/solvers/heatTransfer/thermoFoam/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..14bd0d4d24e9b7a22d0c57a8686ea26bd394c681 --- /dev/null +++ b/applications/solvers/heatTransfer/thermoFoam/Make/options @@ -0,0 +1,24 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/fvOptions/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ + -I$(LIB_SRC)/turbulenceModels \ + -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -lsampling \ + -lmeshTools \ + -lfvOptions \ + -lfluidThermophysicalModels \ + -lradiationModels \ + -lspecie \ + -lcompressibleTurbulenceModel \ + -lcompressibleRASModels \ + -lcompressibleLESModels diff --git a/applications/solvers/heatTransfer/thermoFoam/createFields.H b/applications/solvers/heatTransfer/thermoFoam/createFields.H new file mode 100644 index 0000000000000000000000000000000000000000..ffa6c3f3b52113c56d4bc5329c218a1c57f25162 --- /dev/null +++ b/applications/solvers/heatTransfer/thermoFoam/createFields.H @@ -0,0 +1,54 @@ + Info<< "Reading thermophysical properties\n" << endl; + + autoPtr<rhoThermo> pThermo(rhoThermo::New(mesh)); + rhoThermo& thermo = pThermo(); + thermo.validate(args.executable(), "h", "e"); + + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + thermo.rho() + ); + + volScalarField& p = thermo.p(); + + Info<< "Reading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + #include "compressibleCreatePhi.H" + + #include "setAlphaEff.H" + + Info<< "Creating field dpdt\n" << endl; + volScalarField dpdt + ( + IOobject + ( + "dpdt", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar("dpdt", p.dimensions()/dimTime, 0) + ); + + Info<< "Creating field kinetic energy K\n" << endl; + volScalarField K("K", 0.5*magSqr(U)); diff --git a/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H b/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H new file mode 100644 index 0000000000000000000000000000000000000000..90b475794b6340365f969f978d14d52811b60d4c --- /dev/null +++ b/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H @@ -0,0 +1,93 @@ + Info<< "Creating turbulence model\n" << endl; + tmp<volScalarField> talphaEff; + + IOobject turbulenceHeader + ( + "turbulenceProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ + ); + + IOobject RASHeader + ( + "RASProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ + ); + + IOobject LESHeader + ( + "LESProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ + ); + + if (turbulenceHeader.headerOk()) + { + autoPtr<compressible::turbulenceModel> turbulence + ( + compressible::turbulenceModel::New + ( + rho, + U, + phi, + thermo + ) + ); + + talphaEff = turbulence->alphaEff(); + } + else if (RASHeader.headerOk()) + { + autoPtr<compressible::RASModel> turbulence + ( + compressible::RASModel::New + ( + rho, + U, + phi, + thermo + ) + ); + + talphaEff = turbulence->alphaEff(); + } + else if (LESHeader.headerOk()) + { + autoPtr<compressible::LESModel> turbulence + ( + compressible::LESModel::New + ( + rho, + U, + phi, + thermo + ) + ); + + talphaEff = turbulence->alphaEff(); + } + else + { + talphaEff = tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "alphaEff", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("0", dimMass/dimLength/dimTime, 0.0) + ) + ); + } + + const volScalarField& alphaEff = talphaEff(); diff --git a/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C b/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C new file mode 100644 index 0000000000000000000000000000000000000000..f5f88232d2c1fbd9a7bd8fe6d431a99020b848d6 --- /dev/null +++ b/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C @@ -0,0 +1,107 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\/ 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 3 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, see <http://www.gnu.org/licenses/>. + +Application + thermoFoam + +Description + Evolves the thermodynamics on a forzen flow field + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "rhoThermo.H" +#include "turbulenceModel.H" +#include "RASModel.H" +#include "LESModel.H" +#include "radiationModel.H" +#include "fvIOoptionList.H" +#include "simpleControl.H" +#include "pimpleControl.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + + #include "createTime.H" + #include "createMesh.H" + #include "createFields.H" + #include "createFvOptions.H" + #include "createRadiationModel.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nEvolving thermodynamics\n" << endl; + + if (mesh.solutionDict().found("SIMPLE")) + { + simpleControl simple(mesh); + + while (simple.loop()) + { + Info<< "Time = " << runTime.timeName() << nl << endl; + + while (simple.correctNonOrthogonal()) + { + #include "EEqn.H" + } + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + + runTime.write(); + } + } + else + { + pimpleControl pimple(mesh); + + while (runTime.run()) + { + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + while (pimple.correctNonOrthogonal()) + { + #include "EEqn.H" + } + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + + runTime.write(); + } + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/utilities/thermophysical/chemkinToFoam/chemkinToFoam.C b/applications/utilities/thermophysical/chemkinToFoam/chemkinToFoam.C index 2f56ee07dea1f13086c13c4c1c33c266c102b183..f844195ae9356dea066207712b364dea3c7c0584 100644 --- a/applications/utilities/thermophysical/chemkinToFoam/chemkinToFoam.C +++ b/applications/utilities/thermophysical/chemkinToFoam/chemkinToFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,11 +42,20 @@ int main(int argc, char *argv[]) argList::validArgs.append("CHEMKINThermodynamicsFile"); argList::validArgs.append("FOAMChemistryFile"); argList::validArgs.append("FOAMThermodynamicsFile"); + + argList::addBoolOption + ( + "newFormat", + "read Chemkin thermo file in new format" + ); + argList args(argc, argv); + bool newFormat = args.optionFound("newFormat"); + speciesTable species; - chemkinReader cr(args[1], species, args[2]); + chemkinReader cr(args[1], species, args[2], newFormat); OFstream reactionsFile(args[3]); reactionsFile diff --git a/etc/config/settings.csh b/etc/config/settings.csh index 27ad49aea859fac9b08a5abaed3711c06195a049..be510764fd5cade17fdfbe5f81a27020790a24a5 100644 --- a/etc/config/settings.csh +++ b/etc/config/settings.csh @@ -219,7 +219,7 @@ case ThirdParty: case Gcc++0x: case Gcc46: case Gcc46++0x: - set gcc_version=gcc-4.6.2 + set gcc_version=gcc-4.6.1 set gmp_version=gmp-5.0.4 set mpfr_version=mpfr-3.1.0 set mpc_version=mpc-0.9 @@ -238,17 +238,6 @@ case ThirdParty: set mpfr_version=mpfr-2.4.2 set mpc_version=mpc-0.8.1 breaksw - case Gcc44: - case Gcc44++0x: - set gcc_version=gcc-4.4.3 - set gmp_version=gmp-5.0.1 - set mpfr_version=mpfr-2.4.2 - breaksw - case Gcc43: - set gcc_version=gcc-4.3.3 - set gmp_version=gmp-4.2.4 - set mpfr_version=mpfr-2.4.1 - breaksw case Clang: # using clang - not gcc setenv WM_CC 'clang' diff --git a/etc/config/settings.sh b/etc/config/settings.sh index ad336dd871e0492cadfe1d3053de13d1857f4533..12d6f4b9004d13dbe48f3636234b14eef19b6cb0 100644 --- a/etc/config/settings.sh +++ b/etc/config/settings.sh @@ -240,12 +240,6 @@ fi case "${foamCompiler}" in OpenFOAM | ThirdParty) case "$WM_COMPILER" in - Gcc463) - gcc_version=gcc-4.6.3 - gmp_version=gmp-5.0.2 - mpfr_version=mpfr-3.0.1 - mpc_version=mpc-0.9 - ;; Gcc | Gcc++0x | Gcc46 | Gcc46++0x) gcc_version=gcc-4.6.1 gmp_version=gmp-5.0.4 @@ -264,16 +258,6 @@ OpenFOAM | ThirdParty) mpfr_version=mpfr-2.4.2 mpc_version=mpc-0.8.1 ;; - Gcc44 | Gcc44++0x) - gcc_version=gcc-4.4.3 - gmp_version=gmp-5.0.1 - mpfr_version=mpfr-2.4.2 - ;; - Gcc43) - gcc_version=gcc-4.3.3 - gmp_version=gmp-4.2.4 - mpfr_version=mpfr-2.4.1 - ;; Clang) # using clang - not gcc export WM_CC='clang' diff --git a/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C index d207981fca2f4c4fb604390fad6137fd4bf2a183..5da9b8a19de35c99c505b506279af1af0bd3a98e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C @@ -52,6 +52,13 @@ Foam::fileName Foam::externalCoupledMixedFvPatchField<Type>::baseDir() const } +template<class Type> +Foam::fileName Foam::externalCoupledMixedFvPatchField<Type>::lockFile() const +{ + return fileName(baseDir()/(lockName + ".lock")); +} + + template<class Type> void Foam::externalCoupledMixedFvPatchField<Type>::createLockFile() const { @@ -65,7 +72,7 @@ void Foam::externalCoupledMixedFvPatchField<Type>::createLockFile() const Info<< type() << ": creating lock file" << endl; } - OFstream os(baseDir()/(lockName + ".lock")); + OFstream os(lockFile()); os << "waiting"; os.flush(); } @@ -84,7 +91,7 @@ void Foam::externalCoupledMixedFvPatchField<Type>::removeLockFile() const Info<< type() << ": removing lock file" << endl; } - rm(baseDir()/(lockName + ".lock")); + rm(lockFile()); } @@ -153,15 +160,13 @@ void Foam::externalCoupledMixedFvPatchField<Type>::writeAndWait os.flush(); } - const fileName lockFile(baseDir()/(lockName + ".lock")); - // remove lock file, signalling external source to execute removeLockFile(); if (log_) { - Info<< type() << ": beginning wait for lock file " << lockFile + Info<< type() << ": beginning wait for lock file " << lockFile() << endl; } @@ -189,13 +194,13 @@ void Foam::externalCoupledMixedFvPatchField<Type>::writeAndWait << " s" << abort(FatalError); } - IFstream is(lockFile); + IFstream is(lockFile()); if (is.good()) { if (log_) { - Info<< type() << ": found lock file " << lockFile << endl; + Info<< type() << ": found lock file " << lockFile() << endl; } found = true; @@ -438,8 +443,7 @@ void Foam::externalCoupledMixedFvPatchField<Type>::write(Ostream& os) const os.writeKeyword("fileName") << fName_ << token::END_STATEMENT << nl; os.writeKeyword("waitInterval") << waitInterval_ << token::END_STATEMENT << nl; - os.writeKeyword("timeOut") << timeOut_ << token::END_STATEMENT - << nl; + os.writeKeyword("timeOut") << timeOut_ << token::END_STATEMENT << nl; os.writeKeyword("calcFrequency") << calcFrequency_ << token::END_STATEMENT << nl; os.writeKeyword("log") << log_ << token::END_STATEMENT << nl; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.H index 229d9bad6c33ebc16ae98faaff17b84eb3f27681..50376e097de456e9123a04202db210801cca4e1e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.H @@ -47,7 +47,7 @@ Description $FOAM_CASE/comms/patchName/data.out - The lock file is then removed, instructing the exterbal source to take + The lock file is then removed, instructing the external source to take control of the program execution. When ready, the external program should create the return values, e.g. to file @@ -62,9 +62,9 @@ Description \table Property | Description | Required | Default value commsDir | communications folder | yes | - fileName | data transfer file name | yes | + fileName | transfer file name | yes | waitInterval | interval [s] between file checks | no | 1 - timeOut | time after which error invoked | no | 100*waitInterval + timeOut | time after which error invoked [s] |no |100*waitInterval calcFrequency | calculation frequency | no | 1 log | log program control | no | no \endtable @@ -137,6 +137,9 @@ protected: //- Return the file path to the base communications folder fileName baseDir() const; + //- Return the file path to the lock file + fileName lockFile() const; + //- Create lock file void createLockFile() const; diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H index be67f1829268a8dd7519f182512d64179bcdca32..68acada6cadd4ea245508d9e707cc652878bae4e 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H @@ -372,8 +372,14 @@ inline Foam::scalar Foam::KinematicCloud<CloudType>::penetration } // lists of parcels mass and distance from initial injection point - List<scalar> mass(nParcel, 0.0); - List<scalar> dist(nParcel, 0.0); + List<List<scalar> > procMass(Pstream::nProcs()); + List<List<scalar> > procDist(Pstream::nProcs()); + + List<scalar>& mass = procMass[Pstream::myProcNo()]; + List<scalar>& dist = procDist[Pstream::myProcNo()]; + + mass.setSize(nParcel); + dist.setSize(nParcel); label i = 0; scalar mSum = 0.0; @@ -392,75 +398,86 @@ inline Foam::scalar Foam::KinematicCloud<CloudType>::penetration // calculate total mass across all processors reduce(mSum, sumOp<scalar>()); + Pstream::gatherList(procMass); + Pstream::gatherList(procDist); - // flatten the mass list - List<scalar> allMass(nParcelSum, 0.0); - SubList<scalar> - ( - allMass, - globalParcels.localSize(Pstream::myProcNo()), - globalParcels.offset(Pstream::myProcNo()) - ).assign(mass); - - // flatten the distance list - SortableList<scalar> allDist(nParcelSum, 0.0); - SubList<scalar> - ( - allDist, - globalParcels.localSize(Pstream::myProcNo()), - globalParcels.offset(Pstream::myProcNo()) - ).assign(dist); - - // sort allDist distances into ascending order - // note: allMass masses are left unsorted - allDist.sort(); - - if (nParcelSum > 1) + if (Pstream::master()) { - const scalar mLimit = fraction*mSum; - const labelList& indices = allDist.indices(); - - if (mLimit > (mSum - allMass[indices.last()])) + // flatten the mass lists + List<scalar> allMass(nParcelSum, 0.0); + SortableList<scalar> allDist(nParcelSum, 0.0); + for (label procI = 0; procI < Pstream::nProcs(); procI++) { - distance = allDist.last(); - } - else - { - // assuming that 'fraction' is generally closer to 1 than 0, loop - // through in reverse distance order - const scalar mThreshold = (1.0 - fraction)*mSum; - scalar mCurrent = 0.0; - label i0 = 0; + SubList<scalar> + ( + allMass, + globalParcels.localSize(procI), + globalParcels.offset(procI) + ).assign(procMass[procI]); - forAllReverse(indices, i) - { - label indI = indices[i]; + // flatten the distance list + SubList<scalar> + ( + allDist, + globalParcels.localSize(procI), + globalParcels.offset(procI) + ).assign(procDist[procI]); + } - mCurrent += allMass[indI]; + // sort allDist distances into ascending order + // note: allMass masses are left unsorted + allDist.sort(); - if (mCurrent > mThreshold) - { - i0 = i; - break; - } - } + if (nParcelSum > 1) + { + const scalar mLimit = fraction*mSum; + const labelList& indices = allDist.indices(); - if (i0 == indices.size() - 1) + if (mLimit > (mSum - allMass[indices.last()])) { distance = allDist.last(); } else { - // linearly interpolate to determine distance - scalar alpha = (mCurrent - mThreshold)/allMass[indices[i0]]; - distance = allDist[i0] + alpha*(allDist[i0+1] - allDist[i0]); + // assuming that 'fraction' is generally closer to 1 than 0, + // loop through in reverse distance order + const scalar mThreshold = (1.0 - fraction)*mSum; + scalar mCurrent = 0.0; + label i0 = 0; + + forAllReverse(indices, i) + { + label indI = indices[i]; + + mCurrent += allMass[indI]; + + if (mCurrent > mThreshold) + { + i0 = i; + break; + } + } + + if (i0 == indices.size() - 1) + { + distance = allDist.last(); + } + else + { + // linearly interpolate to determine distance + scalar alpha = (mCurrent - mThreshold)/allMass[indices[i0]]; + distance = + allDist[i0] + alpha*(allDist[i0+1] - allDist[i0]); + } } } + else + { + distance = allDist.first(); + } } - else - { - distance = allDist.first(); - } + + Pstream::scatter(distance); return distance; } diff --git a/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.C b/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.C index 039e3fb2533849e36872836efe3c5d19d55a6de6..a502eb02fd6c206d351dca7f41348f3dc397b423 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.C +++ b/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.C @@ -171,12 +171,7 @@ Foam::tmp<Foam::vectorField> Foam::axesRotation::transform const vectorField& st ) const { - notImplemented - ( - "tmp<vectorField> Foam::axesRotation:: " - "transform(const vectorField& st) const" - ); - return tmp<vectorField>(NULL); + return (R_ & st); } @@ -185,12 +180,7 @@ Foam::tmp<Foam::vectorField> Foam::axesRotation::invTransform const vectorField& st ) const { - notImplemented - ( - "tmp<vectorField> Foam::axesRotation::" - "invTransform(const vectorField& st) const" - ); - return tmp<vectorField>(NULL); + return (Rtr_ & st); } diff --git a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C index 9a2f655624042f151c2dc57c4e4a4ca30c287df2..ad392c506bdef7e6c6b91aabf992118a9d0683e6 100644 --- a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C @@ -146,6 +146,7 @@ Foam::scalarTransport::scalarTransport active_(true), phiName_("phi"), UName_("U"), + rhoName_("rho"), DT_(0.0), userDT_(false), resetOnStartUp_(false), @@ -192,6 +193,7 @@ void Foam::scalarTransport::read(const dictionary& dict) phiName_ = dict.lookupOrDefault<word>("phiName", "phi"); UName_ = dict.lookupOrDefault<word>("UName", "U"); + rhoName_ = dict.lookupOrDefault<word>("rhoName", "rho"); userDT_ = false; if (dict.readIfPresent("DT", DT_)) @@ -237,24 +239,59 @@ void Foam::scalarTransport::execute() relaxCoeff = mesh_.equationRelaxationFactor(schemeVar); } - // solve - for (label i = 0; i <= nCorr_; i++) + if (phi.dimensions() == dimMass/dimTime) { - fvScalarMatrix TEqn - ( - fvm::ddt(T_) - + fvm::div(phi, T_, divScheme) - - fvm::laplacian(DT, T_, laplacianScheme) - == - fvOptions_(T_) - ); + const volScalarField& rho = + mesh_.lookupObject<volScalarField>(rhoName_); + + // solve + for (label i = 0; i <= nCorr_; i++) + { + fvScalarMatrix TEqn + ( + fvm::ddt(rho, T_) + + fvm::div(phi, T_, divScheme) + - fvm::laplacian(DT, T_, laplacianScheme) + == + fvOptions_(rho, T_) + ); + + TEqn.relax(relaxCoeff); + + fvOptions_.constrain(TEqn); + + TEqn.solve(mesh_.solverDict(schemeVar)); + } + } + else if (phi.dimensions() == dimVolume/dimTime) + { + // solve + for (label i = 0; i <= nCorr_; i++) + { + fvScalarMatrix TEqn + ( + fvm::ddt(T_) + + fvm::div(phi, T_, divScheme) + - fvm::laplacian(DT, T_, laplacianScheme) + == + fvOptions_(T_) + ); - TEqn.relax(relaxCoeff); + TEqn.relax(relaxCoeff); - fvOptions_.constrain(TEqn); + fvOptions_.constrain(TEqn); - TEqn.solve(mesh_.solverDict(UName_)); + TEqn.solve(mesh_.solverDict(schemeVar)); + } } + else + { + FatalErrorIn("void Foam::scalarTransport::execute()") + << "Incompatible dimensions for phi: " << phi.dimensions() << nl + << "Dimensions should be " << dimMass/dimTime << " or " + << dimVolume/dimTime << endl; + } + Info<< endl; } diff --git a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H index fdeecdf3604e4ce6d6e5f5c035ed8a8e883abd9b..a58ed2268049379831ceaff4c1042434300d6f52 100644 --- a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H @@ -90,6 +90,9 @@ class scalarTransport //- Name of velocity field (optional) word UName_; + //- Name of density field (optional) + word rhoName_; + //- Diffusion coefficient (optional) scalar DT_; diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L index 678300a172ca945e6da19b0cea0377a753de995e..6db89e7a69e732a957455696770a62f24bfbfc90 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L @@ -439,20 +439,25 @@ bool finishReaction = false; <readThermoSpecieName>{thermoSpecieName} { string specieString(foamSpecieString(YYText())); - // Old format - size_t spacePos = specieString.find(' '); - if (spacePos != string::npos) + if (newFormat_) { - currentSpecieName = specieString(0, spacePos); + specieString.replaceAll(" ", "_"); + size_t strEnd = specieString.find_last_not_of('_'); + currentSpecieName = specieString.substr(0, strEnd + 1); } else { - currentSpecieName = specieString; + size_t spacePos = specieString.find(' '); + if (spacePos != string::npos) + { + currentSpecieName = specieString(0, spacePos); + } + else + { + currentSpecieName = specieString; + } } - // New format - // specieString.replaceAll(" ", "_"); - // size_t strEnd = specieString.find_last_not_of('_'); - // currentSpecieName = specieString.substr(0, strEnd + 1); + BEGIN(readThermoDate); } diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C index 5ee2a03ac3da93eda3043e7c6ccd96948a99b327..63dd057f3d9f5ea52d3f85b016563e866fec64aa 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -862,13 +862,15 @@ Foam::chemkinReader::chemkinReader ( const fileName& CHEMKINFileName, speciesTable& species, - const fileName& thermoFileName + const fileName& thermoFileName, + const bool newFormat ) : lineNo_(1), specieNames_(10), speciesTable_(species), - reactions_(speciesTable_, speciesThermo_) + reactions_(speciesTable_, speciesThermo_), + newFormat_(newFormat) { read(CHEMKINFileName, thermoFileName); } @@ -883,8 +885,14 @@ Foam::chemkinReader::chemkinReader lineNo_(1), specieNames_(10), speciesTable_(species), - reactions_(speciesTable_, speciesThermo_) + reactions_(speciesTable_, speciesThermo_), + newFormat_(thermoDict.lookupOrDefault("newFormat", false)) { + if (newFormat_) + { + Info<< "Reading CHEMKIN thermo data in new file format" << endl; + } + fileName chemkinFile(fileName(thermoDict.lookup("CHEMKINFile")).expand()); fileName thermoFile = fileName::null; diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H index 4cd84f59a507b93d2aa3fcc5b3f35dfdc213a881..ad1c50abd8589c33190e9f0ffcf9f60d2485ed1f 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,6 +39,7 @@ SourceFiles #include "chemistryReader.H" #include "fileName.H" #include "typeInfo.H" +#include "Switch.H" #include "HashPtrTable.H" #include "ReactionList.H" #include "DynamicList.H" @@ -207,6 +208,9 @@ private: //- List of the reactions ReactionList<gasHThermoPhysics> reactions_; + //- Flag to indicate that file is in new format + Switch newFormat_; + // Private Member Functions @@ -319,7 +323,8 @@ public: ( const fileName& chemkinFile, speciesTable& species, - const fileName& thermoFileName = fileName::null + const fileName& thermoFileName = fileName::null, + const bool newFormat = false ); //- Construct by getting the CHEMKIN III file name from dictionary diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvOptions b/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvOptions index b150d51b8f0bd76a38f2c675609965072624ec03..66a2b807520ffe5ac1c89c4d752d42c2f0638ac2 100644 --- a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvOptions +++ b/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvOptions @@ -33,8 +33,14 @@ porosity1 coordinateSystem { - e1 (0.70710678 0.70710678 0); - e3 (0 0 1); + type cartesian; + origin (0 0 0); + coordinateRotation + { + type axesRotation; + e1 (0.70710678 0.70710678 0); + e3 (0 0 1); + } } } } diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict index c5e80f8d1a3715a2600d25caa26d4fb32be862cf..a6e206d5256b2bd365ca802844aaedffd1c81b50 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict @@ -54,10 +54,17 @@ geometry scale (1.0 1.0 2.1); transform { - type cartesian; - origin (2 2 0); - e1 (1 0 0); - e3 (0 0 1); + coordinateSystem + { + type cartesian; + origin (2 2 0); + coordinateRotation + { + type axesRotation; + e1 (1 0 0); + e3 (0 0 1); + } + } } } herring @@ -66,10 +73,17 @@ geometry scale (1.0 1.0 2.1); transform { - type cartesian; - origin (3.5 3 0); - e1 (1 0 0); - e3 (0 0 1); + coordinateSystem + { + type cartesian; + origin (3.5 3 0); + coordinateRotation + { + type axesRotation; + e1 (1 0 0); + e3 (0 0 1); + } + } } } } diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/thermophysicalProperties index 5ba8a553e166d823df34a7093c9c7523fce744f0..95579e34cb51bd580ceb7debb125ff47a8c7a6aa 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/thermophysicalProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/thermophysicalProperties @@ -17,7 +17,7 @@ FoamFile thermoType { - type hePsiThermo; + type heRhoThermo; mixture pureMixture; transport const; thermo hConst; diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSolution index d30cdf20b496e354128a273418811f504df1abed..b19527e0cecdb50be8f3a026bb41a7b4ba686900 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSolution +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSolution @@ -42,16 +42,16 @@ solvers SIMPLE { - momentumPredictor yes; + momentumPredictor no; nNonOrthogonalCorrectors 0; pRefCell 0; pRefValue 0; residualControl { - p_rgh 1e-2; - U 1e-3; - h 1e-3; + p_rgh 1e-4; + U 1e-4; + h 1e-4; // possibly check turbulence fields "(k|epsilon|omega)" 1e-3; diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/thermophysicalProperties index 5ba8a553e166d823df34a7093c9c7523fce744f0..95579e34cb51bd580ceb7debb125ff47a8c7a6aa 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/thermophysicalProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/thermophysicalProperties @@ -17,7 +17,7 @@ FoamFile thermoType { - type hePsiThermo; + type heRhoThermo; mixture pureMixture; transport const; thermo hConst; diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/thermophysicalProperties index 7964a240aea24312d6d4b1a1e7957de22fe8e85b..ab678e4d8862b1080531600e7fc902e2144afbc4 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/thermophysicalProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/thermophysicalProperties @@ -17,7 +17,7 @@ FoamFile thermoType { - type hePsiThermo; + type heRhoThermo; mixture pureMixture; transport const; thermo hConst; diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties index 7964a240aea24312d6d4b1a1e7957de22fe8e85b..ab678e4d8862b1080531600e7fc902e2144afbc4 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties @@ -17,7 +17,7 @@ FoamFile thermoType { - type hePsiThermo; + type heRhoThermo; mixture pureMixture; transport const; thermo hConst; diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/constant/thermophysicalProperties index 4c4cce2da77acfd5f526551b39ace115ed1f1917..55b50fd4b41f02830fd3438ff782ce59ec709996 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/constant/thermophysicalProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/constant/thermophysicalProperties @@ -15,11 +15,9 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// thermoType hePsiThermo<pureMixture<const<hConst<perfectGas<specie>>,sensibleEnthalpy>>>; - thermoType { - type hePsiThermo; + type heRhoThermo; mixture pureMixture; transport const; thermo hConst; diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/fvOptions b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/fvOptions index 475ac8e04026f46bd037d6bde5a6ece872345137..e0562a385109a6b6e25313a6189c55ea842a4723 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/fvOptions +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/fvOptions @@ -51,8 +51,14 @@ porosityBlockage coordinateSystem { - e1 (0 1 0); - e2 (0 0 1); + type cartesian; + origin (0 0 0); + coordinateRotation + { + type axesRotation; + e1 (0 1 0); + e2 (0 0 1); + } } } } diff --git a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/chemistryProperties b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/chemistryProperties index deb5491013c05aed54633d71e45a00b846466bd8..ea16d954f1b6ac9f838e400fb3c901e68d253a6e 100644 --- a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/chemistryProperties +++ b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/chemistryProperties @@ -21,7 +21,7 @@ chemistryType chemistryThermo psi; } -chemistry off; +chemistry on; initialChemicalTimeStep 1e-07; diff --git a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/combustionProperties b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/combustionProperties index 8f326f366756a02663e3cfeaed1ea4a0f4e5ce2d..f7b1cae9b7e231c48821bf9f85a80971d1bc85a9 100644 --- a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/combustionProperties +++ b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/combustionProperties @@ -15,9 +15,9 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR<psiChemistryCombustion>; +combustionModel PaSR<psiChemistryCombustion>; -active false; +active yes; PaSRCoeffs { diff --git a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/thermophysicalProperties b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/thermophysicalProperties index b0ac29548bc09dd4224d2bb7dadbb7c0552f65e2..ebae047d0b2c937d4449fb44388eb763070cec25 100644 --- a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/thermophysicalProperties +++ b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/thermophysicalProperties @@ -28,7 +28,9 @@ thermoType CHEMKINFile "$FOAM_CASE/chemkin/chem.inp"; -CHEMKINThermoFile "~OpenFOAM/thermoData/therm.dat"; +CHEMKINThermoFile "$FOAM_CASE/chemkin/therm.dat"; + +newFormat yes; inertSpecie N2; diff --git a/tutorials/lagrangian/sprayFoam/aachenBomb/system/controlDict b/tutorials/lagrangian/sprayFoam/aachenBomb/system/controlDict index 89dc909c58b7dc17c22478a8b6de6c2b35a0d03c..7c512bc41b8db80e2d80b87af07e7c6fa7150838 100644 --- a/tutorials/lagrangian/sprayFoam/aachenBomb/system/controlDict +++ b/tutorials/lagrangian/sprayFoam/aachenBomb/system/controlDict @@ -8,7 +8,7 @@ FoamFile { version 2.0; - format binary; + format ascii; class dictionary; location "system"; object controlDict;