diff --git a/applications/solvers/combustion/chemFoam/readInitialConditions.H b/applications/solvers/combustion/chemFoam/readInitialConditions.H index d929b14128c31846ca02b528f6771c7ef19b04ee..b25fd944c50504289bbf0aa801e2204e299c3596 100644 --- a/applications/solvers/combustion/chemFoam/readInitialConditions.H +++ b/applications/solvers/combustion/chemFoam/readInitialConditions.H @@ -15,15 +15,15 @@ } label nSpecie = Y.size(); - PtrList<gasThermoPhysics> specieData(Y.size()); + PtrList<gasHThermoPhysics> specieData(Y.size()); forAll(specieData, i) { specieData.set ( i, - new gasThermoPhysics + new gasHThermoPhysics ( - dynamic_cast<const reactingMixture<gasThermoPhysics>&> + dynamic_cast<const reactingMixture<gasHThermoPhysics>&> (thermo).speciesData()[i] ) ); diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/pEqn.H index 8a83efdd86bb743fb2835f4ae5c3a30c9e166c89..7d843b62e045c9a993ae11c9d174c344eb9df665 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/pEqn.H @@ -5,11 +5,10 @@ rho.relax(); volScalarField rAU(1.0/UEqn().A()); volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1())); - volVectorField HbyA("HbyA", U); -HbyA = rAU*(UEqn() == fvOptions(rho, U))().H(); +HbyA = rAU*UEqn().H(); -if (pimple.nCorrPIMPLE() <= 1) +if (pimple.nCorrPISO() <= 1) { UEqn.clear(); } @@ -26,6 +25,8 @@ if (pimple.transonic()) ) ); + fvOptions.relativeFlux(fvc::interpolate(psi), phid); + surfaceScalarField phic ( "phic", @@ -48,12 +49,9 @@ if (pimple.transonic()) fvOptions(psi, p, rho.name()) ); - // Relax the pressure equation to maintain diagonal dominance - pEqn.relax(); - fvOptions.constrain(pEqn); - pEqn.solve(); + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) { @@ -73,6 +71,8 @@ else ) ); + fvOptions.relativeFlux(fvc::interpolate(rho), phiHbyA); + phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf(); HbyA -= (rAU - rAtU)*fvc::grad(p); @@ -91,7 +91,7 @@ else fvOptions.constrain(pEqn); - pEqn.solve(); + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) { diff --git a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H index 61917fcefd59c192145aeac427225cd580142df8..0f5bbdb1629c1cb5c31e57565c1623b0f8ea9432 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H @@ -1,9 +1,4 @@ { - rho = thermo.rho(); - rho = max(rho, rhoMin); - rho = min(rho, rhoMax); - rho.relax(); - volScalarField rAU(1.0/UEqn().A()); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn().H(); diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/UEqn.H b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/UEqn.H index 9398c3e8d03d7a74826a6712ece620f5f6851dcf..b4c7207138d34b2138a329176444e1ee7b7f2711 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/UEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/UEqn.H @@ -4,12 +4,12 @@ ( fvm::div(phi, U) + turbulence->divDevRhoReff(U) + == + fvOptions(rho, U) ); UEqn().relax(); - mrfZones.addCoriolis(rho, UEqn()); - // Include the porous media resistance and solve the momentum equation // either implicit in the tensorial resistance or transport using by // including the spherical part of the resistance in the momentum diagonal @@ -30,7 +30,7 @@ for (int UCorr=0; UCorr<nUCorr; UCorr++) { - U = trTU() & ((UEqn() == fvOptions(rho, U))().H() - gradp); + U = trTU() & (UEqn().H() - gradp); } U.correctBoundaryConditions(); @@ -42,7 +42,7 @@ fvOptions.constrain(UEqn()); - solve(UEqn() == -fvc::grad(p) + fvOptions(rho, U)); + solve(UEqn() == -fvc::grad(p)); fvOptions.correct(U); diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/createZones.H b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/createZones.H index 614460f82bbc395c3f6022118604ae0adbefd590..fe3d1186087af2b57fcfaa1268b5c5c00676c115 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/createZones.H +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/createZones.H @@ -1,6 +1,3 @@ - IOMRFZoneList mrfZones(mesh); - mrfZones.correctBoundaryVelocity(U); - IOporosityModelList pZones(mesh); Switch pressureImplicitPorosity(false); diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/pEqn.H index dd9723b9db1c6d94c9c07e6032c677a22a232325..2d9a8f40d4e229526a6e9afc5d7b76842bd08ba5 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/pEqn.H @@ -1,20 +1,15 @@ { - rho = thermo.rho(); - rho = max(rho, rhoMin); - rho = min(rho, rhoMax); - rho.relax(); - const volScalarField& psi = thermo.psi(); volVectorField HbyA("HbyA", U); if (pressureImplicitPorosity) { - HbyA = trTU() & (UEqn() == fvOptions(rho, U))().H(); + HbyA = trTU() & UEqn().H(); } else { - HbyA = trAU()*(UEqn() == fvOptions(rho, U))().H(); + HbyA = trAU()*UEqn().H(); } UEqn.clear(); @@ -27,7 +22,7 @@ fvc::interpolate(rho*HbyA) & mesh.Sf() ); - mrfZones.relativeFlux(fvc::interpolate(rho), phiHbyA); + fvOptions.relativeFlux(fvc::interpolate(rho), phiHbyA); closedVolume = adjustPhi(phiHbyA, U, p); diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C index 628c1cabe4b6d917114a66326e0277d2a190fa5a..fd30404ae6b3c7dbffcb1e9b73c58de8f312faf6 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C @@ -27,14 +27,13 @@ Application Description Steady-state solver for turbulent flow of compressible fluids with RANS turbulence modelling, implicit or explicit porosity treatment - and MRF for HVAC and similar applications. + and run-time selectable finite volume sources. \*---------------------------------------------------------------------------*/ #include "fvCFD.H" #include "rhoThermo.H" #include "RASModel.H" -#include "IOMRFZoneList.H" #include "fvIOoptionList.H" #include "IOporosityModelList.H" #include "simpleControl.H" diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/pEqn.H index 3ff183f5671992fae3d18ca257e10e6a593d65a6..353593b7f4091db1e9f357dba3115a6a16e7afce 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/pEqn.H @@ -1,13 +1,8 @@ -rho = thermo.rho(); -rho = max(rho, rhoMin); -rho = min(rho, rhoMax); -rho.relax(); - volScalarField rAU(1.0/UEqn().A()); volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1())); volVectorField HbyA("HbyA", U); -HbyA = rAU*(UEqn() == fvOptions(rho, U))().H(); +HbyA = rAU*UEqn().H(); UEqn.clear(); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options index cadaf0850daaa9242d22a22b7b5276a6f9751f6e..365e64d1b131efbad40267c5bfa19437e3a3c3a6 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options @@ -4,11 +4,13 @@ EXE_INC = \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude \ -I$(LIB_SRC)/transportModels \ - -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel + -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ + -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ - -lincompressibleTransportModels + -lincompressibleTransportModels \ + -lradiationModels diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H index dbfc61739f7d21e2d095ae55181831345fc05a75..708d968d6c6df30a9521a9c5e1c3a70471155fb4 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H @@ -9,10 +9,14 @@ fvm::ddt(T) + fvm::div(phi, T) - fvm::laplacian(kappaEff, T) + == + radiation->ST(rhoCpRef, T) ); TEqn.relax(); TEqn.solve(); + radiation->correct(); + rhok = 1.0 - beta*(T - TRef); } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C index 126e10b3376db7ed71df101e5bb395241434ada8..65dda0653e0917f509c141bb2ca45938d046a508 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C @@ -49,6 +49,7 @@ Description #include "singlePhaseTransportModel.H" #include "RASModel.H" #include "pimpleControl.H" +#include "radiationModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -59,6 +60,7 @@ int main(int argc, char *argv[]) #include "createMesh.H" #include "readGravitationalAcceleration.H" #include "createFields.H" + #include "createIncompressibleRadiationModel.H" #include "initContinuityErrs.H" #include "readTimeControls.H" #include "CourantNo.H" diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H index ee2a95f2082b2a298e2ac4a53ae7d307191f1e2d..b6cf96b5b0d368cd9ba5d2882587afaf6fb78e05 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H @@ -17,7 +17,8 @@ ) - fvm::laplacian(turbulence->alphaEff(), he) == - fvOptions(rho, he) + radiation->Sh(thermo) + + fvOptions(rho, he) ); EEqn.relax(); @@ -29,4 +30,5 @@ fvOptions.correct(he); thermo.correct(); + radiation->correct(); } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C index 48b28a07e491f777ee2c718757f28dd3e4d28107..5297be327f2d6fe69f8725f0987f51a1b4c0f4aa 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C @@ -40,13 +40,14 @@ Description #include "rhoThermo.H" #include "turbulenceModel.H" #include "fixedGradientFvPatchFields.H" +#include "zeroGradientFvPatchFields.H" #include "regionProperties.H" #include "compressibleCourantNo.H" #include "solidRegionDiffNo.H" #include "solidThermo.H" #include "radiationModel.H" #include "fvIOoptionList.H" - +#include "coordinateSystem.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C index d076652a1dd2b9759add875df934b731a11b3145..a3615c4309ad487272c631ce96d2c81a9834e0f8 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C @@ -37,6 +37,7 @@ Description #include "solidThermo.H" #include "radiationModel.H" #include "fvIOoptionList.H" +#include "coordinateSystem.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/solveSolid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/solveSolid.H index 7573002af52e47423c72abede50f870fa812cdcf..93f7146730fb5180b92f1396fa4bf12698d052e3 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/solveSolid.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/solveSolid.H @@ -3,7 +3,9 @@ { fvScalarMatrix hEqn ( - - fvm::laplacian(betav*alpha, h, "laplacian(alpha,h)") + thermo.isotropic() + ? -fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)") + : -fvm::laplacian(betav*tAnialpha(), h, "laplacian(alpha,h)") + fvOptions(rho, h) ); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H index df3915980b546d54504a774b894929a170db062d..703ed6e4c2cde1456c96ebda5b01920793298c81 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H @@ -1,4 +1,5 @@ // Initialise solid field pointer lists + PtrList<coordinateSystem> coordinates(solidRegions.size()); PtrList<solidThermo> thermos(solidRegions.size()); PtrList<radiation::radiationModel> radiations(solidRegions.size()); PtrList<fv::IOoptionList> solidHeatSources(solidRegions.size()); @@ -23,6 +24,16 @@ new fv::IOoptionList(solidRegions[i]) ); + if (!thermos[i].isotropic()) + { + Info<< " Adding coordinateSystems\n" << endl; + coordinates.set + ( + i, + coordinateSystem::New(solidRegions[i], thermos[i]) + ); + } + IOobject betavSolidIO ( "betavSolid", diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H index ad8894a631552af47a127e7fbcaabc62b36f588a..a36fa7e98fcb163da272d8defcd3206033b79e9a 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H @@ -8,10 +8,36 @@ tmp<volScalarField> tcp = thermo.Cp(); const volScalarField& cp = tcp(); - tmp<volScalarField> talpha = thermo.alpha(); - const volScalarField& alpha = talpha(); - tmp<volScalarField> tkappa = thermo.kappa(); - const volScalarField& kappa = tkappa(); + tmp<volSymmTensorField> tAnialpha; + + if (!thermo.isotropic()) + { + tmp<volVectorField> tkappaCp = thermo.Kappa()/cp; + + const coordinateSystem& coodSys = coordinates[i]; + tAnialpha = + tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "Anialpha", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + tkappaCp().dimensions(), + zeroGradientFvPatchVectorField::typeName + ) + ); + + volSymmTensorField& Anialpha = tAnialpha(); + Anialpha.internalField() = coodSys.R().transformVector(tkappaCp()); + Anialpha.correctBoundaryConditions(); + } volScalarField& h = thermo.he(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C index 437ea78327462d81682bd59c630399111835002f..9ec57f2f92fad8c27b2bbec760753fc0788bdcfe 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.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) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,38 +56,4 @@ Foam::scalar Foam::solidRegionDiffNo return DiNum; } - -Foam::scalar Foam::solidRegionDiffNo -( - const fvMesh& mesh, - const Time& runTime, - const volScalarField& Cprho, - const volSymmTensorField& kappadirectional -) -{ - scalar DiNum = 0.0; - scalar meanDiNum = 0.0; - - volScalarField kappa(mag(kappadirectional)); - - //- Take care: can have fluid domains with 0 cells so do not test for - // zero internal faces. - surfaceScalarField kapparhoCpbyDelta - ( - mesh.surfaceInterpolation::deltaCoeffs() - * fvc::interpolate(kappa) - / fvc::interpolate(Cprho) - ); - - DiNum = gMax(kapparhoCpbyDelta.internalField())*runTime.deltaT().value(); - - meanDiNum = (average(kapparhoCpbyDelta)).value()*runTime.deltaT().value(); - - Info<< "Region: " << mesh.name() << " Diffusion Number mean: " << meanDiNum - << " max: " << DiNum << endl; - - return DiNum; -} - - // ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.H index cb4dd30b6a3801b7674abfe4a17c27e516a819e6..77eda7c843551345d460e98f5d371b3972df5217 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.H @@ -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) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,15 +41,6 @@ namespace Foam const volScalarField& Cprho, const volScalarField& kappa ); - - scalar solidRegionDiffNo - ( - const fvMesh& mesh, - const Time& runTime, - const volScalarField& Cprho, - const volSymmTensorField& kappa - ); - } #endif diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H index 878780baf1df939beceb7efde5ff738d5da93d84..a7a65b17bd4c9863a23d0749d64e3cbcb5af5348 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H @@ -1,18 +1,29 @@ - scalar DiNum = -GREAT; +scalar DiNum = -GREAT; - forAll(solidRegions, i) +forAll(solidRegions, i) +{ + #include "setRegionSolidFields.H" + + tmp<volScalarField> magKappa; + if (thermo.isotropic()) + { + magKappa = thermo.kappa(); + } + else { - #include "setRegionSolidFields.H" + magKappa = mag(thermo.Kappa()); + } - DiNum = max + DiNum = max + ( + solidRegionDiffNo ( - solidRegionDiffNo - ( - solidRegions[i], - runTime, - rho*cp, - kappa - ), - DiNum - ); - } + solidRegions[i], + runTime, + rho*cp, + magKappa() + ), + DiNum + ); + +} diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H index 86f23292e37445c2cddc27fe4c651290e4cd9e1d..7bf7562d9b6736cff2e9c81cffdfe71a8b89f570 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H @@ -9,7 +9,11 @@ if (finalIter) tmp<fvScalarMatrix> hEqn ( fvm::ddt(betav*rho, h) - - fvm::laplacian(betav*alpha, h, "laplacian(alpha,h)") + - ( + thermo.isotropic() + ? fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)") + : fvm::laplacian(betav*tAnialpha(), h, "laplacian(alpha,h)") + ) == fvOptions(rho, h) ); diff --git a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/UrelEqn.H b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/UrelEqn.H index 6750d98f36053a91c04c557fcb136a1e5ac9ed4c..5aa6cef0b147a6126a32a94c420f4bceb88d9ccd 100644 --- a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/UrelEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/UrelEqn.H @@ -5,12 +5,14 @@ + fvm::div(phi, Urel) + turbulence->divDevReff(Urel) + SRF->Su() + == + fvOptions(Urel) ); UrelEqn().relax(); fvOptions.constrain(UrelEqn()); - solve(UrelEqn() == -fvc::grad(p) + fvOptions(Urel)); + solve(UrelEqn() == -fvc::grad(p)); fvOptions.correct(Urel); diff --git a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H index 9b5b1a89a4d43e94cbb70961099eb00a2f98eab5..8aa20cd151820ef2aac265387efacce7cac58798 100644 --- a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H @@ -1,6 +1,6 @@ volScalarField rAUrel(1.0/UrelEqn().A()); volVectorField HbyA("HbyA", Urel); -HbyA = rAUrel*(UrelEqn() == fvOptions(Urel))().H(); +HbyA = rAUrel*UrelEqn().H(); if (pimple.nCorrPISO() <= 1) { diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/UEqn.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/UEqn.H index 7a7d604b4845a1de98438c770c5c880626e0a103..430e60c8482ea288a734f51f5a35dcf434dde0bf 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/UEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/UEqn.H @@ -5,6 +5,8 @@ tmp<fvVectorMatrix> UEqn fvm::ddt(U) + fvm::div(phi, U) + turbulence->divDevReff(U) + == + fvOptions(U) ); UEqn().relax(); diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H index 217304168b44ff7732acab44781c0186166d9ace..4c48bb2a183583040188c1e320cddd1e0fba1878 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H @@ -1,5 +1,5 @@ volVectorField HbyA("HbyA", U); -HbyA = rAU*(UEqn() == fvOptions(U))().H(); +HbyA = rAU*UEqn().H(); if (pimple.nCorrPISO() <= 1) { diff --git a/applications/solvers/incompressible/potentialFreeSurfaceFoam/UEqn.H b/applications/solvers/incompressible/potentialFreeSurfaceFoam/UEqn.H index 4c84e256c0dba8b472beb901eceece3d1a93fbd4..69a95ab712a4be9076de49c4ffc5012b8d4a2d2f 100644 --- a/applications/solvers/incompressible/potentialFreeSurfaceFoam/UEqn.H +++ b/applications/solvers/incompressible/potentialFreeSurfaceFoam/UEqn.H @@ -3,6 +3,8 @@ tmp<fvVectorMatrix> UEqn fvm::ddt(U) + fvm::div(phi, U) + turbulence->divDevReff(U) + == + fvOptions(U) ); @@ -12,7 +14,7 @@ fvOptions.constrain(UEqn()); if (pimple.momentumPredictor()) { - solve(UEqn() == -fvc::grad(p_gh) + fvOptions(U)); + solve(UEqn() == -fvc::grad(p_gh)); fvOptions.correct(U); } diff --git a/applications/solvers/incompressible/potentialFreeSurfaceFoam/pEqn.H b/applications/solvers/incompressible/potentialFreeSurfaceFoam/pEqn.H index 780bb2802246ad7adcdd9c0f0313570308d3fc87..6f6b9834e4098417c774a2439228917fcbeb55fd 100644 --- a/applications/solvers/incompressible/potentialFreeSurfaceFoam/pEqn.H +++ b/applications/solvers/incompressible/potentialFreeSurfaceFoam/pEqn.H @@ -2,7 +2,7 @@ volScalarField rAU(1.0/UEqn().A()); surfaceScalarField rAUf("Dp", fvc::interpolate(rAU)); volVectorField HbyA("HbyA", U); -HbyA = rAU*(UEqn() == fvOptions(U))().H(); +HbyA = rAU*UEqn().H(); if (pimple.nCorrPISO() <= 1) { @@ -18,6 +18,7 @@ surfaceScalarField phiHbyA adjustPhi(phiHbyA, U, p_gh); +fvOptions.relativeFlux(phiHbyA); // Non-orthogonal pressure corrector loop while (pimple.correctNonOrthogonal()) diff --git a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C index c4503cc10119f5dddb0e7d86179fafd042790706..1425a3e5f2b516d709e2b2e72b19303622e6d956 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C @@ -36,7 +36,6 @@ Description #include "basicReactingMultiphaseCloud.H" #include "rhoCombustionModel.H" #include "radiationModel.H" -#include "IOporosityModelList.H" #include "fvIOoptionList.H" #include "SLGThermo.H" #include "pimpleControl.H" diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Make/options b/applications/solvers/multiphase/multiphaseEulerFoam/Make/options index 688b9364b63c3840446bc89927e9c8718fc7975f..7cd8f48ee4bb5632913fa492abcce2a26b9522dd 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/Make/options +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Make/options @@ -1,4 +1,4 @@ -EXE_INC = -g \ +EXE_INC = \ -IphaseModel/lnInclude \ -ImultiphaseSystem/lnInclude \ -ImultiphaseFixedFluxPressure \ diff --git a/applications/test/PatchTools/Make/files b/applications/test/PatchTools/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..d148320dc59930d5d7a5428af43acb1a2ce70dc2 --- /dev/null +++ b/applications/test/PatchTools/Make/files @@ -0,0 +1,3 @@ +Test-PatchTools.C + +EXE = $(FOAM_USER_APPBIN)/Test-PatchTools diff --git a/applications/test/PatchTools/Make/options b/applications/test/PatchTools/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..3d00e249a66f6ee6588d843f9f96365eb695e931 --- /dev/null +++ b/applications/test/PatchTools/Make/options @@ -0,0 +1,7 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/surfMesh/lnInclude + +EXE_LIBS = \ + -lfiniteVolume diff --git a/applications/test/PatchTools/Test-PatchTools.C b/applications/test/PatchTools/Test-PatchTools.C new file mode 100644 index 0000000000000000000000000000000000000000..4cf3eb0a0bf1adce5d52223349e10b8b7d3f6651 --- /dev/null +++ b/applications/test/PatchTools/Test-PatchTools.C @@ -0,0 +1,297 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012-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 + testPatchTools + +Description + Test app for PatchTools functionality + +\*---------------------------------------------------------------------------*/ + +#include "PatchTools.H" +#include "argList.H" +#include "fvMesh.H" +#include "volFields.H" +#include "Time.H" +#include "OBJstream.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +//template<class PatchType> +//Foam::tmp<Foam::pointField> +//areaPointNormals +//( +// const polyMesh& mesh, +// const PatchType& p, +// const labelList& meshFaces +//) +//{ +// // Assume patch is smaller than the globalData().coupledPatch() (?) so +// // loop over patch meshPoints. +// +// const labelList& meshPoints = p.meshPoints(); +// +// const globalMeshData& globalData = mesh.globalData(); +// const indirectPrimitivePatch& coupledPatch = globalData.coupledPatch(); +// const Map<label>& coupledPatchMP = coupledPatch.meshPointMap(); +// const mapDistribute& map = globalData.globalPointSlavesMap(); +// const globalIndexAndTransform& transforms = +// globalData.globalTransforms(); +// +// +// // 1. Start off with local (area-weighted) normals +// // (note:without calculating pointNormals +// // to avoid them being stored) +// +// tmp<pointField> textrudeN(new pointField(p.nPoints(), vector::zero)); +// pointField& extrudeN = textrudeN(); +// { +// const faceList& localFaces = p.localFaces(); +// const vectorField& faceAreas = mesh.faceAreas(); +// +// forAll(localFaces, faceI) +// { +// const face& f = localFaces[faceI]; +// const vector& n = faceAreas[meshFaces[faceI]]; +// forAll(f, fp) +// { +// extrudeN[f[fp]] += n; +// } +// } +// } +// +// +// // Collect local pointFaces +// List<List<point> > pointFaceNormals(map.constructSize()); +// { +// const vectorField& faceAreas = mesh.faceAreas(); +// +// forAll(meshPoints, patchPointI) +// { +// label meshPointI = meshPoints[patchPointI]; +// Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointI); +// if (fnd != coupledPatchMP.end()) +// { +// label coupledPointI = fnd(); +// +// List<point>& pNormals = pointFaceNormals[coupledPointI]; +// const labelList& pFaces = p.pointFaces()[patchPointI]; +// pNormals.setSize(pFaces.size()); +// forAll(pFaces, i) +// { +// pNormals[i] = faceAreas[meshFaces[pFaces[i]]]; +// } +// } +// } +// } +// +// // Pull remote data into local slots +// map.distribute +// ( +// transforms, +// pointFaceNormals, +// listTransform() +// ); +// +// +// // Combine normals +// const labelListList& slaves = globalData.globalPointSlaves(); +// const labelListList& transformedSlaves = +// globalData.globalPointTransformedSlaves(); +// +// +// pointField coupledPointNormals(map.constructSize(), vector::zero); +// +// forAll(meshPoints, patchPointI) +// { +// label meshPointI = meshPoints[patchPointI]; +// Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointI); +// if (fnd != coupledPatchMP.end()) +// { +// label coupledPointI = fnd(); +// const labelList& slaveSlots = slaves[coupledPointI]; +// const labelList& transformedSlaveSlots = +// transformedSlaves[coupledPointI]; +// +// label nFaces = slaveSlots.size()+transformedSlaveSlots.size(); +// if (nFaces > 0) +// { +// // Combine +// point& n = coupledPointNormals[coupledPointI]; +// +// n += sum(pointFaceNormals[coupledPointI]); +// +// forAll(slaveSlots, i) +// { +// n += sum(pointFaceNormals[slaveSlots[i]]); +// } +// forAll(transformedSlaveSlots, i) +// { +// n += sum(pointFaceNormals[transformedSlaveSlots[i]]); +// } +// +// // Put back into slave slots +// forAll(slaveSlots, i) +// { +// coupledPointNormals[slaveSlots[i]] = n; +// } +// forAll(transformedSlaveSlots, i) +// { +// coupledPointNormals[transformedSlaveSlots[i]] = n; +// } +// } +// } +// } +// +// +// // Send back +// map.reverseDistribute +// ( +// transforms, +// coupledPointNormals.size(), +// coupledPointNormals, +// mapDistribute::transform() +// ); +// +// +// // Override patch normals +// forAll(meshPoints, patchPointI) +// { +// label meshPointI = meshPoints[patchPointI]; +// Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointI); +// if (fnd != coupledPatchMP.end()) +// { +// label coupledPointI = fnd(); +// extrudeN[patchPointI] = coupledPointNormals[coupledPointI]; +// } +// } +// +// extrudeN /= mag(extrudeN)+VSMALL; +// +// return textrudeN; +//} + + + +// Main program: + +int main(int argc, char *argv[]) +{ +# include "addTimeOptions.H" + argList::validArgs.append("patch"); +# include "setRootCase.H" +# include "createTime.H" + +# include "createMesh.H" + + const word patchName = args[1]; + label patchI = mesh.boundaryMesh().findPatchID(patchName); + const polyPatch& pp = mesh.boundaryMesh()[patchI]; + + const indirectPrimitivePatch& cpp = mesh.globalData().coupledPatch(); + + { + OBJstream str(runTime.path()/"edgePatchNormals.obj"); + + labelList patchEdges; + labelList coupledEdges; + PackedBoolList sameEdgeOrientation; + PatchTools::matchEdges + ( + pp, + cpp, + patchEdges, + coupledEdges, + sameEdgeOrientation + ); + + const pointField en + ( + PatchTools::edgeNormals + ( + mesh, + pp, + patchEdges, + coupledEdges + ) + ); + + forAll(en, patchEdgeI) + { + const edge& patchE = pp.edges()[patchEdgeI]; + //str.write(pp.localPoints()[pointI], en[pointI]); + const point pt = patchE.centre(pp.localPoints()); + str.write(linePointRef(pt, pt + 0.1*en[patchEdgeI])); + } + } + + + return 0; + + +// { +// OBJstream str(runTime.path()/"unweightedPatchNormals.obj"); +// +// const pointField pn +// ( +// PatchTools::pointNormals +// ( +// mesh, +// pp, +// identity(pp.size())+pp.start() +// ) +// ); +// forAll(pn, pointI) +// { +// str.write(linePointRef(pp.localPoints()[pointI], pn[pointI])); +// } +// } +// { +// OBJstream str(runTime.path()/"areaWeightedPatchNormals.obj"); +// +// const pointField pn +// ( +// areaPointNormals +// ( +// mesh, +// pp, +// identity(pp.size())+pp.start() +// ) +// ); +// forAll(pn, pointI) +// { +// str.write(linePointRef(pp.localPoints()[pointI], pn[pointI])); +// } +// } + + + Pout<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C index bafe30550467b75f30c33effec03008170addf4e..cdd6f52d15fce2954c01764e5f51700260adb9f3 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -383,12 +383,7 @@ int main(int argc, char *argv[]) // Determine extrudePatch normal pointField extrudePatchPointNormals ( - PatchTools::pointNormals //calcNormals - ( - mesh, - extrudePatch, - meshFaces - ) + PatchTools::pointNormals(mesh, extrudePatch) ); @@ -629,12 +624,13 @@ int main(int argc, char *argv[]) const labelListList& layerFaces = layerExtrude.layerFaces(); backPatchFaces.setSize(layerFaces.size()); frontPatchFaces.setSize(layerFaces.size()); - forAll(backPatchFaces, i) + forAll(backPatchFaces, patchFaceI) { - backPatchFaces[i] = layerFaces[i].first(); - frontPatchFaces[i] = layerFaces[i].last(); + backPatchFaces[patchFaceI] = layerFaces[patchFaceI].first(); + frontPatchFaces[patchFaceI] = layerFaces[patchFaceI].last(); } + // Create dummy fvSchemes, fvSolution createDummyFvMeshFiles(mesh, regionDir); @@ -654,6 +650,13 @@ int main(int argc, char *argv[]) mesh ); + layerExtrude.updateMesh + ( + map(), + identity(extrudePatch.size()), + identity(extrudePatch.nPoints()) + ); + // Calculate face labels for front and back. frontPatchFaces = renumber ( diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/options b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/options index 9a1bd9942c97cc352b8d14e5a92e62de35537a7a..49cad25f210163dffa9ff87fe916b6e6dffc4b10 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/options +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/options @@ -1,10 +1,12 @@ EXE_INC = \ + -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/mesh/extrudeModel/lnInclude EXE_LIBS = \ + -lsurfMesh \ -lfiniteVolume \ -lmeshTools \ -ldynamicMesh \ diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C index b159f9c096dd5e8d5813568a2fe52a9d3abfeee3..112de47faf92be168361d9d626ee8a027baea00f 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -133,6 +133,8 @@ Notes: #include "pointFields.H" //#include "ReadFields.H" #include "fvMeshTools.H" +#include "OBJstream.H" +#include "PatchTools.H" using namespace Foam; @@ -1233,6 +1235,252 @@ void setCouplingInfo } +// Extrude and write geometric properties +void extrudeGeometricProperties +( + const polyMesh& mesh, + const primitiveFacePatch& extrudePatch, + const createShellMesh& extruder, + const polyMesh& regionMesh, + const extrudeModel& model +) +{ + const pointIOField patchFaceCentres + ( + IOobject + ( + "patchFaceCentres", + mesh.pointsInstance(), + mesh.meshSubDir, + mesh, + IOobject::MUST_READ + ) + ); + + const pointIOField patchEdgeCentres + ( + IOobject + ( + "patchEdgeCentres", + mesh.pointsInstance(), + mesh.meshSubDir, + mesh, + IOobject::MUST_READ + ) + ); + + //forAll(extrudePatch.edges(), edgeI) + //{ + // const edge& e = extrudePatch.edges()[edgeI]; + // Pout<< "Edge:" << e.centre(extrudePatch.localPoints()) << nl + // << "read:" << patchEdgeCentres[edgeI] + // << endl; + //} + + + // Determine edge normals on original patch + labelList patchEdges; + labelList coupledEdges; + PackedBoolList sameEdgeOrientation; + PatchTools::matchEdges + ( + extrudePatch, + mesh.globalData().coupledPatch(), + patchEdges, + coupledEdges, + sameEdgeOrientation + ); + + pointField patchEdgeNormals + ( + PatchTools::edgeNormals + ( + mesh, + extrudePatch, + patchEdges, + coupledEdges + ) + ); + + + pointIOField faceCentres + ( + IOobject + ( + "faceCentres", + regionMesh.pointsInstance(), + regionMesh.meshSubDir, + regionMesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + regionMesh.nFaces() + ); + + + // Work out layers. Guaranteed in columns so no fancy parallel bits. + + + forAll(extruder.faceToFaceMap(), faceI) + { + if (extruder.faceToFaceMap()[faceI] != 0) + { + // 'horizontal' face + label patchFaceI = mag(extruder.faceToFaceMap()[faceI])-1; + + label cellI = regionMesh.faceOwner()[faceI]; + if (regionMesh.isInternalFace(faceI)) + { + cellI = max(cellI, regionMesh.faceNeighbour()[faceI]); + } + + // Calculate layer from cell numbering (see createShellMesh) + label layerI = (cellI % model.nLayers()); + + if + ( + !regionMesh.isInternalFace(faceI) + && extruder.faceToFaceMap()[faceI] > 0 + ) + { + // Top face + layerI++; + } + + + // Recalculate based on extrusion model + faceCentres[faceI] = model + ( + patchFaceCentres[patchFaceI], + extrudePatch.faceNormals()[patchFaceI], + layerI + ); + } + else + { + // 'vertical face + label patchEdgeI = extruder.faceToEdgeMap()[faceI]; + label layerI = + ( + regionMesh.faceOwner()[faceI] + % model.nLayers() + ); + + // Extrude patch edge centre to this layer + point pt0 = model + ( + patchEdgeCentres[patchEdgeI], + patchEdgeNormals[patchEdgeI], + layerI + ); + // Extrude patch edge centre to next layer + point pt1 = model + ( + patchEdgeCentres[patchEdgeI], + patchEdgeNormals[patchEdgeI], + layerI+1 + ); + + // Interpolate + faceCentres[faceI] = 0.5*(pt0+pt1); + } + } + + pointIOField cellCentres + ( + IOobject + ( + "cellCentres", + regionMesh.pointsInstance(), + regionMesh.meshSubDir, + regionMesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + regionMesh.nCells() + ); + + forAll(extruder.cellToFaceMap(), cellI) + { + label patchFaceI = extruder.cellToFaceMap()[cellI]; + + // Calculate layer from cell numbering (see createShellMesh) + label layerI = (cellI % model.nLayers()); + + // Recalculate based on extrusion model + point pt0 = model + ( + patchFaceCentres[patchFaceI], + extrudePatch.faceNormals()[patchFaceI], + layerI + ); + point pt1 = model + ( + patchFaceCentres[patchFaceI], + extrudePatch.faceNormals()[patchFaceI], + layerI+1 + ); + + // Interpolate + cellCentres[cellI] = 0.5*(pt0+pt1); + } + + + // Bit of checking + if (false) + { + OBJstream faceStr(regionMesh.time().path()/"faceCentres.obj"); + OBJstream cellStr(regionMesh.time().path()/"cellCentres.obj"); + + forAll(faceCentres, faceI) + { + Pout<< "Model :" << faceCentres[faceI] << endl + << "regionMesh:" << regionMesh.faceCentres()[faceI] << endl; + faceStr.write + ( + linePointRef + ( + faceCentres[faceI], + regionMesh.faceCentres()[faceI] + ) + ); + } + forAll(cellCentres, cellI) + { + Pout<< "Model :" << cellCentres[cellI] << endl + << "regionMesh:" << regionMesh.cellCentres()[cellI] << endl; + cellStr.write + ( + linePointRef + ( + cellCentres[cellI], + regionMesh.cellCentres()[cellI] + ) + ); + } + } + + + + Info<< "Writing geometric properties for mesh " << regionMesh.name() + << " to " << regionMesh.pointsInstance() << nl + << endl; + + bool ok = faceCentres.write() && cellCentres.write(); + + if (!ok) + { + FatalErrorIn("extrudeGeometricProperties(..)") + << "Failed writing " << faceCentres.objectPath() + << " and " << cellCentres.objectPath() + << exit(FatalError); + } +} + + + // Main program: int main(int argc, char *argv[]) @@ -2393,6 +2641,36 @@ int main(int argc, char *argv[]) } + // See if we need to extrude coordinates as well + { + autoPtr<pointIOField> patchFaceCentresPtr; + + IOobject io + ( + "patchFaceCentres", + mesh.pointsInstance(), + mesh.meshSubDir, + mesh, + IOobject::MUST_READ + ); + if (io.headerOk()) + { + // Read patchFaceCentres and patchEdgeCentres + Info<< "Reading patch face,edge centres : " + << io.name() << " and patchEdgeCentres" << endl; + + extrudeGeometricProperties + ( + mesh, + extrudePatch, + extruder, + regionMesh, + model() + ); + } + } + + // Insert baffles into original mesh diff --git a/applications/utilities/miscellaneous/foamHelp/Allwclean b/applications/utilities/miscellaneous/foamHelp/Allwclean new file mode 100755 index 0000000000000000000000000000000000000000..9dca480e2ec1907c6f27fb2e9b1eac70843a4b38 --- /dev/null +++ b/applications/utilities/miscellaneous/foamHelp/Allwclean @@ -0,0 +1,8 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +wclean libso helpTypes +wclean + + +# ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/doxygenXmlParser/doxygenXmlParser.C b/applications/utilities/miscellaneous/foamHelp/helpTypes/doxygenXmlParser/doxygenXmlParser.C index acf9a72d2406dcfa843de9092ba8885e21952ab7..ac9c639c497956968433375dc05fc8123f71c9a3 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/doxygenXmlParser/doxygenXmlParser.C +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/doxygenXmlParser/doxygenXmlParser.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -176,46 +176,40 @@ Foam::doxygenXmlParser::doxygenXmlParser // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::doxygenXmlParser::skipBlock(IFstream& is, const word blockName) const +void Foam::doxygenXmlParser::skipBlock +( + IFstream& is, + const word& blockName +) const { // recurse to move forward in 'is' until come across </blockName> - string closeName = ""; - // fast-forward until we reach a '<' char c; - while (is.get(c) && c != '<') - {} - - // check to see if this is a closing block - if (is.get(c) && c == '/') + while (is.good() && (closeName != blockName)) { - while (is.get(c) && c != '>') - { - closeName += c; - } + // fast-forward until we reach a '<' + while (is.get(c) && c != '<') + {} - if (closeName == blockName) + // check to see if this is a closing block + if (is.get(c) && c == '/') { - // finished reading block - return; - } - else - { - skipBlock(is, blockName); + closeName = ""; + + while (is.get(c) && c != '>') + { + closeName += c; + } } } - else - { - skipBlock(is, blockName); - } } void Foam::doxygenXmlParser::skipForward ( IFstream& is, - const word blockName + const word& blockName ) const { // recurse to move forward in 'is' until come across <blockName> diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/doxygenXmlParser/doxygenXmlParser.H b/applications/utilities/miscellaneous/foamHelp/helpTypes/doxygenXmlParser/doxygenXmlParser.H index f2abdaee8d4f6c9f9e071b807f80e4e5b92663cf..9853589fa3e3b688a55b9923bddece682b8e188b 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/doxygenXmlParser/doxygenXmlParser.H +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/doxygenXmlParser/doxygenXmlParser.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,8 +25,10 @@ Class Foam::doxygenXmlParser Description + Parser for doxygen XML SourceFiles + doxygenXmlParser.C \*---------------------------------------------------------------------------*/ @@ -65,10 +67,10 @@ public: // Member functions //- Skip past a block - void skipBlock(IFstream& is, const word blockName) const; + void skipBlock(IFstream& is, const word& blockName) const; //- Skip forward to block - void skipForward(IFstream& is, const word blockName) const; + void skipForward(IFstream& is, const word& blockName) const; //- Return the entry template<class Type> diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpType.C b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpType.C index 0b982e76a7e03a466df79b076609b570ba810060..29ad9ddbde30963b7001891fd3c5127612ac81cb 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpType.C +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpType.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -148,7 +148,12 @@ void Foam::helpType::displayDoc { FatalErrorIn ( - "void Foam::helpType::displayDoc(const word, const string)" + "void Foam::helpType::displayDoc" + "(" + "const word&, " + "const string&, " + "const bool" + ")" ) << "No help for type " << className << " found." << " Valid options include:" << SortableList<word>(parser.toc()) diff --git a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C index 09b169821dfdf683c35e9cb827d6a4ccbfe5a6f6..c774d5012c977cc20992bce6a51126e08cdb229e 100644 --- a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C +++ b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,6 +43,24 @@ Description // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +bool haveAllTimes +( + const HashSet<word>& masterTimeDirSet, + const instantList& timeDirs +) +{ + // Loop over all times + forAll(timeDirs, timeI) + { + if (!masterTimeDirSet.found(timeDirs[timeI].name())) + { + return false; + } + } + return true; +} + + int main(int argc, char *argv[]) { argList::addNote @@ -54,7 +72,7 @@ int main(int argc, char *argv[]) // enable -zeroTime to prevent accidentally trashing the initial fields timeSelector::addOptions(true, true); argList::noParallel(); -# include "addRegionOption.H" + #include "addRegionOption.H" argList::addBoolOption ( "allRegions", @@ -86,8 +104,8 @@ int main(int argc, char *argv[]) "only reconstruct new times (i.e. that do not exist already)" ); -# include "setRootCase.H" -# include "createTime.H" + #include "setRootCase.H" + #include "createTime.H" HashSet<word> selectedFields; if (args.optionFound("fields")) @@ -169,6 +187,11 @@ int main(int argc, char *argv[]) { masterTimeDirs = runTime.times(); } + HashSet<word> masterTimeDirSet(2*masterTimeDirs.size()); + forAll(masterTimeDirs, i) + { + masterTimeDirSet.insert(masterTimeDirs[i].name()); + } // Set all times on processor meshes equal to reconstructed mesh @@ -222,6 +245,21 @@ int main(int argc, char *argv[]) Info<< "\n\nReconstructing fields for mesh " << regionName << nl << endl; + if + ( + newTimes + && regionNames.size() == 1 + && regionDirs[0].empty() + && haveAllTimes(masterTimeDirSet, timeDirs) + ) + { + Info<< "Skipping region " << regionName + << " since already have all times" + << endl << endl; + continue; + } + + fvMesh mesh ( IOobject @@ -240,29 +278,16 @@ int main(int argc, char *argv[]) // check face addressing for meshes that have been decomposed // with a very old foam version -# include "checkFaceAddressingComp.H" + #include "checkFaceAddressingComp.H" // Loop over all times forAll(timeDirs, timeI) { - if (newTimes) + if (newTimes && masterTimeDirSet.found(timeDirs[timeI].name())) { - // Compare on timeName, not value - bool foundTime = false; - forAll(masterTimeDirs, i) - { - if (masterTimeDirs[i].name() == timeDirs[timeI].name()) - { - foundTime = true; - break; - } - } - if (foundTime) - { - Info<< "Skipping time " << timeDirs[timeI].name() - << endl << endl; - continue; - } + Info<< "Skipping time " << timeDirs[timeI].name() + << endl << endl; + continue; } diff --git a/etc/codeTemplates/source/_Template.C b/etc/codeTemplates/source/_Template.C index db0fb9ba1afe9e8c4e25f8626982fdf2b61879e4..d34155cec46b009656ec1e78bc2049cba15c5865 100644 --- a/etc/codeTemplates/source/_Template.C +++ b/etc/codeTemplates/source/_Template.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/source/_Template.H b/etc/codeTemplates/source/_Template.H index 1226ef835c0ff1514cc2cc48cc61e28164c538db..2f7c479705e296e796573c0de7ce184873ebefe5 100644 --- a/etc/codeTemplates/source/_Template.H +++ b/etc/codeTemplates/source/_Template.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/source/_TemplateApp.C b/etc/codeTemplates/source/_TemplateApp.C index 070100f96e6dcaefdf21a146b6e8c6fc7093a9de..602a0c44a75a00d819dbaeaba65fb665e44f4943 100644 --- a/etc/codeTemplates/source/_TemplateApp.C +++ b/etc/codeTemplates/source/_TemplateApp.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/source/_TemplateI.H b/etc/codeTemplates/source/_TemplateI.H index 8de09a51e1848a6fe80ad91172d539194fd9b1f5..7e5c62ed284f15daa51cc45feffc33c018aabc20 100644 --- a/etc/codeTemplates/source/_TemplateI.H +++ b/etc/codeTemplates/source/_TemplateI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/source/_TemplateIO.C b/etc/codeTemplates/source/_TemplateIO.C index bb2972330be0573d75699f879d187f0e909074e8..0427c8a3c69d2c43bf1e02c6be0f9fb0a896b008 100644 --- a/etc/codeTemplates/source/_TemplateIO.C +++ b/etc/codeTemplates/source/_TemplateIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/controlDict b/etc/controlDict index 8d67716f3ccfbe54064e84d4f52c29e8e3de629d..b9c41cb3a432c8e9842c4fa5ea9f4968a612ce19 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -46,6 +46,8 @@ InfoSwitches OptimisationSwitches { + // On NFS mounted file system: maximum wait for files to appear/get + // updated. Set to 0 on distributed case. fileModificationSkew 10; //- Modification checking: @@ -1005,6 +1007,22 @@ DimensionSets // but not scaled (only supported for dimensionedScalar, etc) //writeUnits (kg m s K mol A Cd); } + + USCSCoeffs + { + // Basic units + lb lb [ 1 0 0 0 0 0 0 ] 1.0; + ft ft [ 0 1 0 0 0 0 0 ] 1.0; + s s [ 0 0 1 0 0 0 0 ] 1.0; + R R [ 0 0 0 1 0 0 0 ] 1.0; + mol mol [ 0 0 0 0 1 0 0 ] 1.0; + A A [ 0 0 0 0 0 1 0 ] 1.0; + Cd Cd [ 0 0 0 0 0 0 1 ] 1.0; + + // Set of units used for printing. Can be any basic or derived + // but not scaled (only supported for dimensionedScalar, etc) + //writeUnits (lb ft s R mol A Cd); + } } diff --git a/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C b/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C index b30adee72ac286174bd3048c6aadcb8d8fff989b..41f0ff99166416a885652f11cfbeac5f5bc7940d 100644 --- a/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C +++ b/src/OpenFOAM/db/IOobject/IOobjectReadHeader.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 @@ -86,7 +86,7 @@ bool Foam::IOobject::readHeader(Istream& is) } else { - SeriousIOErrorIn("IOobject::readHeader(Istream&)", is) + IOWarningIn("IOobject::readHeader(Istream&)", is) << "First token could not be read or is not the keyword 'FoamFile'" << nl << nl << "Check header is of the form:" << nl << endl; diff --git a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.C b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.C index 4dce3b20280fd4c3fa262d38702f53de1e0e5a54..26a6a45f5755d528a0705a5896bafce5cb253425 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.C +++ b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.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 @@ -64,6 +64,7 @@ Foam::label Foam::dictionaryEntry::startLineNumber() const } } + Foam::label Foam::dictionaryEntry::endLineNumber() const { if (size()) diff --git a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C index cfe9de327350bb6180104bb15450141ad607e51c..8a12740cb6c9fefd3ed4f4b6f419e5a181d6875f 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,16 +27,9 @@ License #include "addToMemberFunctionSelectionTable.H" #include "IStringStream.H" #include "OStringStream.H" -#include "IOstreams.H" -#include "stringOps.H" #include "dynamicCode.H" #include "dynamicCodeContext.H" -#include "dlLibraryTable.H" -#include "OSspecific.H" #include "Time.H" -#include "PstreamReduceOps.H" - -#include "long.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -149,7 +142,9 @@ Foam::functionEntries::codeStream::getFunction // create library if required if (!lib) { - bool create = Pstream::master(); + bool create = + Pstream::master() + || (regIOobject::fileModificationSkew <= 0); // not NFS if (create) { @@ -196,9 +191,52 @@ Foam::functionEntries::codeStream::getFunction //- Only block if we're not doing master-only reading. (flag set by // regIOobject::read, IOdictionary constructor) - if (!regIOobject::masterOnlyReading) + if + ( + !regIOobject::masterOnlyReading + && regIOobject::fileModificationSkew > 0 + ) { - reduce(create, orOp<bool>()); + //- Since the library has only been compiled on the master the + // other nodes need to pick this library up through NFS + // We do this by just polling a few times using the + // fileModificationSkew. + + off_t mySize = Foam::fileSize(libPath); + off_t masterSize = mySize; + Pstream::scatter(masterSize); + + if (mySize < masterSize) + { + Pout<< "Local file " << libPath + << " not of same size (" << mySize + << ") as master (" + << masterSize << "). Waiting for " + << regIOobject::fileModificationSkew + << " seconds." << endl; + Foam::sleep(regIOobject::fileModificationSkew); + + // Recheck local size + mySize = Foam::fileSize(libPath); + + if (mySize < masterSize) + { + FatalIOErrorIn + ( + "functionEntries::codeStream::execute(..)", + parentDict + ) << "Cannot read (NFS mounted) library " << nl + << libPath << nl + << "on processor " << Pstream::myProcNo() + << " detected size " << mySize + << " whereas master size is " << masterSize + << " bytes." << nl + << "If your case is not NFS mounted" + << " (so distributed) set fileModificationSkew" + << " to 0" + << exit(FatalIOError); + } + } } if (isA<IOdictionary>(topDict(parentDict))) diff --git a/src/OpenFOAM/dimensionSet/dimensionSet.C b/src/OpenFOAM/dimensionSet/dimensionSet.C index eb13cdf60b124dc91725a328e5162a014754f300..86868610188a76b364a61d4e6cef222f7ae7a486 100644 --- a/src/OpenFOAM/dimensionSet/dimensionSet.C +++ b/src/OpenFOAM/dimensionSet/dimensionSet.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -430,6 +430,20 @@ Foam::dimensionSet Foam::trans(const dimensionSet& ds) } +Foam::dimensionSet Foam::atan2(const dimensionSet& ds1, const dimensionSet& ds2) +{ + if (dimensionSet::debug && ds1 != ds2) + { + FatalErrorIn("atan2(const dimensionSet&, const dimensionSet&)") + << "Arguments of atan2 have different dimensions" << endl + << " dimensions : " << ds1 << " and " << ds2 << endl + << abort(FatalError); + } + + return dimless; +} + + Foam::dimensionSet Foam::transform(const dimensionSet& ds) { return ds; diff --git a/src/OpenFOAM/dimensionSet/dimensionSet.H b/src/OpenFOAM/dimensionSet/dimensionSet.H index 7a6faf95c45434cd7a5cc4e26119553c2d707d7b..1b03e9e27d182a642bee6d85bd7c46395e02cf3f 100644 --- a/src/OpenFOAM/dimensionSet/dimensionSet.H +++ b/src/OpenFOAM/dimensionSet/dimensionSet.H @@ -354,6 +354,8 @@ public: // for transcendental functions friend dimensionSet trans(const dimensionSet&); + friend dimensionSet atan2(const dimensionSet&, const dimensionSet&); + //- Return the argument; transformations do not change the dimensions friend dimensionSet transform(const dimensionSet&); diff --git a/src/OpenFOAM/dimensionedTypes/dimensionedScalar/dimensionedScalar.C b/src/OpenFOAM/dimensionedTypes/dimensionedScalar/dimensionedScalar.C index b5aea0e5719483fd2376477a5b4ec371c3bdb29e..c1b00f52da6965b457be2cbd92a095a432cd49c7 100644 --- a/src/OpenFOAM/dimensionedTypes/dimensionedScalar/dimensionedScalar.C +++ b/src/OpenFOAM/dimensionedTypes/dimensionedScalar/dimensionedScalar.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 @@ -277,6 +277,21 @@ transFunc(yn) #undef transFunc +dimensionedScalar atan2 +( + const dimensionedScalar& x, + const dimensionedScalar& y +) +{ + return dimensionedScalar + ( + "atan2(" + x.name() + ',' + y.name() + ')', + atan2(x.dimensions(), y.dimensions()), + ::atan2(x.value(), y.value()) + ); +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/dimensionedTypes/dimensionedScalar/dimensionedScalar.H b/src/OpenFOAM/dimensionedTypes/dimensionedScalar/dimensionedScalar.H index bf57a98eb98052e23958607ff093ca8bdee86e8e..96854aecfb4579f92f2d9a97ffc14f68dc467649 100644 --- a/src/OpenFOAM/dimensionedTypes/dimensionedScalar/dimensionedScalar.H +++ b/src/OpenFOAM/dimensionedTypes/dimensionedScalar/dimensionedScalar.H @@ -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 @@ -79,6 +79,7 @@ dimensionedScalar tan(const dimensionedScalar&); dimensionedScalar asin(const dimensionedScalar&); dimensionedScalar acos(const dimensionedScalar&); dimensionedScalar atan(const dimensionedScalar&); +dimensionedScalar atan2(const dimensionedScalar&, const dimensionedScalar&); dimensionedScalar sinh(const dimensionedScalar&); dimensionedScalar cosh(const dimensionedScalar&); dimensionedScalar tanh(const dimensionedScalar&); diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C b/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C index a4296ff91b648c2a412bd8c6224b731af47b6466..fd0967da8102dfbdea02f2704dd5f4c0d9ab3974 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -369,6 +369,263 @@ tmp<DimensionedField<scalar, GeoMesh> > pow return pow(dimensionedScalar(s), tdsf); } + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template<class GeoMesh> +tmp<DimensionedField<scalar, GeoMesh> > atan2 +( + const DimensionedField<scalar, GeoMesh>& dsf1, + const DimensionedField<scalar, GeoMesh>& dsf2 +) +{ + tmp<DimensionedField<scalar, GeoMesh> > tAtan2 + ( + new DimensionedField<scalar, GeoMesh> + ( + IOobject + ( + "atan2(" + dsf1.name() + ',' + dsf2.name() + ')', + dsf1.instance(), + dsf1.db() + ), + dsf1.mesh(), + atan2(dsf1.dimensions(), dsf2.dimensions()) + ) + ); + + atan2(tAtan2().field(), dsf1.field(), dsf2.field()); + + return tAtan2; +} + + +template<class GeoMesh> +tmp<DimensionedField<scalar, GeoMesh> > atan2 +( + const tmp<DimensionedField<scalar, GeoMesh> >& tdsf1, + const DimensionedField<scalar, GeoMesh>& dsf2 +) +{ + const DimensionedField<scalar, GeoMesh>& dsf1 = tdsf1(); + + tmp<DimensionedField<scalar, GeoMesh> > tAtan2 = + reuseTmpDimensionedField<scalar, scalar, GeoMesh>::New + ( + tdsf1, + "atan2(" + dsf1.name() + ',' + dsf2.name() + ')', + atan2(dsf1.dimensions(), dsf2.dimensions()) + ); + + atan2(tAtan2().field(), dsf1.field(), dsf2.field()); + + reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf1); + + return tAtan2; +} + + +template<class GeoMesh> +tmp<DimensionedField<scalar, GeoMesh> > atan2 +( + const DimensionedField<scalar, GeoMesh>& dsf1, + const tmp<DimensionedField<scalar, GeoMesh> >& tdsf2 +) +{ + const DimensionedField<scalar, GeoMesh>& dsf2 = tdsf2(); + + tmp<DimensionedField<scalar, GeoMesh> > tAtan2 = + reuseTmpDimensionedField<scalar, scalar, GeoMesh>::New + ( + tdsf2, + "atan2(" + dsf1.name() + ',' + dsf2.name() + ')', + atan2(dsf1.dimensions(), dsf2.dimensions()) + ); + + atan2(tAtan2().field(), dsf1.field(), dsf2.field()); + + reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf2); + + return tAtan2; +} + +template<class GeoMesh> +tmp<DimensionedField<scalar, GeoMesh> > atan2 +( + const tmp<DimensionedField<scalar, GeoMesh> >& tdsf1, + const tmp<DimensionedField<scalar, GeoMesh> >& tdsf2 +) +{ + const DimensionedField<scalar, GeoMesh>& dsf1 = tdsf1(); + const DimensionedField<scalar, GeoMesh>& dsf2 = tdsf2(); + + tmp<DimensionedField<scalar, GeoMesh> > tAtan2 = + reuseTmpTmpDimensionedField<scalar, scalar, scalar, scalar, GeoMesh>:: + New + ( + tdsf1, + tdsf2, + "atan2(" + dsf1.name() + ',' + dsf2.name() + ')', + atan2(dsf1.dimensions(), dsf2.dimensions()) + ); + + atan2(tAtan2().field(), dsf1.field(), dsf2.field()); + + reuseTmpTmpDimensionedField<scalar, scalar, scalar, scalar, GeoMesh>::clear + ( + tdsf1, + tdsf2 + ); + + return tAtan2; +} + + +template<class GeoMesh> +tmp<DimensionedField<scalar, GeoMesh> > atan2 +( + const DimensionedField<scalar, GeoMesh>& dsf, + const dimensionedScalar& ds +) +{ + tmp<DimensionedField<scalar, GeoMesh> > tAtan2 + ( + new DimensionedField<scalar, GeoMesh> + ( + IOobject + ( + "atan2(" + dsf.name() + ',' + ds.name() + ')', + dsf.instance(), + dsf.db() + ), + dsf.mesh(), + atan2(dsf.dimensions(), ds) + ) + ); + + atan2(tAtan2().field(), dsf.field(), ds.value()); + + return tAtan2; +} + +template<class GeoMesh> +tmp<DimensionedField<scalar, GeoMesh> > atan2 +( + const tmp<DimensionedField<scalar, GeoMesh> >& tdsf, + const dimensionedScalar& ds +) +{ + const DimensionedField<scalar, GeoMesh>& dsf = tdsf(); + + tmp<DimensionedField<scalar, GeoMesh> > tAtan2 = + reuseTmpDimensionedField<scalar, scalar, GeoMesh>::New + ( + tdsf, + "atan2(" + dsf.name() + ',' + ds.name() + ')', + atan2(dsf.dimensions(), ds) + ); + + atan2(tAtan2().field(), dsf.field(), ds.value()); + + reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf); + + return tAtan2; +} + +template<class GeoMesh> +tmp<DimensionedField<scalar, GeoMesh> > atan2 +( + const DimensionedField<scalar, GeoMesh>& dsf, + const scalar& s +) +{ + return atan2(dsf, dimensionedScalar(s)); +} + +template<class GeoMesh> +tmp<DimensionedField<scalar, GeoMesh> > atan2 +( + const tmp<DimensionedField<scalar, GeoMesh> >& tdsf, + const scalar& s +) +{ + return atan2(tdsf, dimensionedScalar(s)); +} + + +template<class GeoMesh> +tmp<DimensionedField<scalar, GeoMesh> > atan2 +( + const dimensionedScalar& ds, + const DimensionedField<scalar, GeoMesh>& dsf +) +{ + tmp<DimensionedField<scalar, GeoMesh> > tAtan2 + ( + new DimensionedField<scalar, GeoMesh> + ( + IOobject + ( + "atan2(" + ds.name() + ',' + dsf.name() + ')', + dsf.instance(), + dsf.db() + ), + dsf.mesh(), + atan2(ds, dsf.dimensions()) + ) + ); + + atan2(tAtan2().field(), ds.value(), dsf.field()); + + return tAtan2; +} + + +template<class GeoMesh> +tmp<DimensionedField<scalar, GeoMesh> > atan2 +( + const dimensionedScalar& ds, + const tmp<DimensionedField<scalar, GeoMesh> >& tdsf +) +{ + const DimensionedField<scalar, GeoMesh>& dsf = tdsf(); + + tmp<DimensionedField<scalar, GeoMesh> > tAtan2 = + reuseTmpDimensionedField<scalar, scalar, GeoMesh>::New + ( + tdsf, + "atan2(" + ds.name() + ',' + dsf.name() + ')', + atan2(ds, dsf.dimensions()) + ); + + atan2(tAtan2().field(), ds.value(), dsf.field()); + + reuseTmpDimensionedField<scalar, scalar, GeoMesh>::clear(tdsf); + + return tAtan2; +} + +template<class GeoMesh> +tmp<DimensionedField<scalar, GeoMesh> > atan2 +( + const scalar& s, + const DimensionedField<scalar, GeoMesh>& dsf +) +{ + return atan2(dimensionedScalar(s), dsf); +} + +template<class GeoMesh> +tmp<DimensionedField<scalar, GeoMesh> > atan2 +( + const scalar& s, + const tmp<DimensionedField<scalar, GeoMesh> >& tdsf +) +{ + return atan2(dimensionedScalar(s), tdsf); +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // UNARY_FUNCTION(scalar, scalar, pow3, pow3) diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.H b/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.H index b6e76631e0402b9e68996c61d75e30b8b2451105..d5e1e54680b06a4f4f3d8f5168dde7c23f5407fd 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.H +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -76,6 +76,9 @@ BINARY_TYPE_OPERATOR_SF(scalar, scalar, scalar, /, '|', divide) BINARY_FUNCTION(scalar, scalar, scalar, pow) BINARY_TYPE_FUNCTION(scalar, scalar, scalar, pow) +BINARY_FUNCTION(scalar, scalar, scalar, atan2) +BINARY_TYPE_FUNCTION(scalar, scalar, scalar, atan2) + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C b/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C index ce78313efb2884b09d65bb0cc51852be380ec0e5..79e253d9f7c93c26d2126db5bb20a91e058ef633 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -115,6 +115,7 @@ BINARY_OPERATOR(scalar, scalar, scalar, /, '|', divide) BINARY_TYPE_OPERATOR_SF(scalar, scalar, scalar, /, '|', divide) + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template<template<class> class PatchField, class GeoMesh> @@ -440,6 +441,315 @@ tmp<GeometricField<scalar, PatchField, GeoMesh> > pow } +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template<template<class> class PatchField, class GeoMesh> +void atan2 +( + GeometricField<scalar, PatchField, GeoMesh>& Atan2, + const GeometricField<scalar, PatchField, GeoMesh>& gsf1, + const GeometricField<scalar, PatchField, GeoMesh>& gsf2 +) +{ + atan2(Atan2.internalField(), gsf1.internalField(), gsf2.internalField()); + atan2(Atan2.boundaryField(), gsf1.boundaryField(), gsf2.boundaryField()); +} + + +template<template<class> class PatchField, class GeoMesh> +tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2 +( + const GeometricField<scalar, PatchField, GeoMesh>& gsf1, + const GeometricField<scalar, PatchField, GeoMesh>& gsf2 +) +{ + tmp<GeometricField<scalar, PatchField, GeoMesh> > tAtan2 + ( + new GeometricField<scalar, PatchField, GeoMesh> + ( + IOobject + ( + "atan2(" + gsf1.name() + ',' + gsf2.name() + ')', + gsf1.instance(), + gsf1.db(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + gsf1.mesh(), + atan2(gsf1.dimensions(), gsf2.dimensions()) + ) + ); + + atan2(tAtan2(), gsf1, gsf2); + + return tAtan2; +} + + +template<template<class> class PatchField, class GeoMesh> +tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2 +( + const tmp<GeometricField<scalar, PatchField, GeoMesh> >& tgsf1, + const GeometricField<scalar, PatchField, GeoMesh>& gsf2 +) +{ + const GeometricField<scalar, PatchField, GeoMesh>& gsf1 = tgsf1(); + + tmp<GeometricField<scalar, PatchField, GeoMesh> > tAtan2 + ( + reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::New + ( + tgsf1, + "atan2(" + gsf1.name() + ',' + gsf2.name() + ')', + atan2(gsf1.dimensions(), gsf2.dimensions()) + ) + ); + + atan2(tAtan2(), gsf1, gsf2); + + reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::clear(tgsf1); + + return tAtan2; +} + + +template<template<class> class PatchField, class GeoMesh> +tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2 +( + const GeometricField<scalar, PatchField, GeoMesh>& gsf1, + const tmp<GeometricField<scalar, PatchField, GeoMesh> >& tgsf2 +) +{ + const GeometricField<scalar, PatchField, GeoMesh>& gsf2 = tgsf2(); + + tmp<GeometricField<scalar, PatchField, GeoMesh> > tAtan2 + ( + reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::New + ( + tgsf2, + "atan2(" + gsf1.name() + ',' + gsf2.name() + ')', + atan2( gsf1.dimensions(), gsf2.dimensions()) + ) + ); + + atan2(tAtan2(), gsf1, gsf2); + + reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::clear(tgsf2); + + return tAtan2; +} + +template<template<class> class PatchField, class GeoMesh> +tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2 +( + const tmp<GeometricField<scalar, PatchField, GeoMesh> >& tgsf1, + const tmp<GeometricField<scalar, PatchField, GeoMesh> >& tgsf2 +) +{ + const GeometricField<scalar, PatchField, GeoMesh>& gsf1 = tgsf1(); + const GeometricField<scalar, PatchField, GeoMesh>& gsf2 = tgsf2(); + + tmp<GeometricField<scalar, PatchField, GeoMesh> > tAtan2 + ( + reuseTmpTmpGeometricField + <scalar, scalar, scalar, scalar, PatchField, GeoMesh>::New + ( + tgsf1, + tgsf2, + "atan2(" + gsf1.name() + ',' + gsf2.name() + ')', + atan2(gsf1.dimensions(), gsf2.dimensions()) + ) + ); + + atan2(tAtan2(), gsf1, gsf2); + + reuseTmpTmpGeometricField + <scalar, scalar, scalar, scalar, PatchField, GeoMesh> + ::clear(tgsf1, tgsf2); + + return tAtan2; +} + + +template<template<class> class PatchField, class GeoMesh> +void atan2 +( + GeometricField<scalar, PatchField, GeoMesh>& tAtan2, + const GeometricField<scalar, PatchField, GeoMesh>& gsf, + const dimensioned<scalar>& ds +) +{ + atan2(tAtan2.internalField(), gsf.internalField(), ds.value()); + atan2(tAtan2.boundaryField(), gsf.boundaryField(), ds.value()); +} + + +template<template<class> class PatchField, class GeoMesh> +tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2 +( + const GeometricField<scalar, PatchField, GeoMesh>& gsf, + const dimensionedScalar& ds +) +{ + tmp<GeometricField<scalar, PatchField, GeoMesh> > tAtan2 + ( + new GeometricField<scalar, PatchField, GeoMesh> + ( + IOobject + ( + "atan2(" + gsf.name() + ',' + ds.name() + ')', + gsf.instance(), + gsf.db(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + gsf.mesh(), + atan2(gsf.dimensions(), ds) + ) + ); + + atan2(tAtan2(), gsf, ds); + + return tAtan2; +} + +template<template<class> class PatchField, class GeoMesh> +tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2 +( + const tmp<GeometricField<scalar, PatchField, GeoMesh> >& tgsf, + const dimensionedScalar& ds +) +{ + const GeometricField<scalar, PatchField, GeoMesh>& gsf = tgsf(); + + tmp<GeometricField<scalar, PatchField, GeoMesh> > tAtan2 + ( + reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::New + ( + tgsf, + "atan2(" + gsf.name() + ',' + ds.name() + ')', + atan2(gsf.dimensions(), ds) + ) + ); + + atan2(tAtan2(), gsf, ds); + + reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::clear(tgsf); + + return tAtan2; +} + +template<template<class> class PatchField, class GeoMesh> +tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2 +( + const GeometricField<scalar, PatchField, GeoMesh>& gsf, + const scalar& s +) +{ + return atan2(gsf, dimensionedScalar(s)); +} + +template<template<class> class PatchField, class GeoMesh> +tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2 +( + const tmp<GeometricField<scalar, PatchField, GeoMesh> >& tgsf, + const scalar& s +) +{ + return atan2(tgsf, dimensionedScalar(s)); +} + + +template<template<class> class PatchField, class GeoMesh> +void atan2 +( + GeometricField<scalar, PatchField, GeoMesh>& tAtan2, + const dimensioned<scalar>& ds, + const GeometricField<scalar, PatchField, GeoMesh>& gsf +) +{ + atan2(tAtan2.internalField(), ds.value(), gsf.internalField()); + atan2(tAtan2.boundaryField(), ds.value(), gsf.boundaryField()); +} + + +template<template<class> class PatchField, class GeoMesh> +tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2 +( + const dimensionedScalar& ds, + const GeometricField<scalar, PatchField, GeoMesh>& gsf +) +{ + tmp<GeometricField<scalar, PatchField, GeoMesh> > tAtan2 + ( + new GeometricField<scalar, PatchField, GeoMesh> + ( + IOobject + ( + "atan2(" + ds.name() + ',' + gsf.name() + ')', + gsf.instance(), + gsf.db(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + gsf.mesh(), + atan2(ds, gsf.dimensions()) + ) + ); + + atan2(tAtan2(), ds, gsf); + + return tAtan2; +} + + +template<template<class> class PatchField, class GeoMesh> +tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2 +( + const dimensionedScalar& ds, + const tmp<GeometricField<scalar, PatchField, GeoMesh> >& tgsf +) +{ + const GeometricField<scalar, PatchField, GeoMesh>& gsf = tgsf(); + + tmp<GeometricField<scalar, PatchField, GeoMesh> > tAtan2 + ( + reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::New + ( + tgsf, + "atan2(" + ds.name() + ',' + gsf.name() + ')', + atan2(ds, gsf.dimensions()) + ) + ); + + atan2(tAtan2(), ds, gsf); + + reuseTmpGeometricField<scalar, scalar, PatchField, GeoMesh>::clear(tgsf); + + return tAtan2; +} + +template<template<class> class PatchField, class GeoMesh> +tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2 +( + const scalar& s, + const GeometricField<scalar, PatchField, GeoMesh>& gsf +) +{ + return atan2(dimensionedScalar(s), gsf); +} + +template<template<class> class PatchField, class GeoMesh> +tmp<GeometricField<scalar, PatchField, GeoMesh> > atan2 +( + const scalar& s, + const tmp<GeometricField<scalar, PatchField, GeoMesh> >& tgsf +) +{ + return atan2(dimensionedScalar(s), tgsf); +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // UNARY_FUNCTION(scalar, scalar, pow3, pow3) diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.H b/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.H index fd20e171c9c0e28f346381a51b9d0d92f214bb87..a7bc057e9ebaf2fa21de3ca28ce13c95c24bf5f1 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.H +++ b/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -84,6 +84,9 @@ BINARY_TYPE_OPERATOR_SF(scalar, scalar, scalar, /, '|', divide) BINARY_FUNCTION(scalar, scalar, scalar, pow) BINARY_TYPE_FUNCTION(scalar, scalar, scalar, pow) +BINARY_FUNCTION(scalar, scalar, scalar, atan2) +BINARY_TYPE_FUNCTION(scalar, scalar, scalar, atan2) + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchTools.H b/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchTools.H index 968b0b52441cf3898afbd93a340ddf25559d3071..439c120b450df4b5c3247089086e9fc4562275c5 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchTools.H +++ b/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchTools.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -221,8 +221,7 @@ public: ); - //- Return parallel consistent point normals for patches (on boundary faces) - // using mesh points. + //- Return parallel consistent point normals for patches using mesh points. template < class Face, @@ -231,10 +230,27 @@ public: class PointType > static tmp<pointField> pointNormals + ( + const polyMesh&, + const PrimitivePatch<Face, FaceList, PointField, PointType>& + ); + + + //- Return parallel consistent edge normals for patches using mesh points. + // Supply with patch matching info from matchEdges. + template + < + class Face, + template<class> class FaceList, + class PointField, + class PointType + > + static tmp<pointField> edgeNormals ( const polyMesh&, const PrimitivePatch<Face, FaceList, PointField, PointType>&, - const labelList& meshFaces + const labelList& patchEdges, + const labelList& coupledEdges ); diff --git a/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsNormals.C b/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsNormals.C index 02707b9cc58e4dcb3c5ce6c2812ff1b7072f749d..a5cb7fdbb982c4a7d8eae8d1be45bf09d378e8a0 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsNormals.C +++ b/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsNormals.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 @@ -79,8 +79,7 @@ Foam::tmp<Foam::pointField> Foam::PatchTools::pointNormals ( const polyMesh& mesh, - const PrimitivePatch<Face, FaceList, PointField, PointType>& p, - const labelList& meshFaces + const PrimitivePatch<Face, FaceList, PointField, PointType>& p ) { // Assume patch is smaller than the globalData().coupledPatch() (?) so @@ -224,4 +223,90 @@ Foam::PatchTools::pointNormals } +template +< + class Face, + template<class> class FaceList, + class PointField, + class PointType +> + +Foam::tmp<Foam::pointField> +Foam::PatchTools::edgeNormals +( + const polyMesh& mesh, + const PrimitivePatch<Face, FaceList, PointField, PointType>& p, + const labelList& patchEdges, + const labelList& coupledEdges +) +{ + // 1. Start off with local normals + + tmp<pointField> tedgeNormals(new pointField(p.nEdges(), vector::zero)); + pointField& edgeNormals = tedgeNormals(); + { + const labelListList& edgeFaces = p.edgeFaces(); + const vectorField& faceNormals = p.faceNormals(); + + forAll(edgeFaces, edgeI) + { + const labelList& eFaces = edgeFaces[edgeI]; + forAll(eFaces, i) + { + edgeNormals[edgeI] += faceNormals[eFaces[i]]; + } + } + edgeNormals /= mag(edgeNormals)+VSMALL; + } + + + + const globalMeshData& globalData = mesh.globalData(); + const mapDistribute& map = globalData.globalEdgeSlavesMap(); + + + // Convert patch-edge data into cpp-edge data + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + //- Construct with all data in consistent orientation + pointField cppEdgeData(map.constructSize(), vector::zero); + + forAll(patchEdges, i) + { + label patchEdgeI = patchEdges[i]; + label coupledEdgeI = coupledEdges[i]; + cppEdgeData[coupledEdgeI] = edgeNormals[patchEdgeI]; + } + + + // Synchronise + // ~~~~~~~~~~~ + + globalData.syncData + ( + cppEdgeData, + globalData.globalEdgeSlaves(), + globalData.globalEdgeTransformedSlaves(), + map, + globalData.globalTransforms(), + plusEqOp<point>(), // add since normalised later on + mapDistribute::transform() + ); + cppEdgeData /= mag(cppEdgeData)+VSMALL; + + + // Back from cpp-edge to patch-edge data + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + forAll(patchEdges, i) + { + label patchEdgeI = patchEdges[i]; + label coupledEdgeI = coupledEdges[i]; + edgeNormals[patchEdgeI] = cppEdgeData[coupledEdgeI]; + } + + return tedgeNormals; +} + + // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/quaternion/quaternion.C b/src/OpenFOAM/primitives/quaternion/quaternion.C index dc616cb9e7174695fe030b3662bdbc5754fb9180..df54f702cdb45b0aa96d64ae6f19b86572824a53 100644 --- a/src/OpenFOAM/primitives/quaternion/quaternion.C +++ b/src/OpenFOAM/primitives/quaternion/quaternion.C @@ -30,8 +30,8 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // const char* const Foam::quaternion::typeName = "quaternion"; -const Foam::quaternion Foam::quaternion::zero(0, vector::zero); -const Foam::quaternion Foam::quaternion::I(1, vector::zero); +const Foam::quaternion Foam::quaternion::zero(0, vector(0, 0, 0)); +const Foam::quaternion Foam::quaternion::I(1, vector(0, 0, 0)); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/septernion/septernion.C b/src/OpenFOAM/primitives/septernion/septernion.C index 4bbdf82802810664c515751a53984ce030278710..ffac2bd6092ec88e443cb6c196a3c765303d17a6 100644 --- a/src/OpenFOAM/primitives/septernion/septernion.C +++ b/src/OpenFOAM/primitives/septernion/septernion.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 @@ -30,8 +30,16 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // const char* const Foam::septernion::typeName = "septernion"; -const Foam::septernion Foam::septernion::zero(vector::zero, quaternion::zero); -const Foam::septernion Foam::septernion::I(vector::zero, quaternion::I); +const Foam::septernion Foam::septernion::zero +( + vector(0, 0, 0), + quaternion(0, vector(0, 0, 0)) +); +const Foam::septernion Foam::septernion::I +( + vector(0, 0, 0), + quaternion(1, vector(0, 0, 0)) +); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/triad/triad.C b/src/OpenFOAM/primitives/triad/triad.C index b190014b6ea21c776dc99151f6a8fc7774151596..e5bc4dcfffc7f8be5ef0175261f1db96c25ed7db 100644 --- a/src/OpenFOAM/primitives/triad/triad.C +++ b/src/OpenFOAM/primitives/triad/triad.C @@ -38,15 +38,42 @@ const char* const triad::Vector<vector>::typeName = "triad"; template<> const char* triad::Vector<vector>::componentNames[] = {"x", "y", "z"}; -const triad triad::zero(vector::zero, vector::zero, vector::zero); +const triad triad::zero +( + vector(0, 0, 0), + vector(0, 0, 0), + vector(0, 0, 0) +); + +const triad triad::one +( + vector(1, 1, 1), + vector(1, 1, 1), + vector(1, 1, 1) +); + +const triad triad::max +( + vector(VGREAT, VGREAT, VGREAT), + vector(VGREAT, VGREAT, VGREAT), + vector(VGREAT, VGREAT, VGREAT) +); + +const triad triad::min +( + vector(-VGREAT, -VGREAT, -VGREAT), + vector(-VGREAT, -VGREAT, -VGREAT), + vector(-VGREAT, -VGREAT, -VGREAT) +); + +const triad triad::unset +( + vector(VGREAT, VGREAT, VGREAT), + vector(VGREAT, VGREAT, VGREAT), + vector(VGREAT, VGREAT, VGREAT) +); -const triad triad::one(vector::one, vector::one, vector::one); - -const triad triad::max(vector::max, vector::max, vector::max); - -const triad triad::min(vector::min, vector::min, vector::min); - -const triad triad::unset(triad::max); +} } diff --git a/src/combustionModels/FSD/FSDs.C b/src/combustionModels/FSD/FSDs.C index 4ee6d7bb36e1af69b21c4e1473738dee389015fa..aed10a40a1f4a58324238d172c236a2a599bb76a 100644 --- a/src/combustionModels/FSD/FSDs.C +++ b/src/combustionModels/FSD/FSDs.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) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,11 +38,12 @@ namespace Foam { namespace combustionModels { + // Combustion models based on sensibleEnthalpy makeCombustionTypesThermo ( FSD, psiThermoCombustion, - gasThermoPhysics, + gasHThermoPhysics, psiCombustionModel ); @@ -50,7 +51,7 @@ namespace combustionModels ( FSD, psiThermoCombustion, - constGasThermoPhysics, + constGasHThermoPhysics, psiCombustionModel ); @@ -58,7 +59,7 @@ namespace combustionModels ( FSD, rhoThermoCombustion, - gasThermoPhysics, + gasHThermoPhysics, rhoCombustionModel ); @@ -66,7 +67,40 @@ namespace combustionModels ( FSD, rhoThermoCombustion, - constGasThermoPhysics, + constGasHThermoPhysics, + rhoCombustionModel + ); + + // Combustion models based on sensibleInternalEnergy + makeCombustionTypesThermo + ( + FSD, + psiThermoCombustion, + gasEThermoPhysics, + psiCombustionModel + ); + + makeCombustionTypesThermo + ( + FSD, + psiThermoCombustion, + constGasEThermoPhysics, + psiCombustionModel + ); + + makeCombustionTypesThermo + ( + FSD, + rhoThermoCombustion, + gasEThermoPhysics, + rhoCombustionModel + ); + + makeCombustionTypesThermo + ( + FSD, + rhoThermoCombustion, + constGasEThermoPhysics, rhoCombustionModel ); } diff --git a/src/combustionModels/diffusion/diffusions.C b/src/combustionModels/diffusion/diffusions.C index 73c201f0fcc483897c74dba408c4c68ee2bf6156..0376a91bf906e6e71b331e56fd65330568bb8ee9 100644 --- a/src/combustionModels/diffusion/diffusions.C +++ b/src/combustionModels/diffusion/diffusions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,11 +36,12 @@ namespace Foam { namespace combustionModels { + // Combustion models based on sensibleEnthalpy makeCombustionTypesThermo ( diffusion, psiThermoCombustion, - gasThermoPhysics, + gasHThermoPhysics, psiCombustionModel ); @@ -48,7 +49,7 @@ namespace combustionModels ( diffusion, psiThermoCombustion, - constGasThermoPhysics, + constGasHThermoPhysics, psiCombustionModel ); @@ -56,7 +57,7 @@ namespace combustionModels ( diffusion, rhoThermoCombustion, - gasThermoPhysics, + gasHThermoPhysics, rhoCombustionModel ); @@ -64,7 +65,41 @@ namespace combustionModels ( diffusion, rhoThermoCombustion, - constGasThermoPhysics, + constGasHThermoPhysics, + rhoCombustionModel + ); + + // Combustion models based on sensibleInternalEnergy + + makeCombustionTypesThermo + ( + diffusion, + psiThermoCombustion, + gasEThermoPhysics, + psiCombustionModel + ); + + makeCombustionTypesThermo + ( + diffusion, + psiThermoCombustion, + constGasEThermoPhysics, + psiCombustionModel + ); + + makeCombustionTypesThermo + ( + diffusion, + rhoThermoCombustion, + gasEThermoPhysics, + rhoCombustionModel + ); + + makeCombustionTypesThermo + ( + diffusion, + rhoThermoCombustion, + constGasEThermoPhysics, rhoCombustionModel ); } diff --git a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C index b8a48ed0ce879b214d4ee34883971f1eeb2fd5b4..89ea70d85c7986dd9b53342aa877ea5febf0ce66 100644 --- a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C +++ b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,11 +36,47 @@ namespace Foam { namespace combustionModels { + // Combustion models based on sensibleEnthalpy + + makeCombustionTypesThermo + ( + infinitelyFastChemistry, + psiThermoCombustion, + gasHThermoPhysics, + psiCombustionModel + ); + + makeCombustionTypesThermo + ( + infinitelyFastChemistry, + psiThermoCombustion, + constGasHThermoPhysics, + psiCombustionModel + ); + + makeCombustionTypesThermo + ( + infinitelyFastChemistry, + rhoThermoCombustion, + gasHThermoPhysics, + rhoCombustionModel + ); + + makeCombustionTypesThermo + ( + infinitelyFastChemistry, + rhoThermoCombustion, + constGasHThermoPhysics, + rhoCombustionModel + ); + + // Combustion models based on sensibleInternalEnergy + makeCombustionTypesThermo ( infinitelyFastChemistry, psiThermoCombustion, - gasThermoPhysics, + gasEThermoPhysics, psiCombustionModel ); @@ -48,7 +84,7 @@ namespace combustionModels ( infinitelyFastChemistry, psiThermoCombustion, - constGasThermoPhysics, + constGasEThermoPhysics, psiCombustionModel ); @@ -56,7 +92,7 @@ namespace combustionModels ( infinitelyFastChemistry, rhoThermoCombustion, - gasThermoPhysics, + gasEThermoPhysics, rhoCombustionModel ); @@ -64,7 +100,7 @@ namespace combustionModels ( infinitelyFastChemistry, rhoThermoCombustion, - constGasThermoPhysics, + constGasEThermoPhysics, rhoCombustionModel ); } diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C index 12e4ebb6eb99b59da4dcd6f82c1fcbbddca44e6f..49ee1a445e70abd754853161e3d791d9aabe4786 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -2052,6 +2052,9 @@ void Foam::polyTopoChange::reorderCoupledFaces if (anyChanged) { + // Reorder faces according to oldToNew. + reorderCompactFaces(oldToNew.size(), oldToNew); + // Rotate faces (rotation is already in new face indices). forAll(rotation, faceI) { @@ -2060,9 +2063,6 @@ void Foam::polyTopoChange::reorderCoupledFaces inplaceRotateList<List, label>(faces_[faceI], rotation[faceI]); } } - - // Reorder faces according to oldToNew. - reorderCompactFaces(oldToNew.size(), oldToNew); } } diff --git a/src/engine/enginePiston/enginePiston.C b/src/engine/enginePiston/enginePiston.C index b186324fd7e9fb7ff688a16ce989f7bb00dba857..68be48ec087718d67c21051c8aec3cef43c945da 100644 --- a/src/engine/enginePiston/enginePiston.C +++ b/src/engine/enginePiston/enginePiston.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 diff --git a/src/engine/engineValve/engineValve.C b/src/engine/engineValve/engineValve.C index 90daa4a2da6d38a632fde46714c8ef9d321b2227..0be19c39f28fdec6f6972f80354f05224c8e1b2e 100644 --- a/src/engine/engineValve/engineValve.C +++ b/src/engine/engineValve/engineValve.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 diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 063b6fc04cbbdc08c2258c1de97000659c43ca71..47bdb976b3f4d6800b47156a3ec7cc2a5348a2ea 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -381,8 +381,8 @@ $(porosity)/porosityModel/porosityModelNew.C $(porosity)/porosityModel/porosityModelList.C $(porosity)/porosityModel/IOporosityModelList.C $(porosity)/DarcyForchheimer/DarcyForchheimer.C -$(porosity)/powerLaw/powerLaw.C $(porosity)/fixedCoeff/fixedCoeff.C +$(porosity)/powerLaw/powerLaw.C MRF = $(general)/MRF $(MRF)/MRFZone.C diff --git a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C index f46c77e3e293784afbb04d845f41b35ed986096a..3806c56fec1228835edd790f1c75959540c87c65 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.H b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.H index 856089cee68f180442bb56287ebc242a4313ab6b..5648fb09001a2f3b969720c0da350d75f1766743 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.H +++ b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimerTemplates.C b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimerTemplates.C index 27b10a79efd4cb5e60af18ebeb555fe091e1d9e0..f785f673450b98b6afb57bc899c085ca08439f82 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimerTemplates.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimerTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.C b/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.C index b8267f7152a68796fb69825d200e06f040cfca97..2ba2d99b55fa4e60eff1c3fb94103f8fb8bc69f1 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.H b/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.H index 09cf5cfa79d0eaaa94f1c0dd4c271b799eeb3655..ad00c5ff8c1fd8531070183d7a980aac1034380c 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.H +++ b/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C index 3b9a9c6375ac5d8d41869fad88fbc21d2e7c52af..56395ee245573e2a0efc085a50c228c61b1a95d9 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H index 019c063f87eefa886492519933e8ace050cc72ab..0217ebd5848829e686fa22eebf292fdccbe1d9cb 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/fvOptions/include/createFvOptions.H b/src/fvOptions/include/createFvOptions.H index 3b190c2459b831930bee1ae87c52201e1b30262e..a4882baac19e32d33d6ceef0586882f5f29251c8 100644 --- a/src/fvOptions/include/createFvOptions.H +++ b/src/fvOptions/include/createFvOptions.H @@ -1,2 +1 @@ -Info<< "Creating finite volume options" << endl; fv::IOoptionList fvOptions(mesh); diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H index 29e696dc81a734dd6b14150203d9dc6ff6425bc1..7cf68d8d5be1d80a0730b5c2a44a4d475fd61826 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -471,7 +471,7 @@ public: inline scalar rotationalKineticEnergyOfSystem() const; //- Penetration for fraction [0-1] of the current total mass - inline scalar penetration(const scalar& fraction) const; + inline scalar penetration(const scalar fraction) const; //- Mean diameter Dij inline scalar Dij(const label i, const label j) const; diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H index e1c4cf4198404f8601e7572acddc3105e91e7021..be67f1829268a8dd7519f182512d64179bcdca32 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -344,7 +344,7 @@ inline Foam::scalar Foam::KinematicCloud<CloudType>::Dmax() const template<class CloudType> inline Foam::scalar Foam::KinematicCloud<CloudType>::penetration ( - const scalar& fraction + const scalar fraction ) const { if ((fraction < 0) || (fraction > 1)) @@ -353,7 +353,7 @@ inline Foam::scalar Foam::KinematicCloud<CloudType>::penetration ( "inline Foam::scalar Foam::KinematicCloud<CloudType>::penetration" "(" - "const scalar&" + "const scalar" ") const" ) << "fraction should be in the range 0 < fraction < 1" diff --git a/src/lagrangian/spray/submodels/BreakupModel/PilchErdman/PilchErdman.C b/src/lagrangian/spray/submodels/BreakupModel/PilchErdman/PilchErdman.C index d900260410f2762bca73ed3d7c018ad1a844cdfa..2aca8ae5ad602142514d3aa82afea261a21adadf 100644 --- a/src/lagrangian/spray/submodels/BreakupModel/PilchErdman/PilchErdman.C +++ b/src/lagrangian/spray/submodels/BreakupModel/PilchErdman/PilchErdman.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 @@ -127,10 +127,10 @@ bool Foam::PilchErdman<CloudType>::update scalar rho12 = sqrt(rhoc/rho); - scalar Vd = Urmag*rho12*(B1_*taubBar * B2_*taubBar*taubBar); + scalar Vd = Urmag*rho12*(B1_*taubBar + B2_*taubBar*taubBar); scalar Vd1 = sqr(1.0 - Vd/Urmag); Vd1 = max(Vd1, SMALL); - scalar Ds = 2.0*Wec*sigma*Vd1/(Vd1*rhoc*sqr(Urmag)); + scalar Ds = 2.0*Wec*sigma/(Vd1*rhoc*sqr(Urmag)); scalar A = Urmag*rho12/d; scalar taub = taubBar/A; diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C index b224ef609d8ec8448bff2192dbda73517c1cc296..3eb051006f8f1b9c3fef79f2cc47f6ee1afe91a8 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C @@ -1464,15 +1464,7 @@ void Foam::autoLayerDriver::getPatchDisplacement // Determine pointNormal // ~~~~~~~~~~~~~~~~~~~~~ - pointField pointNormals - ( - PatchTools::pointNormals - ( - mesh, - pp, - pp.addressing() - ) - ); + pointField pointNormals(PatchTools::pointNormals(mesh, pp)); // Determine local length scale on patch diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C index bf25526141c8bc6043add647bdb8a4a8c1f60bf2..d6556a95083f401061c99db53c78fdc4f74b9f3e 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C @@ -826,15 +826,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo // Determine pointNormal // ~~~~~~~~~~~~~~~~~~~~~ - pointField pointNormals - ( - PatchTools::pointNormals - ( - mesh, - pp, - pp.addressing() - ) - ); + pointField pointNormals(PatchTools::pointNormals(mesh, pp)); // pointNormals if (debug&meshRefinement::MESH || debug&meshRefinement::LAYERINFO) @@ -1074,15 +1066,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo << featureAngle << " degrees." << endl; scalar featureAngleCos = Foam::cos(degToRad(featureAngle)); - pointField pointNormals - ( - PatchTools::pointNormals - ( - mesh, - pp, - identity(pp.size())+pp.start() - ) - ); + pointField pointNormals(PatchTools::pointNormals(mesh, pp)); forAll(meshPoints, i) { diff --git a/src/meshTools/Make/files b/src/meshTools/Make/files index c8bc7b23a9e403d10a8071abfb580f44ee8ba7ab..dbed9146d33499774583e979eae88d8799650304 100644 --- a/src/meshTools/Make/files +++ b/src/meshTools/Make/files @@ -188,6 +188,9 @@ mappedPatches/mappedPolyPatch/mappedVariableThicknessWallPolyPatch.C mappedPatches/mappedPointPatch/mappedPointPatch.C mappedPatches/mappedPointPatch/mappedWallPointPatch.C +meshStructure/meshStructure.C +meshStructure/topoDistanceData.C +meshStructure/pointTopoDistanceData.C regionCoupled/patches/regionCoupledPolyPatch/regionCoupledBase.C regionCoupled/patches/regionCoupledPolyPatch/regionCoupledPolyPatch.C diff --git a/src/meshTools/coordinateSystems/cartesianCS.C b/src/meshTools/coordinateSystems/cartesianCS.C index 4de586c2e9ea7d4c914491aa844fa0d079886c65..b80a69f5b15f7ca23a5b9b9bdd2d043883b0578d 100644 --- a/src/meshTools/coordinateSystems/cartesianCS.C +++ b/src/meshTools/coordinateSystems/cartesianCS.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 diff --git a/src/meshTools/coordinateSystems/cartesianCS.H b/src/meshTools/coordinateSystems/cartesianCS.H index 3986d8a59ce39883fb0e311d62348a11ca756e53..cdfafc52e4b81e3185a900a09f195f07e9705255 100644 --- a/src/meshTools/coordinateSystems/cartesianCS.H +++ b/src/meshTools/coordinateSystems/cartesianCS.H @@ -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 diff --git a/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.C b/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.C index cf730ec042ee00e0349310f2e20b5d578cf8e91a..a21e24e607b7561dc974b5721fe3e1b014b4e678 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.C +++ b/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.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 diff --git a/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.H b/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.H index ea7aa8f02344c4b87e110ddde7b180f1d44d917f..a0be41ccf247279e3c367b6620b0f8a319abe4fa 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.H +++ b/src/meshTools/coordinateSystems/coordinateRotation/EulerCoordinateRotation.H @@ -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 diff --git a/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.C b/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.C index 3fe8eab17855aa25476eee57e301da6b594aa91b..a8ba4651912828bc5007f953ee729de073521f1e 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.C +++ b/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.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 diff --git a/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.H b/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.H index ba5fabad44f8e77917052acb62697315c213d5a9..e034517c78d1d95a0855030737c9985c301a2c3d 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.H +++ b/src/meshTools/coordinateSystems/coordinateRotation/STARCDCoordinateRotation.H @@ -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 diff --git a/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.C b/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.C index 7d76bc4f313bbffb2f57905e5168c96d7bf93565..039e3fb2533849e36872836efe3c5d19d55a6de6 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.C +++ b/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.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 diff --git a/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.H b/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.H index fd61ebc506b0692ff0b6ba6e1b9eb55a7abc0f83..c755801091a80674712ce1ab20d5ad0c0e8a2a85 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.H +++ b/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.H @@ -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 diff --git a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C index f96e4587bd9b4c10c8762f68bbb1855c75f5bc9d..c9ac59b6093cc238c2aa273124f11783220d9a54 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.C +++ b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.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 diff --git a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.H b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.H index 3cd8ea5276ae5e91e2791afabec19d8f5ae02c02..7564696c3d02b44e59dbeee518e44d568167f5e3 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.H +++ b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotation.H @@ -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 diff --git a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotationNew.C b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotationNew.C index c30c5cb36ea0ec4c530e40644463102ebc4c553a..fe1a0ba00bda167a861f0fbb519623da4c7d70d7 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotationNew.C +++ b/src/meshTools/coordinateSystems/coordinateRotation/coordinateRotationNew.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 diff --git a/src/meshTools/coordinateSystems/coordinateRotation/localAxesRotation.C b/src/meshTools/coordinateSystems/coordinateRotation/localAxesRotation.C index 0c78cc9043d68d5ca9699e719470b22a6dfaf4f3..305601f11693f75b68f473c0daa6c3a50bb26fbe 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/localAxesRotation.C +++ b/src/meshTools/coordinateSystems/coordinateRotation/localAxesRotation.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 @@ -87,10 +87,8 @@ Foam::localAxesRotation::localAxesRotation origin_(), e3_() { - FatalErrorIn - ( - "localAxesRotation(const dictionary&)" - ) << " localAxesRotation can not be contructed from dictionary " + FatalErrorIn("localAxesRotation(const dictionary&)") + << " localAxesRotation can not be contructed from dictionary " << " use the construtctor : " "(" " const dictionary& dict, const objectRegistry& orb" @@ -114,10 +112,9 @@ Foam::vector Foam::localAxesRotation::transform(const vector& st) const { notImplemented ( - "vector Foam::localAxesRotation:: " - "transform(const vector& st) const" + "vector Foam::localAxesRotation::transform(const vector&) const" ); - return vector(vector::zero); + return vector::zero; } @@ -125,10 +122,9 @@ Foam::vector Foam::localAxesRotation::invTransform(const vector& st) const { notImplemented ( - "vector Foam::localAxesRotation:: " - "transform(const vector& st) const" + "vector Foam::localAxesRotation::invTransform(const vector&) const" ); - return vector(vector::zero); + return vector::zero; } @@ -139,11 +135,9 @@ Foam::tmp<Foam::vectorField> Foam::localAxesRotation::transform { if (Rptr_->size() != st.size()) { - FatalErrorIn - ( - "localAxesRotation::transform(const vectorField& st) " - ) << "vectorField st has different size to tensorField " - << abort(FatalError); + FatalErrorIn("localAxesRotation::transform(const vectorField&)") + << "vectorField st has different size to tensorField " + << abort(FatalError); } return (Rptr_() & st); @@ -166,11 +160,9 @@ Foam::tmp<Foam::tensorField> Foam::localAxesRotation::transformTensor { if (Rptr_->size() != st.size()) { - FatalErrorIn - ( - "localAxesRotation::transformTensor(const tensorField& st) " - ) << "tensorField st has different size to tensorField Tr" - << abort(FatalError); + FatalErrorIn("localAxesRotation::transformTensor(const tensorField&)") + << "tensorField st has different size to tensorField Tr" + << abort(FatalError); } return (Rptr_() & st & Rptr_().T()); } @@ -181,11 +173,8 @@ Foam::tensor Foam::localAxesRotation::transformTensor const tensor& st ) const { - notImplemented - ( - "tensor localAxesRotation::transformTensor() const" - ); - return tensor(tensor::zero); + notImplemented("tensor localAxesRotation::transformTensor() const"); + return tensor::zero; } @@ -197,17 +186,15 @@ Foam::tmp<Foam::tensorField> Foam::localAxesRotation::transformTensor { if (cellMap.size() != st.size()) { - FatalErrorIn - ( - "localAxesRotation::transformTensor(const tensorField& st) " - ) << "tensorField st has different size to tensorField Tr" - << abort(FatalError); + FatalErrorIn("localAxesRotation::transformTensor(const tensorField&)") + << "tensorField st has different size to tensorField Tr" + << abort(FatalError); } - const tensorField Rtr = Rptr_().T(); + const tensorField Rtr(Rptr_().T()); tmp<tensorField> tt(new tensorField(cellMap.size())); tensorField& t = tt(); - forAll (cellMap, i) + forAll(cellMap, i) { const label cellI = cellMap[i]; t[i] = Rptr_()[cellI] & st[i] & Rtr[cellI]; @@ -223,11 +210,9 @@ Foam::tmp<Foam::symmTensorField> Foam::localAxesRotation::transformVector { if (Rptr_->size() != st.size()) { - FatalErrorIn - ( - "localAxesRotation::transformVector(const vectorField& st) " - ) << "tensorField st has different size to tensorField Tr" - << abort(FatalError); + FatalErrorIn("localAxesRotation::transformVector(const vectorField&)") + << "tensorField st has different size to tensorField Tr" + << abort(FatalError); } tmp<symmTensorField> tfld(new symmTensorField(Rptr_->size())); @@ -250,7 +235,7 @@ Foam::symmTensor Foam::localAxesRotation::transformVector ( "tensor localAxesRotation::transformVector(const vector&) const" ); - return symmTensor(symmTensor::zero); + return symmTensor::zero; } @@ -266,7 +251,7 @@ void Foam::localAxesRotation::init forAll(mesh.cellCentres(), cellI) { vector dir = mesh.cellCentres()[cellI] - origin_; - dir /= mag(dir); + dir /= mag(dir) + VSMALL; Rptr_()[cellI] = axesRotation(e3_, dir).R(); } diff --git a/src/meshTools/coordinateSystems/coordinateRotation/localAxesRotation.H b/src/meshTools/coordinateSystems/coordinateRotation/localAxesRotation.H index 7e669bb514ef78d6f73a7a9fad1b5ecc02d5e9d7..8d335a625d3cfc00fec6c978a87ceebeed0f5f91 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/localAxesRotation.H +++ b/src/meshTools/coordinateSystems/coordinateRotation/localAxesRotation.H @@ -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 diff --git a/src/meshTools/coordinateSystems/coordinateSystem.C b/src/meshTools/coordinateSystems/coordinateSystem.C index 8537ec45e01ee0b7454b5e7214920ae03e7f60b7..16e6983a40b752e9a35e94133e654a41e0b45b19 100644 --- a/src/meshTools/coordinateSystems/coordinateSystem.C +++ b/src/meshTools/coordinateSystems/coordinateSystem.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 diff --git a/src/meshTools/coordinateSystems/coordinateSystem.H b/src/meshTools/coordinateSystems/coordinateSystem.H index f0e695b5074510972d0978057ecb4df0d15f1412..47847c8b48708eec2b1c9c8dd232ace32557453e 100644 --- a/src/meshTools/coordinateSystems/coordinateSystem.H +++ b/src/meshTools/coordinateSystems/coordinateSystem.H @@ -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 diff --git a/src/meshTools/coordinateSystems/coordinateSystemNew.C b/src/meshTools/coordinateSystems/coordinateSystemNew.C index da5bc06958b9cac00ea5b53a68f6cd5018e45a18..5b2e15dd13ddf1a58d680e9aa020f6bc06677b9a 100644 --- a/src/meshTools/coordinateSystems/coordinateSystemNew.C +++ b/src/meshTools/coordinateSystems/coordinateSystemNew.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 diff --git a/src/meshTools/coordinateSystems/coordinateSystems.H b/src/meshTools/coordinateSystems/coordinateSystems.H index 8a0a489eb50a5d8d5241bb53aaeed3a5ad571541..c85cf48b45f6865dc81ac1da9c75a76a71a8f1b8 100644 --- a/src/meshTools/coordinateSystems/coordinateSystems.H +++ b/src/meshTools/coordinateSystems/coordinateSystems.H @@ -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 diff --git a/src/meshTools/coordinateSystems/cylindricalCS.C b/src/meshTools/coordinateSystems/cylindricalCS.C index 4be9deda7dd273fe92c0004fc359c072b698bb68..08a8a37aeb0c5cbaccc7aae4645fdcc926dbf692 100644 --- a/src/meshTools/coordinateSystems/cylindricalCS.C +++ b/src/meshTools/coordinateSystems/cylindricalCS.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 diff --git a/src/meshTools/coordinateSystems/cylindricalCS.H b/src/meshTools/coordinateSystems/cylindricalCS.H index e03d1feac8a63b073549b72ac688da4c97f46469..fd537c29cd59ccdec62e2f33ad3940059177239e 100644 --- a/src/meshTools/coordinateSystems/cylindricalCS.H +++ b/src/meshTools/coordinateSystems/cylindricalCS.H @@ -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 diff --git a/src/meshTools/meshStructure/meshStructure.C b/src/meshTools/meshStructure/meshStructure.C new file mode 100644 index 0000000000000000000000000000000000000000..d16495d6efd6bddffa3a5fb3c5e612408e243183 --- /dev/null +++ b/src/meshTools/meshStructure/meshStructure.C @@ -0,0 +1,387 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +#include "meshStructure.H" +#include "FaceCellWave.H" +#include "topoDistanceData.H" +#include "pointTopoDistanceData.H" +#include "PointEdgeWave.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +defineTypeNameAndDebug(meshStructure, 0); +} + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +bool Foam::meshStructure::isStructuredCell +( + const polyMesh& mesh, + const label layerI, + const label cellI +) const +{ + const cell& cFaces = mesh.cells()[cellI]; + + // Count number of side faces + label nSide = 0; + forAll(cFaces, i) + { + if (faceToPatchEdgeAddressing_[cFaces[i]] != -1) + { + nSide++; + } + } + + if (nSide != cFaces.size()-2) + { + return false; + } + + // Check that side faces have correct point layers + forAll(cFaces, i) + { + if (faceToPatchEdgeAddressing_[cFaces[i]] != -1) + { + const face& f = mesh.faces()[cFaces[i]]; + + label nLayer = 0; + label nLayerPlus1 = 0; + forAll(f, fp) + { + label pointI = f[fp]; + if (pointLayer_[pointI] == layerI) + { + nLayer++; + } + else if (pointLayer_[pointI] == layerI+1) + { + nLayerPlus1++; + } + } + + if (f.size() != 4 || (nLayer+nLayerPlus1 != 4)) + { + return false; + } + } + } + + return true; +} + + +void Foam::meshStructure::correct +( + const polyMesh& mesh, + const uindirectPrimitivePatch& pp +) +{ + // Field on cells and faces. + List<topoDistanceData> cellData(mesh.nCells()); + List<topoDistanceData> faceData(mesh.nFaces()); + + { + if (debug) + { + Info<< typeName << " : seeding " + << returnReduce(pp.size(), sumOp<label>()) << " patch faces" + << nl << endl; + } + + + // Start of changes + labelList patchFaces(pp.size()); + List<topoDistanceData> patchData(pp.size()); + forAll(pp, patchFaceI) + { + patchFaces[patchFaceI] = pp.addressing()[patchFaceI]; + patchData[patchFaceI] = topoDistanceData(patchFaceI, 0); + } + + + // Propagate information inwards + FaceCellWave<topoDistanceData> distanceCalc + ( + mesh, + patchFaces, + patchData, + faceData, + cellData, + mesh.globalData().nTotalCells()+1 + ); + + + // Determine cells from face-cell-walk + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + cellToPatchFaceAddressing_.setSize(mesh.nCells()); + cellLayer_.setSize(mesh.nCells()); + forAll(cellToPatchFaceAddressing_, cellI) + { + cellToPatchFaceAddressing_[cellI] = cellData[cellI].data(); + cellLayer_[cellI] = cellData[cellI].distance(); + } + + + + // Determine faces from face-cell-walk + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + faceToPatchFaceAddressing_.setSize(mesh.nFaces()); + faceToPatchEdgeAddressing_.setSize(mesh.nFaces()); + faceToPatchEdgeAddressing_ = labelMin; + faceLayer_.setSize(mesh.nFaces()); + + forAll(faceToPatchFaceAddressing_, faceI) + { + label own = mesh.faceOwner()[faceI]; + label patchFaceI = faceData[faceI].data(); + label patchDist = faceData[faceI].distance(); + + if (mesh.isInternalFace(faceI)) + { + label nei = mesh.faceNeighbour()[faceI]; + + if (cellData[own].distance() == cellData[nei].distance()) + { + // side face + faceToPatchFaceAddressing_[faceI] = 0; + faceLayer_[faceI] = cellData[own].distance(); + } + else if (cellData[own].distance() < cellData[nei].distance()) + { + // unturned face + faceToPatchFaceAddressing_[faceI] = patchFaceI+1; + faceToPatchEdgeAddressing_[faceI] = -1; + faceLayer_[faceI] = patchDist; + } + else + { + // turned face + faceToPatchFaceAddressing_[faceI] = -(patchFaceI+1); + faceToPatchEdgeAddressing_[faceI] = -1; + faceLayer_[faceI] = patchDist; + } + } + else if (patchDist == cellData[own].distance()) + { + // starting face + faceToPatchFaceAddressing_[faceI] = -(patchFaceI+1); + faceToPatchEdgeAddressing_[faceI] = -1; + faceLayer_[faceI] = patchDist; + } + else + { + // unturned face or side face. Cannot be determined until + // we determine the point layers. Problem is that both are + // the same number of steps away from the initial seed face. + } + } + } + + + // Determine points from separate walk on point-edge + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + { + pointToPatchPointAddressing_.setSize(mesh.nPoints()); + pointLayer_.setSize(mesh.nPoints()); + + if (debug) + { + Info<< typeName << " : seeding " + << returnReduce(pp.nPoints(), sumOp<label>()) << " patch points" + << nl << endl; + } + + // Field on edges and points. + List<pointTopoDistanceData> edgeData(mesh.nEdges()); + List<pointTopoDistanceData> pointData(mesh.nPoints()); + + // Start of changes + labelList patchPoints(pp.nPoints()); + List<pointTopoDistanceData> patchData(pp.nPoints()); + forAll(pp.meshPoints(), patchPointI) + { + patchPoints[patchPointI] = pp.meshPoints()[patchPointI]; + patchData[patchPointI] = pointTopoDistanceData(patchPointI, 0); + } + + + // Walk + PointEdgeWave<pointTopoDistanceData> distanceCalc + ( + mesh, + patchPoints, + patchData, + + pointData, + edgeData, + mesh.globalData().nTotalPoints() // max iterations + ); + + forAll(pointData, pointI) + { + pointToPatchPointAddressing_[pointI] = pointData[pointI].data(); + pointLayer_[pointI] = pointData[pointI].distance(); + } + + + // Derive from originating patch points what the patch edges were. + EdgeMap<label> pointsToEdge(pp.nEdges()); + forAll(pp.edges(), edgeI) + { + pointsToEdge.insert(pp.edges()[edgeI], edgeI); + } + + // Look up on faces + forAll(faceToPatchEdgeAddressing_, faceI) + { + if (faceToPatchEdgeAddressing_[faceI] == labelMin) + { + // Face not yet done. Check if all points on same level + // or if not see what edge it originates from + + const face& f = mesh.faces()[faceI]; + + label levelI = pointLayer_[f[0]]; + for (label fp = 1; fp < f.size(); fp++) + { + if (pointLayer_[f[fp]] != levelI) + { + levelI = -1; + break; + } + } + + if (levelI != -1) + { + // All same level + //Pout<< "Horizontal boundary face " << faceI + // << " at:" << mesh.faceCentres()[faceI] + // << " data:" << faceData[faceI] + // << " pointDatas:" + // << UIndirectList<pointTopoDistanceData>(pointData, f) + // << endl; + + label patchFaceI = faceData[faceI].data(); + label patchDist = faceData[faceI].distance(); + + faceToPatchEdgeAddressing_[faceI] = -1; + faceToPatchFaceAddressing_[faceI] = patchFaceI+1; + faceLayer_[faceI] = patchDist; + } + else + { + // Points of face on different levels + + // See if there is any edge + forAll(f, fp) + { + label pointI = f[fp]; + label nextPointI = f.nextLabel(fp); + + EdgeMap<label>::const_iterator fnd = pointsToEdge.find + ( + edge + ( + pointData[pointI].data(), + pointData[nextPointI].data() + ) + ); + if (fnd != pointsToEdge.end()) + { + faceToPatchEdgeAddressing_[faceI] = fnd(); + faceToPatchFaceAddressing_[faceI] = 0; + label own = mesh.faceOwner()[faceI]; + faceLayer_[faceI] = cellData[own].distance(); + + // Note: could test whether the other edges on the + // face are consistent + break; + } + } + } + } + } + } + + + + // Use maps to find out mesh structure. + { + label nLayers = gMax(cellLayer_)+1; + labelListList layerToCells(invertOneToMany(nLayers, cellLayer_)); + + structured_ = true; + forAll(layerToCells, layerI) + { + const labelList& lCells = layerToCells[layerI]; + + forAll(lCells, lCellI) + { + label cellI = lCells[lCellI]; + + structured_ = isStructuredCell + ( + mesh, + layerI, + cellI + ); + + if (!structured_) + { + break; + } + } + + if (!structured_) + { + break; + } + } + + reduce(structured_, andOp<bool>()); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::meshStructure::meshStructure +( + const polyMesh& mesh, + const uindirectPrimitivePatch& pp +) +{ + correct(mesh, pp); +} + + +// ************************************************************************* // diff --git a/src/meshTools/meshStructure/meshStructure.H b/src/meshTools/meshStructure/meshStructure.H new file mode 100644 index 0000000000000000000000000000000000000000..24bbbc875eda17838a7c82cbd9e88655a79b8220 --- /dev/null +++ b/src/meshTools/meshStructure/meshStructure.H @@ -0,0 +1,175 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +Class + Foam::meshStructure + +Description + Detect extruded mesh structure given a set of patch faces. + +SourceFiles + meshStructure.C + +\*---------------------------------------------------------------------------*/ + +#ifndef meshStructure_H +#define meshStructure_H + +#include "labelList.H" +#include "uindirectPrimitivePatch.H" +#include "className.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class polyMesh; + + +/*---------------------------------------------------------------------------*\ + Class meshStructure Declaration +\*---------------------------------------------------------------------------*/ + +class meshStructure +{ + // Private data + + //- Cell to patch face + labelList cellToPatchFaceAddressing_; + + //- Cell to layer + labelList cellLayer_; + + //- Face to patch face + labelList faceToPatchFaceAddressing_; + + //- Face to patch edge + labelList faceToPatchEdgeAddressing_; + + //- Face to layer + labelList faceLayer_; + + //- Point to patch point + labelList pointToPatchPointAddressing_; + + //- Point to layer + labelList pointLayer_; + + //- Is mesh structured? + bool structured_; + + + // Private Member Functions + + //- Is cell structured + bool isStructuredCell + ( + const polyMesh& mesh, + const label layerI, + const label cellI + ) const; + + //- Calculate all maps. + void correct + ( + const polyMesh& mesh, + const uindirectPrimitivePatch& pp + ); + + +public: + + // Declare name of the class and its debug switch + ClassName("meshStructure"); + + // Constructors + + //- Construct null + meshStructure(const polyMesh& mesh, const uindirectPrimitivePatch&); + + + // Member Functions + + //- Is mesh structured? + inline bool structured() const; + + //- Cell to patch face + inline const labelList& cellToPatchFaceAddressing() const; + + //- Cell to patch face + inline labelList& cellToPatchFaceAddressing(); + + //- Cell to layer + inline const labelList& cellLayer() const; + + //- Cell to layer + inline labelList& cellLayer(); + + //- Face to patch face + inline const labelList& faceToPatchFaceAddressing() const; + + //- Face to patch face + inline labelList& faceToPatchFaceAddressing(); + + //- Face to patch edge + inline const labelList& faceToPatchEdgeAddressing() const; + + //- Face to patch edge + inline labelList& faceToPatchEdgeAddressing(); + + //- Face to layer + inline const labelList& faceLayer() const; + + //- Face to layer + inline labelList& faceLayer(); + + //- Point to patch point + inline const labelList& pointToPatchPointAddressing() const; + + //- Point to patch point + inline labelList& pointToPatchPointAddressing(); + + //- Point to layer + inline const labelList& pointLayer() const; + + //- Point to layer + inline labelList& pointLayer(); + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "meshStructureI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/meshTools/meshStructure/meshStructureI.H b/src/meshTools/meshStructure/meshStructureI.H new file mode 100644 index 0000000000000000000000000000000000000000..9367f41eb578a90307ece9e0f0ac68bc928781ce --- /dev/null +++ b/src/meshTools/meshStructure/meshStructureI.H @@ -0,0 +1,120 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +#include "meshStructure.H" + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +bool Foam::meshStructure::structured() const +{ + return structured_; +} + + +const Foam::labelList& Foam::meshStructure::cellToPatchFaceAddressing() const +{ + return cellToPatchFaceAddressing_; +} + + +Foam::labelList& Foam::meshStructure::cellToPatchFaceAddressing() +{ + return cellToPatchFaceAddressing_; +} + + +const Foam::labelList& Foam::meshStructure::cellLayer() const +{ + return cellLayer_; +} + + +Foam::labelList& Foam::meshStructure::cellLayer() +{ + return cellLayer_; +} + + +const Foam::labelList& Foam::meshStructure::faceToPatchFaceAddressing() const +{ + return faceToPatchFaceAddressing_; +} + + +Foam::labelList& Foam::meshStructure::faceToPatchFaceAddressing() +{ + return faceToPatchFaceAddressing_; +} + + +const Foam::labelList& Foam::meshStructure::faceToPatchEdgeAddressing() const +{ + return faceToPatchEdgeAddressing_; +} + + +Foam::labelList& Foam::meshStructure::faceToPatchEdgeAddressing() +{ + return faceToPatchEdgeAddressing_; +} + + +const Foam::labelList& Foam::meshStructure::faceLayer() const +{ + return faceLayer_; +} + + +Foam::labelList& Foam::meshStructure::faceLayer() +{ + return faceLayer_; +} + + +const Foam::labelList& Foam::meshStructure::pointToPatchPointAddressing() const +{ + return pointToPatchPointAddressing_; +} + + +Foam::labelList& Foam::meshStructure::pointToPatchPointAddressing() +{ + return pointToPatchPointAddressing_; +} + + +const Foam::labelList& Foam::meshStructure::pointLayer() const +{ + return pointLayer_; +} + + +Foam::labelList& Foam::meshStructure::pointLayer() +{ + return pointLayer_; +} + + +// ************************************************************************* // diff --git a/src/meshTools/meshStructure/pointTopoDistanceData.C b/src/meshTools/meshStructure/pointTopoDistanceData.C new file mode 100644 index 0000000000000000000000000000000000000000..95a1e00518ef1ebe75082a01c9ba61ac65aa71c6 --- /dev/null +++ b/src/meshTools/meshStructure/pointTopoDistanceData.C @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +#include "pointTopoDistanceData.H" + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<< +( + Foam::Ostream& os, + const Foam::pointTopoDistanceData& wDist +) +{ + return os << wDist.data_ << token::SPACE << wDist.distance_; +} + + +Foam::Istream& Foam::operator>> +( + Foam::Istream& is, + Foam::pointTopoDistanceData& wDist +) +{ + return is >> wDist.data_ >> wDist.distance_; +} + + +// ************************************************************************* // diff --git a/src/meshTools/meshStructure/pointTopoDistanceData.H b/src/meshTools/meshStructure/pointTopoDistanceData.H new file mode 100644 index 0000000000000000000000000000000000000000..d8c7cf8830bc42a0b8cdcab8f352039d5b9d1647 --- /dev/null +++ b/src/meshTools/meshStructure/pointTopoDistanceData.H @@ -0,0 +1,227 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +Class + Foam::pointTopoDistanceData + +Description + For use with PointEdgeWave. Determines topological distance to + starting points + +SourceFiles + pointTopoDistanceDataI.H + pointTopoDistanceData.C + +\*---------------------------------------------------------------------------*/ + +#ifndef pointTopoDistanceData_H +#define pointTopoDistanceData_H + +#include "point.H" +#include "tensor.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class polyPatch; +class polyMesh; + +/*---------------------------------------------------------------------------*\ + Class pointTopoDistanceData Declaration +\*---------------------------------------------------------------------------*/ + +class pointTopoDistanceData +{ + // Private data + + //- Starting data + label data_; + + //- Distance + label distance_; + + +public: + + // Constructors + + //- Construct null + inline pointTopoDistanceData(); + + //- Construct from count + inline pointTopoDistanceData + ( + const label data, + const label distance + ); + + + // Member Functions + + // Access + + + inline label data() const + { + return data_; + } + inline label distance() const + { + return distance_; + } + + + // Needed by PointEdgeWave + + + //- Check whether origin has been changed at all or + // still contains original (invalid) value. + template<class TrackingData> + inline bool valid(TrackingData& td) const; + + //- Check for identical geometrical data. Used for cyclics checking. + template<class TrackingData> + inline bool sameGeometry + ( + const pointTopoDistanceData&, + const scalar tol, + TrackingData& td + ) const; + + //- Convert origin to relative vector to leaving point + // (= point coordinate) + template<class TrackingData> + inline void leaveDomain + ( + const polyPatch& patch, + const label patchPointI, + const point& pos, + TrackingData& td + ); + + //- Convert relative origin to absolute by adding entering point + template<class TrackingData> + inline void enterDomain + ( + const polyPatch& patch, + const label patchPointI, + const point& pos, + TrackingData& td + ); + + //- Apply rotation matrix to origin + template<class TrackingData> + inline void transform + ( + const tensor& rotTensor, + TrackingData& td + ); + + //- Influence of edge on point + template<class TrackingData> + inline bool updatePoint + ( + const polyMesh& mesh, + const label pointI, + const label edgeI, + const pointTopoDistanceData& edgeInfo, + const scalar tol, + TrackingData& td + ); + + //- Influence of different value on same point. + // Merge new and old info. + template<class TrackingData> + inline bool updatePoint + ( + const polyMesh& mesh, + const label pointI, + const pointTopoDistanceData& newPointInfo, + const scalar tol, + TrackingData& td + ); + + //- Influence of different value on same point. + // No information about current position whatsoever. + template<class TrackingData> + inline bool updatePoint + ( + const pointTopoDistanceData& newPointInfo, + const scalar tol, + TrackingData& td + ); + + //- Influence of point on edge. + template<class TrackingData> + inline bool updateEdge + ( + const polyMesh& mesh, + const label edgeI, + const label pointI, + const pointTopoDistanceData& pointInfo, + const scalar tol, + TrackingData& td + ); + + //- Same (like operator==) + template<class TrackingData> + inline bool equal(const pointTopoDistanceData&, TrackingData&) + const; + + + // Member Operators + + // Needed for List IO + inline bool operator==(const pointTopoDistanceData&) const; + inline bool operator!=(const pointTopoDistanceData&) const; + + // IOstream Operators + + friend Ostream& operator<<(Ostream&, const pointTopoDistanceData&); + friend Istream& operator>>(Istream&, pointTopoDistanceData&); +}; + + +//- Data associated with pointTopoDistanceData type are contiguous +template<> +inline bool contiguous<pointTopoDistanceData>() +{ + return true; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "pointTopoDistanceDataI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/meshTools/meshStructure/pointTopoDistanceDataI.H b/src/meshTools/meshStructure/pointTopoDistanceDataI.H new file mode 100644 index 0000000000000000000000000000000000000000..c42dbffce2e7f01795d215fe81b5b05d7aa3c8c8 --- /dev/null +++ b/src/meshTools/meshStructure/pointTopoDistanceDataI.H @@ -0,0 +1,233 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +#include "polyMesh.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +// Null constructor +inline Foam::pointTopoDistanceData::pointTopoDistanceData() +: + data_(-1), + distance_(-1) +{} + + +// Construct from components +inline Foam::pointTopoDistanceData::pointTopoDistanceData +( + const label data, + const label distance +) +: + data_(data), + distance_(distance) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template <class TrackingData> +inline bool Foam::pointTopoDistanceData::valid(TrackingData& td) const +{ + return distance_ != -1; +} + + +// No geometric data so never any problem on cyclics +template <class TrackingData> +inline bool Foam::pointTopoDistanceData::sameGeometry +( + const pointTopoDistanceData&, + const scalar tol, + TrackingData& td +) const +{ + return true; +} + + +// No geometric data. +template <class TrackingData> +inline void Foam::pointTopoDistanceData::leaveDomain +( + const polyPatch& patch, + const label patchPointI, + const point& coord, + TrackingData& td +) +{} + + +// No geometric data. +template <class TrackingData> +inline void Foam::pointTopoDistanceData::transform +( + const tensor& rotTensor, + TrackingData& td +) +{} + + +// No geometric data. +template <class TrackingData> +inline void Foam::pointTopoDistanceData::enterDomain +( + const polyPatch& patch, + const label patchPointI, + const point& coord, + TrackingData& td +) +{} + + +// Update this with information from connected edge +template <class TrackingData> +inline bool Foam::pointTopoDistanceData::updatePoint +( + const polyMesh& mesh, + const label pointI, + const label edgeI, + const pointTopoDistanceData& edgeInfo, + const scalar tol, + TrackingData& td +) +{ + if (distance_ == -1) + { + data_ = edgeInfo.data_; + distance_ = edgeInfo.distance_ + 1; + return true; + } + else + { + return false; + } +} + + +// Update this with new information on same point +template<class TrackingData> +inline bool Foam::pointTopoDistanceData::updatePoint +( + const polyMesh& mesh, + const label pointI, + const pointTopoDistanceData& newPointInfo, + const scalar tol, + TrackingData& td +) +{ + if (distance_ == -1) + { + operator=(newPointInfo); + return true; + } + else + { + return false; + } +} + + +// Update this with new information on same point. No extra information. +template<class TrackingData> +inline bool Foam::pointTopoDistanceData::updatePoint +( + const pointTopoDistanceData& newPointInfo, + const scalar tol, + TrackingData& td +) +{ + if (distance_ == -1) + { + operator=(newPointInfo); + return true; + } + else + { + return false; + } +} + + +// Update this with information from connected point +template<class TrackingData> +inline bool Foam::pointTopoDistanceData::updateEdge +( + const polyMesh& mesh, + const label edgeI, + const label pointI, + const pointTopoDistanceData& pointInfo, + const scalar tol, + TrackingData& td +) +{ + if (distance_ == -1) + { + operator=(pointInfo); + return true; + } + else + { + return false; + } +} + + +template <class TrackingData> +inline bool Foam::pointTopoDistanceData::equal +( + const pointTopoDistanceData& rhs, + TrackingData& td +) const +{ + return operator==(rhs); +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +inline bool Foam::pointTopoDistanceData::operator== +( + const Foam::pointTopoDistanceData& rhs +) const +{ + return data() == rhs.data() && distance() == rhs.distance(); +} + + +inline bool Foam::pointTopoDistanceData::operator!= +( + const Foam::pointTopoDistanceData& rhs +) const +{ + return !(*this == rhs); +} + + +// ************************************************************************* // diff --git a/src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceData.C b/src/meshTools/meshStructure/topoDistanceData.C similarity index 95% rename from src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceData.C rename to src/meshTools/meshStructure/topoDistanceData.C index a7683eeb243229e49d28b7e62a37845331564522..e5938cccfc24ab62994f7ea474a38cd530430f5c 100644 --- a/src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceData.C +++ b/src/meshTools/meshStructure/topoDistanceData.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 diff --git a/src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceData.H b/src/meshTools/meshStructure/topoDistanceData.H similarity index 98% rename from src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceData.H rename to src/meshTools/meshStructure/topoDistanceData.H index dc18cb46006207f703f11d054235e44ee569d9a2..be6f73ee753f80bb55ed876ea44129dd5a41acbe 100644 --- a/src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceData.H +++ b/src/meshTools/meshStructure/topoDistanceData.H @@ -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 diff --git a/src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceDataI.H b/src/meshTools/meshStructure/topoDistanceDataI.H similarity index 100% rename from src/parallel/decompose/decompositionMethods/structuredDecomp/topoDistanceDataI.H rename to src/meshTools/meshStructure/topoDistanceDataI.H diff --git a/src/meshTools/searchableSurface/searchableSurfaceCollection.C b/src/meshTools/searchableSurface/searchableSurfaceCollection.C index ba703155a0492ead13a570085c310ef03408eba9..3a02066afae137a1d251eaf982bd5db3cf3a82da 100644 --- a/src/meshTools/searchableSurface/searchableSurfaceCollection.C +++ b/src/meshTools/searchableSurface/searchableSurfaceCollection.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/parallel/decompose/decompositionMethods/Make/files b/src/parallel/decompose/decompositionMethods/Make/files index 5e54b366af42ba69866e138d23b27b460b156701..c2837d2eb320880626cf8fa1cca120dfa718e39a 100644 --- a/src/parallel/decompose/decompositionMethods/Make/files +++ b/src/parallel/decompose/decompositionMethods/Make/files @@ -4,7 +4,6 @@ simpleGeomDecomp/simpleGeomDecomp.C hierarchGeomDecomp/hierarchGeomDecomp.C manualDecomp/manualDecomp.C multiLevelDecomp/multiLevelDecomp.C -structuredDecomp/topoDistanceData.C structuredDecomp/structuredDecomp.C noDecomp/noDecomp.C diff --git a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C index a4587f26b140b4b8f201bd6e1ff8e957fa1c6c01..ac0fc6da0afc17a6b53ab5b31e167d0455328ecd 100644 --- a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C +++ b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C index 00d21a95f60f93f9737abc2b43720f6def11eec6..cf2c4be69f8d77b9561e0af90c5332d39a0fef2c 100644 --- a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.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 diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C index 14a6fa310e7d7cad49c36119fc7d1a1b8eeec0f4..dd54de718ac14619f3ee231427bc5a22a3828148 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,10 +48,11 @@ namespace Foam template<> - const char* NamedEnum<fieldValues::faceSource::operationType, 11>::names[] = + const char* NamedEnum<fieldValues::faceSource::operationType, 12>::names[] = { "none", "sum", + "sumDirection", "average", "weightedAverage", "areaAverage", @@ -74,7 +75,7 @@ namespace Foam const Foam::NamedEnum<Foam::fieldValues::faceSource::sourceType, 3> Foam::fieldValues::faceSource::sourceTypeNames_; -const Foam::NamedEnum<Foam::fieldValues::faceSource::operationType, 11> +const Foam::NamedEnum<Foam::fieldValues::faceSource::operationType, 12> Foam::fieldValues::faceSource::operationTypeNames_; @@ -486,6 +487,46 @@ void Foam::fieldValues::faceSource::writeFileHeader(const label i) } +template<> +Foam::scalar Foam::fieldValues::faceSource::processValues +( + const Field<scalar>& values, + const vectorField& Sf, + const scalarField& weightField +) const +{ + switch (operation_) + { + case opSumDirection: + { + const vector direction(dict_.lookup("direction")); + + scalar v = 0.0; + + forAll(Sf, i) + { + scalar d = Sf[i] & direction; + if (d > 0) + { + v += pos(values[i])*values[i]; + } + else + { + v += neg(values[i])*values[i]; + } + } + + return v; + } + default: + { + // Fall through to other operations + return processSameTypeValues(values, Sf, weightField); + } + } +} + + template<> Foam::vector Foam::fieldValues::faceSource::processValues ( @@ -496,14 +537,19 @@ Foam::vector Foam::fieldValues::faceSource::processValues { switch (operation_) { + case opSumDirection: + { + const vector direction(dict_.lookup("direction")); + return sum(pos(values & direction)*values); + } case opAreaNormalAverage: { - scalar result = sum(values&Sf)/sum(mag(Sf)); + scalar result = sum(values & Sf)/sum(mag(Sf)); return vector(result, 0.0, 0.0); } case opAreaNormalIntegrate: { - scalar result = sum(values&Sf); + scalar result = sum(values & Sf); return vector(result, 0.0, 0.0); } default: diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H index 42bc27a311e5a10764a72c73da2555e801894c66..9af8c7c3424ec0c30d12102df70bab35b83a176a 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,6 +87,7 @@ Description \plaintable none | no operation sum | sum + sumDirection | sum values which are positive in given direction average | ensemble average weightedAverage | weighted average areaAverage | area weighted average @@ -176,6 +177,7 @@ public: { opNone, opSum, + opSumDirection, opAverage, opWeightedAverage, opAreaAverage, @@ -188,7 +190,7 @@ public: }; //- Operation type names - static const NamedEnum<operationType, 11> operationTypeNames_; + static const NamedEnum<operationType, 12> operationTypeNames_; private: @@ -366,8 +368,17 @@ public: }; -//- Specialisation of processing vectors for opAreaNormalAverage, -// opAreaNormalIntegrate (use inproduct - dimension reducing operation) +//- Specialisation of processing scalars +template<> +scalar faceSource::processValues +( + const Field<scalar>& values, + const vectorField& Sf, + const scalarField& weightField +) const; + + +//- Specialisation of processing vectors template<> vector faceSource::processValues ( diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C index a82f4890361b3de7284e28a9606fdddaf14fc844..8177946ffc332295680f1dddd52764d79e756ae5 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -141,6 +141,26 @@ Type Foam::fieldValues::faceSource::processSameTypeValues result = sum(values); break; } + case opSumDirection: + { + FatalErrorIn + ( + "template<class Type>" + "Type Foam::fieldValues::faceSource::processSameTypeValues" + "(" + "const Field<Type>&, " + "const vectorField&, " + "const scalarField&" + ") const" + ) + << "Operation " << operationTypeNames_[operation_] + << " not available for values of type " + << pTraits<Type>::typeName + << exit(FatalError); + + result = pTraits<Type>::zero; + break; + } case opAverage: { result = sum(values)/values.size(); diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.C b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.C index 5cb2faa3b69d207a9f0dcc23541af9314372b8b2..50d47d8198f2303682fff96fa3e922c1c71da804 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.C +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,6 +43,8 @@ void Foam::fieldValue::read(const dictionary& dict) { if (active_) { + dict_ = dict; + log_ = dict.lookupOrDefault<Switch>("log", false); dict.lookup("fields") >> fields_; dict.lookup("valueOutput") >> valueOutput_; @@ -78,6 +80,7 @@ Foam::fieldValue::fieldValue functionObjectFile(obr, name, valueType), name_(name), obr_(obr), + dict_(dict), active_(true), log_(false), sourceName_(dict.lookupOrDefault<word>("sourceName", "sampledSurface")), diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H index 1b2f2621e7b240737f6e5953356bd5d252a07019..b7994383d51c83321dcfe7a9dafc78af610af5ba 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,6 +75,9 @@ protected: //- Database this class is registered to const objectRegistry& obr_; + //- Construction dictionary + dictionary dict_; + //- Active flag bool active_; @@ -149,6 +152,9 @@ public: //- Return the reference to the object registry inline const objectRegistry& obr() const; + //- Return the reference to the construction dictionary + inline const dictionary& dict() const; + //- Return the active flag inline bool active() const; diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValueI.H b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValueI.H index aaee816af205747697031b269fc8e62c63044d52..55651a3539ed50705d18fe6a75cf10f4425e9d59 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValueI.H +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValueI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,6 +40,12 @@ inline const Foam::objectRegistry& Foam::fieldValue::obr() const } +inline const Foam::dictionary& Foam::fieldValue::dict() const +{ + return dict_; +} + + inline bool Foam::fieldValue::active() const { return active_; diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C index 20614f474f0f082f9d6cdcc629249159a159f5a1..cf9fb292364ca523ece7e94f592bdd07271d7409 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,15 +38,16 @@ namespace Foam template<> const char* - NamedEnum<fieldValues::fieldValueDelta::operationType, 4>::names[] = + NamedEnum<fieldValues::fieldValueDelta::operationType, 5>::names[] = { "add", "subtract", "min", - "max" + "max", + "average" }; - const NamedEnum<fieldValues::fieldValueDelta::operationType, 4> + const NamedEnum<fieldValues::fieldValueDelta::operationType, 5> fieldValues::fieldValueDelta::operationTypeNames_; } @@ -158,7 +159,7 @@ void Foam::fieldValues::fieldValueDelta::write() if (log_) { - Info<< type() << " output:" << endl; + Info<< type() << " " << name_ << " output:" << endl; } bool found = false; @@ -179,10 +180,8 @@ void Foam::fieldValues::fieldValueDelta::write() { Info<< " none" << endl; } - else - { - Info<< endl; - } + + Info<< endl; } } diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H index e28771109a2f55004a05ef4af071c72d3a061cda..24d72f1f6bf2a4db31f9d56b6e0aa6e760624942 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,6 +37,8 @@ Description { type fieldValueDelta; functionObjectLibs ("libfieldFunctionObjects.so"); + operation subtract; + fieldValue1 { ... @@ -54,6 +56,15 @@ Description type | type name: fieldValueDelta | yes | \endtable + \linebreak + The \c operation is one of: + \plaintable + add | add + subtract | subtract + min | minimum + max | maximum + average | average + \endplaintable SeeAlso Foam::fieldValue @@ -92,11 +103,12 @@ public: opAdd, opSubtract, opMin, - opMax + opMax, + opAverage }; //- Operation type names - static const NamedEnum<operationType, 4> operationTypeNames_; + static const NamedEnum<operationType, 5> operationTypeNames_; private: diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDeltaTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDeltaTemplates.C index 6b757fc2df391d3e393690c1de2708432be15c86..b107c7952701dde83b5ae770b6e2eea8e4d8826c 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDeltaTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDeltaTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ License #include "GeometricField.H" #include "volMesh.H" +#include "surfaceMesh.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // @@ -59,6 +60,11 @@ Type Foam::fieldValues::fieldValueDelta::applyOperation result = max(value1, value2); break; } + case opAverage: + { + result = 0.5*(value1 + value2); + break; + } default: { FatalErrorIn @@ -83,6 +89,7 @@ template<class Type> void Foam::fieldValues::fieldValueDelta::processFields(bool& found) { typedef GeometricField<Type, fvPatchField, volMesh> vf; + typedef GeometricField<Type, fvsPatchField, surfaceMesh> sf; const wordList& fields1 = source1Ptr_->fields(); @@ -95,7 +102,12 @@ void Foam::fieldValues::fieldValueDelta::processFields(bool& found) forAll(fields1, i) { const word& fieldName = fields1[i]; - if (obr_.foundObject<vf>(fieldName) && results2.found(fieldName)) + + if + ( + (obr_.foundObject<vf>(fieldName) || obr_.foundObject<sf>(fieldName)) + && results2.found(fieldName) + ) { results1.lookup(fieldName) >> r1; results2.lookup(fieldName) >> r2; diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index a381a41115c94b2a71c12d00fb3663245236a2ef..5b944cc2343158d0a7f02f2b87adc278f26997b4 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/randomProcesses/noise/noiseFFT.C b/src/randomProcesses/noise/noiseFFT.C index 9a7ca7cd95cbd6d4f093635861f7302e6ef1a434..a262125121f30d69e30e3e6ce74e46257ede61d7 100644 --- a/src/randomProcesses/noise/noiseFFT.C +++ b/src/randomProcesses/noise/noiseFFT.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,16 +53,14 @@ Foam::noiseFFT::noiseFFT(const fileName& pFileName, const label skip) scalarField(), deltat_(0.0) { - // Construct control dictionary + // Construct pressure data file IFstream pFile(pFileName); // Check pFile stream is OK if (!pFile.good()) { - FatalErrorIn - ( - "noiseFFT::noiseFFT(const fileName&, const label)" - ) << "Cannot read file " << pFileName + FatalErrorIn("noiseFFT::noiseFFT(const scalar, const scalarField&)") + << "Cannot read file " << pFileName << exit(FatalError); } @@ -76,7 +74,10 @@ Foam::noiseFFT::noiseFFT(const fileName& pFileName, const label skip) if (!pFile.good() || pFile.eof()) { - FatalErrorIn("noiseFFT::noiseFFT(const fileName&, const label)") + FatalErrorIn + ( + "noiseFFT::noiseFFT(const scalar, const scalarField&)" + ) << "Number of points in file " << pFileName << " is less than the number to be skipped = " << skip << exit(FatalError); diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltHeight/inclinedFilmNusseltHeightFvPatchScalarField.C b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltHeight/inclinedFilmNusseltHeightFvPatchScalarField.C index bc6af600b564a9fafd96ce04743b0dd539fb5591..65c389e0372c44756257d6a604736a35cd289be9 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltHeight/inclinedFilmNusseltHeightFvPatchScalarField.C +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltHeight/inclinedFilmNusseltHeightFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -137,7 +137,7 @@ void Foam::inclinedFilmNusseltHeightFvPatchScalarField::updateCoeffs() // TODO: currently re-evaluating the entire gTan field to return this patch const scalarField gTan(film.gTan()().boundaryField()[patchI] & n); - if (max(mag(gTan)) < SMALL) + if (patch().size() && (max(mag(gTan)) < SMALL)) { WarningIn ( diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltInletVelocity/inclinedFilmNusseltInletVelocityFvPatchVectorField.C b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltInletVelocity/inclinedFilmNusseltInletVelocityFvPatchVectorField.C index 72a7e9fdc37e28115b11bad6c19da93e86f75316..67374b7b47bc7eb42c1f504f7bc983337c16778a 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltInletVelocity/inclinedFilmNusseltInletVelocityFvPatchVectorField.C +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltInletVelocity/inclinedFilmNusseltInletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -136,7 +136,7 @@ void Foam::inclinedFilmNusseltInletVelocityFvPatchVectorField::updateCoeffs() // TODO: currently re-evaluating the entire gTan field to return this patch const scalarField gTan(film.gTan()().boundaryField()[patchI] & n); - if (max(mag(gTan)) < SMALL) + if (patch().size() && (max(mag(gTan)) < SMALL)) { WarningIn ( diff --git a/src/sampling/sampledSet/array/arraySet.C b/src/sampling/sampledSet/array/arraySet.C index 580b718963d47847eeec35e07482295bdcb01e1c..49e3b76e8c98e692f705006c28182331ce265834 100644 --- a/src/sampling/sampledSet/array/arraySet.C +++ b/src/sampling/sampledSet/array/arraySet.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 diff --git a/src/sampling/sampledSurface/sampledPlane/sampledPlane.C b/src/sampling/sampledSurface/sampledPlane/sampledPlane.C index 3f035ee84520d9b3c74759a13d2d1366f99c726d..3873962ccadfbc4ad43d7484ace483454cdc1382 100644 --- a/src/sampling/sampledSurface/sampledPlane/sampledPlane.C +++ b/src/sampling/sampledSurface/sampledPlane/sampledPlane.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 diff --git a/src/sampling/sampledSurface/writers/nastran/nastranSurfaceWriter.C b/src/sampling/sampledSurface/writers/nastran/nastranSurfaceWriter.C index 436457c4694bb2c717822f2ef418c9c9188d8799..eaa16feb6b6f9fc520413d762049523e4af222af 100644 --- a/src/sampling/sampledSurface/writers/nastran/nastranSurfaceWriter.C +++ b/src/sampling/sampledSurface/writers/nastran/nastranSurfaceWriter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -336,15 +336,17 @@ Foam::nastranSurfaceWriter::nastranSurfaceWriter() : surfaceWriter(), writeFormat_(wfShort), - fieldMap_() + fieldMap_(), + scale_(1.0) {} Foam::nastranSurfaceWriter::nastranSurfaceWriter(const dictionary& options) : surfaceWriter(), - writeFormat_(wfShort), - fieldMap_() + writeFormat_(wfLong), + fieldMap_(), + scale_(options.lookupOrDefault("scale", 1.0)) { if (options.found("format")) { diff --git a/src/sampling/sampledSurface/writers/nastran/nastranSurfaceWriter.H b/src/sampling/sampledSurface/writers/nastran/nastranSurfaceWriter.H index 4e968ee55f4c53c3c06377590e8a3df73f5c1c3f..35374a7d94b50ac74c502c0fd3f24f5bd2fbd852 100644 --- a/src/sampling/sampledSurface/writers/nastran/nastranSurfaceWriter.H +++ b/src/sampling/sampledSurface/writers/nastran/nastranSurfaceWriter.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,6 +75,9 @@ private: //- Map of OpenFOAM field name vs nastran field name HashTable<word> fieldMap_; + //- Scale to apply to values (default = 1.0) + scalar scale_; + // Private Member Functions diff --git a/src/sampling/sampledSurface/writers/nastran/nastranSurfaceWriterTemplates.C b/src/sampling/sampledSurface/writers/nastran/nastranSurfaceWriterTemplates.C index e43dc5757fe2762dce15951679509b37e456ab48..fc0a283d754e9a2b48899669d9f418f26a31f772 100644 --- a/src/sampling/sampledSurface/writers/nastran/nastranSurfaceWriterTemplates.C +++ b/src/sampling/sampledSurface/writers/nastran/nastranSurfaceWriterTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,6 +46,8 @@ void Foam::nastranSurfaceWriter::writeFaceValue label SID = 1; + Type scaledValue = scale_*value; + switch (writeFormat_) { case wfShort: @@ -59,7 +61,7 @@ void Foam::nastranSurfaceWriter::writeFaceValue for (direction dirI = 0; dirI < pTraits<Type>::nComponents; dirI++) { - os << setw(8) << component(value, dirI); + os << setw(8) << component(scaledValue, dirI); } os.unsetf(ios_base::right); @@ -77,7 +79,7 @@ void Foam::nastranSurfaceWriter::writeFaceValue for (direction dirI = 0; dirI < pTraits<Type>::nComponents; dirI++) { - os << setw(16) << component(value, dirI); + os << setw(16) << component(scaledValue, dirI); } os.unsetf(ios_base::right); @@ -98,7 +100,7 @@ void Foam::nastranSurfaceWriter::writeFaceValue for (direction dirI = 0; dirI < pTraits<Type>::nComponents; dirI++) { - os << ',' << component(value, dirI); + os << ',' << component(scaledValue, dirI); } break; diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C index b4a973a70828fe0355fe41e671a4e5635b3529b2..62e40e215b07b72e1dc4af5168a1d14d7265fc9f 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,39 +39,76 @@ Description namespace Foam { + // Chemistry moldels based on sensibleEnthalpy makeChemistryModel ( chemistryModel, psiChemistryModel, - constGasThermoPhysics + constGasHThermoPhysics ); makeChemistryModel ( chemistryModel, psiChemistryModel, - gasThermoPhysics + gasHThermoPhysics ); makeChemistryModel ( chemistryModel, psiChemistryModel, - constIncompressibleGasThermoPhysics + constIncompressibleGasHThermoPhysics ); makeChemistryModel ( chemistryModel, psiChemistryModel, - incompressibleGasThermoPhysics + incompressibleGasHThermoPhysics ); makeChemistryModel ( chemistryModel, psiChemistryModel, - icoPoly8ThermoPhysics + icoPoly8HThermoPhysics + ); + + // Chemistry moldels based on sensibleInternalEnergy + makeChemistryModel + ( + chemistryModel, + psiChemistryModel, + constGasEThermoPhysics + ); + + makeChemistryModel + ( + chemistryModel, + psiChemistryModel, + gasEThermoPhysics + ); + + makeChemistryModel + ( + chemistryModel, + psiChemistryModel, + constIncompressibleGasEThermoPhysics + ); + + makeChemistryModel + ( + chemistryModel, + psiChemistryModel, + incompressibleGasEThermoPhysics + ); + + makeChemistryModel + ( + chemistryModel, + psiChemistryModel, + icoPoly8EThermoPhysics ); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C index e5be84743cb2412f03d8f75eab542653fd0a6a90..5ecc84043af7b24e086ddf419da1bd418fc1b85c 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,39 +39,77 @@ Description namespace Foam { + // Chemistry moldels based on sensibleEnthalpy makeChemistryModel ( chemistryModel, rhoChemistryModel, - constGasThermoPhysics + constGasHThermoPhysics ); makeChemistryModel ( chemistryModel, rhoChemistryModel, - gasThermoPhysics + gasHThermoPhysics ); makeChemistryModel ( chemistryModel, rhoChemistryModel, - constIncompressibleGasThermoPhysics + constIncompressibleGasHThermoPhysics ); makeChemistryModel ( chemistryModel, rhoChemistryModel, - incompressibleGasThermoPhysics + incompressibleGasHThermoPhysics ); makeChemistryModel ( chemistryModel, rhoChemistryModel, - icoPoly8ThermoPhysics + icoPoly8HThermoPhysics + ); + + + // Chemistry moldels based on sensibleInternalEnergy + makeChemistryModel + ( + chemistryModel, + rhoChemistryModel, + constGasEThermoPhysics + ); + + makeChemistryModel + ( + chemistryModel, + rhoChemistryModel, + gasEThermoPhysics + ); + + makeChemistryModel + ( + chemistryModel, + rhoChemistryModel, + constIncompressibleGasEThermoPhysics + ); + + makeChemistryModel + ( + chemistryModel, + rhoChemistryModel, + incompressibleGasEThermoPhysics + ); + + makeChemistryModel + ( + chemistryModel, + rhoChemistryModel, + icoPoly8EThermoPhysics ); } diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C index 189d43bdfa917426b6348fa5b4823c820e3574a9..ed2c8c2ba61b67f098bd8c15f3815115763a63e1 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,24 +33,61 @@ License namespace Foam { - makeChemistrySolverTypes(psiChemistryModel, constGasThermoPhysics); - makeChemistrySolverTypes(psiChemistryModel, gasThermoPhysics); + // Chemistry solvers based on sensibleEnthalpy + makeChemistrySolverTypes(psiChemistryModel, constGasHThermoPhysics); + makeChemistrySolverTypes(psiChemistryModel, gasHThermoPhysics); makeChemistrySolverTypes ( psiChemistryModel, - constIncompressibleGasThermoPhysics + constIncompressibleGasHThermoPhysics + ); + makeChemistrySolverTypes + ( + psiChemistryModel, + incompressibleGasHThermoPhysics) + ; + makeChemistrySolverTypes(psiChemistryModel, icoPoly8HThermoPhysics); + makeChemistrySolverTypes(rhoChemistryModel, constGasHThermoPhysics); + makeChemistrySolverTypes(rhoChemistryModel, gasHThermoPhysics); + makeChemistrySolverTypes + ( + rhoChemistryModel, + constIncompressibleGasHThermoPhysics + ); + makeChemistrySolverTypes + ( + rhoChemistryModel, + incompressibleGasHThermoPhysics + ); + makeChemistrySolverTypes(rhoChemistryModel, icoPoly8HThermoPhysics); + + // Chemistry solvers based on sensibleInternalEnergy + makeChemistrySolverTypes(psiChemistryModel, constGasEThermoPhysics); + makeChemistrySolverTypes(psiChemistryModel, gasEThermoPhysics); + makeChemistrySolverTypes + ( + psiChemistryModel, + constIncompressibleGasEThermoPhysics + ); + makeChemistrySolverTypes + ( + psiChemistryModel, + incompressibleGasEThermoPhysics + ); + makeChemistrySolverTypes(psiChemistryModel, icoPoly8EThermoPhysics); + makeChemistrySolverTypes(rhoChemistryModel, constGasEThermoPhysics); + makeChemistrySolverTypes(rhoChemistryModel, gasEThermoPhysics); + makeChemistrySolverTypes + ( + rhoChemistryModel, + constIncompressibleGasEThermoPhysics ); - makeChemistrySolverTypes(psiChemistryModel, incompressibleGasThermoPhysics); - makeChemistrySolverTypes(psiChemistryModel, icoPoly8ThermoPhysics); - makeChemistrySolverTypes(rhoChemistryModel, constGasThermoPhysics); - makeChemistrySolverTypes(rhoChemistryModel, gasThermoPhysics); makeChemistrySolverTypes ( rhoChemistryModel, - constIncompressibleGasThermoPhysics + incompressibleGasEThermoPhysics ); - makeChemistrySolverTypes(rhoChemistryModel, incompressibleGasThermoPhysics); - makeChemistrySolverTypes(rhoChemistryModel, icoPoly8ThermoPhysics); + makeChemistrySolverTypes(rhoChemistryModel, icoPoly8EThermoPhysics); } diff --git a/src/thermophysicalModels/radiationModels/include/createIncompressibleRadiationModel.H b/src/thermophysicalModels/radiationModels/include/createIncompressibleRadiationModel.H new file mode 100644 index 0000000000000000000000000000000000000000..ab7466d0a79195b257b3c7f38b2e301d69b14f5e --- /dev/null +++ b/src/thermophysicalModels/radiationModels/include/createIncompressibleRadiationModel.H @@ -0,0 +1,32 @@ + autoPtr<radiation::radiationModel> radiation + ( + radiation::radiationModel::New(T) + ); + + dimensionedScalar rhoCpRef + ( + "rhoCpRef", + dimDensity*dimEnergy/dimMass/dimTemperature, + 1.0 + ); + + if (radiation->radiation()) + { + IOdictionary transportProperties + ( + IOobject + ( + "transportProperties", + runTime.constant(), + runTime, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false // do not register! + ) + ); + + dimensionedScalar rhoRef(transportProperties.lookup("rhoRef")); + dimensionedScalar CpRef(transportProperties.lookup("CpRef")); + + rhoCpRef = rhoRef*CpRef; + } diff --git a/src/thermophysicalModels/radiationModels/radiationModel/P1/P1.C b/src/thermophysicalModels/radiationModels/radiationModel/P1/P1.C index 94d08934ab6ca7eb36e903b19f6845dbd678213f..a07142897b78228ac6c4fa15e8a583e9f77b4d4d 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/P1/P1.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/P1/P1.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,8 @@ License \*---------------------------------------------------------------------------*/ #include "P1.H" -#include "fvm.H" +#include "fvmLaplacian.H" +#include "fvmSup.H" #include "absorptionEmissionModel.H" #include "scatterModel.H" @@ -279,7 +280,7 @@ Foam::radiation::P1::Ru() const const DimensionedField<scalar, volMesh> a = absorptionEmission_->aCont()().dimensionedInternalField(); - return a*G - 4.0*E; + return a*G - 4.0*E; } diff --git a/src/thermophysicalModels/radiationModels/radiationModel/P1/P1.H b/src/thermophysicalModels/radiationModels/radiationModel/P1/P1.H index 2077d74445685ff3bc09884e8b6bb57083308c6c..fd86c51d09070699768d78b586f182af5169fcb5 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/P1/P1.H +++ b/src/thermophysicalModels/radiationModels/radiationModel/P1/P1.H @@ -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,6 +42,7 @@ SourceFiles #define radiationModelP1_H #include "radiationModel.H" +#include "volFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/radiationModels/radiationModel/noRadiation/noRadiation.C b/src/thermophysicalModels/radiationModels/radiationModel/noRadiation/noRadiation.C index 69666b7c63a0a591021ed049dc00e439bbc4bb4c..234b0fcd00c57d28030ee2a5e330162756108583 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/noRadiation/noRadiation.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/noRadiation/noRadiation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,9 @@ License #include "noRadiation.H" #include "physicoChemicalConstants.H" +#include "fvMesh.H" +#include "Time.H" +#include "volFields.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/radiationModels/radiationModel/opaqueSolid/opaqueSolid.C b/src/thermophysicalModels/radiationModels/radiationModel/opaqueSolid/opaqueSolid.C index ddc4a7a438f7fd17ad470c950aba78ce05c3b667..405ae7cc9c92c31541b952ab5e42ff87ba188b58 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/opaqueSolid/opaqueSolid.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/opaqueSolid/opaqueSolid.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,9 @@ License #include "opaqueSolid.H" #include "physicoChemicalConstants.H" +#include "fvMesh.H" +#include "Time.H" +#include "volFields.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C index 5948101185c074bc1aa90c44b10bca28be2c7759..48cd4178609f1a8a967f8b97d7179bf2cce74107 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,6 +27,7 @@ License #include "absorptionEmissionModel.H" #include "scatterModel.H" #include "fvmSup.H" +#include "fluidThermo.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -232,6 +233,20 @@ Foam::tmp<Foam::fvScalarMatrix> Foam::radiation::radiationModel::Sh } +Foam::tmp<Foam::fvScalarMatrix> Foam::radiation::radiationModel::ST +( + const dimensionedScalar& rhoCp, + volScalarField& T +) const +{ + return + ( + Ru()/rhoCp + - fvm::Sp(Rp()*pow3(T)/rhoCp, T) + ); +} + + const Foam::radiation::absorptionEmissionModel& Foam::radiation::radiationModel::absorptionEmission() const { diff --git a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H index 1218dac9e9b72612be3a91984f2d08d52215ec88..d4c39bd958eacd1e3a2e7b6811bd360bacf6442a 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H +++ b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,13 +47,18 @@ SourceFiles #include "runTimeSelectionTables.H" #include "addToRunTimeSelectionTable.H" #include "volFieldsFwd.H" -#include "fluidThermo.H" +#include "DimensionedField.H" #include "fvMatricesFwd.H" +#include "Switch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { + +class fluidThermo; +class fvMesh; + namespace radiation { @@ -82,7 +87,7 @@ protected: //- Reference to the temperature field const volScalarField& T_; - //- Model specific dictionary input parameters + //- Radiation model on/off flag Switch radiation_; //- Radiation model dictionary @@ -204,6 +209,12 @@ public: // Access + //- Radiation model on/off flag + const Switch radiation() const + { + return radiation_; + } + //- Source term component (for power of T^4) virtual tmp<volScalarField> Rp() const = 0; @@ -213,6 +224,13 @@ public: //- Energy source term virtual tmp<fvScalarMatrix> Sh(fluidThermo& thermo) const; + //- Temperature source term + virtual tmp<fvScalarMatrix> ST + ( + const dimensionedScalar& rhoCp, + volScalarField& T + ) const; + //- Access to absorptionEmissionModel const absorptionEmissionModel& absorptionEmission() const; }; diff --git a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModelNew.C b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModelNew.C index 0a4dd3730c8e47d264c38de8d4255444bdfdfec3..65b96b48ed476bc8ae720ac3386832650fdd75a6 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModelNew.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "radiationModel.H" +#include "volFields.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/radiationModels/radiationModel/viewFactor/viewFactor.H b/src/thermophysicalModels/radiationModels/radiationModel/viewFactor/viewFactor.H index 3b34006e8eb1e8ca6f893c146059eee3dc966b2b..0718afc0698aaed7c996498cef41b8a27a2d2560 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/viewFactor/viewFactor.H +++ b/src/thermophysicalModels/radiationModels/radiationModel/viewFactor/viewFactor.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,7 +51,9 @@ SourceFiles #include "globalIndex.H" #include "scalarListIOList.H" #include "mapDistribute.H" +#include "volFields.H" +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C index b7474a9fafba56f46d2fae5eb0199ae2b04c8aa1..b90e447c0b2350e1f138a3b55849437a27363f3e 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,23 +37,50 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeChemistryReader(constGasThermoPhysics); -makeChemistryReader(gasThermoPhysics); -makeChemistryReader(constIncompressibleGasThermoPhysics); -makeChemistryReader(incompressibleGasThermoPhysics); -makeChemistryReader(icoPoly8ThermoPhysics); -makeChemistryReader(hConstSolidThermoPhysics); -makeChemistryReader(hExponentialSolidThermoPhysics); +// Solid chemistry readers based on sensibleEnthalpy + +makeChemistryReader(constGasHThermoPhysics); +makeChemistryReader(gasHThermoPhysics); +makeChemistryReader(constIncompressibleGasHThermoPhysics); +makeChemistryReader(incompressibleGasHThermoPhysics); +makeChemistryReader(icoPoly8HThermoPhysics); + +makeChemistryReaderType(foamChemistryReader, constGasHThermoPhysics); +makeChemistryReaderType(foamChemistryReader, gasHThermoPhysics); +makeChemistryReaderType +( + foamChemistryReader, + constIncompressibleGasHThermoPhysics +); +makeChemistryReaderType(foamChemistryReader, incompressibleGasHThermoPhysics); +makeChemistryReaderType(foamChemistryReader, icoPoly8HThermoPhysics); + -makeChemistryReaderType(foamChemistryReader, constGasThermoPhysics); -makeChemistryReaderType(foamChemistryReader, gasThermoPhysics); + +// Solid chemistry readers based on sensibleInternalEnergy + +makeChemistryReader(constGasEThermoPhysics); +makeChemistryReader(gasEThermoPhysics); +makeChemistryReader(constIncompressibleGasEThermoPhysics); +makeChemistryReader(incompressibleGasEThermoPhysics); +makeChemistryReader(icoPoly8EThermoPhysics); + +makeChemistryReaderType(foamChemistryReader, constGasEThermoPhysics); +makeChemistryReaderType(foamChemistryReader, gasEThermoPhysics); makeChemistryReaderType ( foamChemistryReader, - constIncompressibleGasThermoPhysics + constIncompressibleGasEThermoPhysics ); -makeChemistryReaderType(foamChemistryReader, incompressibleGasThermoPhysics); -makeChemistryReaderType(foamChemistryReader, icoPoly8ThermoPhysics); +makeChemistryReaderType(foamChemistryReader, incompressibleGasEThermoPhysics); +makeChemistryReaderType(foamChemistryReader, icoPoly8EThermoPhysics); + + +// Solid chemistry readers for solids based on sensibleInternalEnergy + +makeChemistryReader(hConstSolidThermoPhysics); +makeChemistryReader(hExponentialSolidThermoPhysics); + makeChemistryReaderType(foamChemistryReader, hConstSolidThermoPhysics); makeChemistryReaderType(foamChemistryReader, hExponentialSolidThermoPhysics); diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L index c0cce76a2ade77865be53adf2194423a12bc928f..678300a172ca945e6da19b0cea0377a753de995e 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L @@ -296,13 +296,13 @@ List<specieElement> currentSpecieComposition(5); scalar currentLowT = 0; scalar currentHighT = 0; scalar currentCommonT = 0; -gasThermoPhysics::coeffArray highCpCoeffs(scalarList(7)); -gasThermoPhysics::coeffArray lowCpCoeffs(scalarList(7)); +gasHThermoPhysics::coeffArray highCpCoeffs(scalarList(7)); +gasHThermoPhysics::coeffArray lowCpCoeffs(scalarList(7)); -gasReaction::specieCoeffs currentSpecieCoeff; +gasHReaction::specieCoeffs currentSpecieCoeff; -DynamicList<gasReaction::specieCoeffs> lhs; -DynamicList<gasReaction::specieCoeffs> rhs; +DynamicList<gasHReaction::specieCoeffs> lhs; +DynamicList<gasHReaction::specieCoeffs> rhs; scalarList ArrheniusCoeffs(3); DynamicList<scalar> reactionCoeffs; @@ -312,7 +312,7 @@ label currentThirdBodyIndex = -1; word reactionCoeffsName = word::null; HashTable<scalarList> reactionCoeffsTable; -DynamicList<gasReaction::specieCoeffs> *lrhsPtr = &lhs; +DynamicList<gasHReaction::specieCoeffs> *lrhsPtr = &lhs; reactionType rType = unknownReactionType; reactionRateType rrType = Arrhenius; @@ -609,7 +609,7 @@ bool finishReaction = false; <readThermoLineLabel4>{thermoLineLabel4} { - HashPtrTable<gasThermoPhysics>::iterator specieThermoIter + HashPtrTable<gasHThermoPhysics>::iterator specieThermoIter ( speciesThermo_.find(currentSpecieName) ); @@ -622,7 +622,7 @@ bool finishReaction = false; speciesThermo_.insert ( currentSpecieName, - new gasThermoPhysics + new gasHThermoPhysics ( janafThermo<perfectGas<specie> > ( @@ -1429,7 +1429,7 @@ bool finishReaction = false; <readReactionOrder>{reactionCoeff}{endReactionCoeffs} { - DynamicList<gasReaction::specieCoeffs>& lrhs = *lrhsPtr; + DynamicList<gasHReaction::specieCoeffs>& lrhs = *lrhsPtr; bool found = false; diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C index 922c1227b9c55615fd44f985bd2eef75e9e0fc59..5ee2a03ac3da93eda3043e7c6ccd96948a99b327 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) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,7 @@ License namespace Foam { - addChemistryReaderType(chemkinReader, gasThermoPhysics); + addChemistryReaderType(chemkinReader, gasHThermoPhysics); } @@ -168,8 +168,8 @@ template<class ReactionRateType> void Foam::chemkinReader::addReactionType ( const reactionType rType, - DynamicList<gasReaction::specieCoeffs>& lhs, - DynamicList<gasReaction::specieCoeffs>& rhs, + DynamicList<gasHReaction::specieCoeffs>& lhs, + DynamicList<gasHReaction::specieCoeffs>& rhs, const ReactionRateType& rr ) { @@ -180,9 +180,9 @@ void Foam::chemkinReader::addReactionType reactions_.append ( new IrreversibleReaction - <Reaction, gasThermoPhysics, ReactionRateType> + <Reaction, gasHThermoPhysics, ReactionRateType> ( - Reaction<gasThermoPhysics> + Reaction<gasHThermoPhysics> ( speciesTable_, lhs.shrink(), @@ -200,9 +200,9 @@ void Foam::chemkinReader::addReactionType reactions_.append ( new ReversibleReaction - <Reaction, gasThermoPhysics, ReactionRateType> + <Reaction, gasHThermoPhysics, ReactionRateType> ( - Reaction<gasThermoPhysics> + Reaction<gasHThermoPhysics> ( speciesTable_, lhs.shrink(), @@ -240,8 +240,8 @@ void Foam::chemkinReader::addPressureDependentReaction ( const reactionType rType, const fallOffFunctionType fofType, - DynamicList<gasReaction::specieCoeffs>& lhs, - DynamicList<gasReaction::specieCoeffs>& rhs, + DynamicList<gasHReaction::specieCoeffs>& lhs, + DynamicList<gasHReaction::specieCoeffs>& rhs, const scalarList& efficiencies, const scalarList& k0Coeffs, const scalarList& kInfCoeffs, @@ -423,8 +423,8 @@ void Foam::chemkinReader::addPressureDependentReaction void Foam::chemkinReader::addReaction ( - DynamicList<gasReaction::specieCoeffs>& lhs, - DynamicList<gasReaction::specieCoeffs>& rhs, + DynamicList<gasHReaction::specieCoeffs>& lhs, + DynamicList<gasHReaction::specieCoeffs>& rhs, const scalarList& efficiencies, const reactionType rType, const reactionRateType rrType, @@ -499,9 +499,9 @@ void Foam::chemkinReader::addReaction reactions_.append ( new NonEquilibriumReversibleReaction - <Reaction, gasThermoPhysics, ArrheniusReactionRate> + <Reaction, gasHThermoPhysics, ArrheniusReactionRate> ( - Reaction<gasThermoPhysics> + Reaction<gasHThermoPhysics> ( speciesTable_, lhs.shrink(), @@ -554,11 +554,11 @@ void Foam::chemkinReader::addReaction new NonEquilibriumReversibleReaction < Reaction, - gasThermoPhysics, + gasHThermoPhysics, thirdBodyArrheniusReactionRate > ( - Reaction<gasThermoPhysics> + Reaction<gasHThermoPhysics> ( speciesTable_, lhs.shrink(), @@ -661,9 +661,9 @@ void Foam::chemkinReader::addReaction reactions_.append ( new NonEquilibriumReversibleReaction - <Reaction, gasThermoPhysics, LandauTellerReactionRate> + <Reaction, gasHThermoPhysics, LandauTellerReactionRate> ( - Reaction<gasThermoPhysics> + Reaction<gasHThermoPhysics> ( speciesTable_, lhs.shrink(), diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H index 6e0d4dc5c1af7eec497eb6d7c0ece31f71be1c39..4cd84f59a507b93d2aa3fcc5b3f35dfdc213a881 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) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,7 +61,7 @@ namespace Foam class chemkinReader : - public chemistryReader<gasThermoPhysics>, + public chemistryReader<gasHThermoPhysics>, public yyFlexLexer { @@ -199,13 +199,13 @@ private: HashTable<phase> speciePhase_; //- Table of the thermodynamic data given in the CHEMKIN file - HashPtrTable<gasThermoPhysics> speciesThermo_; + HashPtrTable<gasHThermoPhysics> speciesThermo_; //- Table of species composition HashTable<List<specieElement> > specieComposition_; //- List of the reactions - ReactionList<gasThermoPhysics> reactions_; + ReactionList<gasHThermoPhysics> reactions_; // Private Member Functions @@ -257,8 +257,8 @@ private: void addReactionType ( const reactionType rType, - DynamicList<gasReaction::specieCoeffs>& lhs, - DynamicList<gasReaction::specieCoeffs>& rhs, + DynamicList<gasHReaction::specieCoeffs>& lhs, + DynamicList<gasHReaction::specieCoeffs>& rhs, const ReactionRateType& rr ); @@ -267,8 +267,8 @@ private: ( const reactionType rType, const fallOffFunctionType fofType, - DynamicList<gasReaction::specieCoeffs>& lhs, - DynamicList<gasReaction::specieCoeffs>& rhs, + DynamicList<gasHReaction::specieCoeffs>& lhs, + DynamicList<gasHReaction::specieCoeffs>& rhs, const scalarList& thirdBodyEfficiencies, const scalarList& k0Coeffs, const scalarList& kInfCoeffs, @@ -280,8 +280,8 @@ private: void addReaction ( - DynamicList<gasReaction::specieCoeffs>& lhs, - DynamicList<gasReaction::specieCoeffs>& rhs, + DynamicList<gasHReaction::specieCoeffs>& lhs, + DynamicList<gasHReaction::specieCoeffs>& rhs, const scalarList& thirdBodyEfficiencies, const reactionType rType, const reactionRateType rrType, @@ -364,7 +364,7 @@ public: } //- Table of the thermodynamic data given in the CHEMKIN file - const HashPtrTable<gasThermoPhysics>& speciesThermo() const + const HashPtrTable<gasHThermoPhysics>& speciesThermo() const { return speciesThermo_; } @@ -376,7 +376,7 @@ public: } //- List of the reactions - const ReactionList<gasThermoPhysics>& reactions() const + const ReactionList<gasHThermoPhysics>& reactions() const { return reactions_; } diff --git a/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermos.C b/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermos.C index 4e65f3a24c8dbc5dd3283b6015446cfc2b475e1b..ed1e0abf8144f27e11ba34b661ae9d9b991fa775 100644 --- a/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermos.C +++ b/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermos.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -179,7 +179,7 @@ makeReactionThermo ); -// Multi-component thermo +// Multi-component thermo for sensible enthalpy makeReactionMixtureThermo ( @@ -187,7 +187,7 @@ makeReactionMixtureThermo psiReactionThermo, hePsiThermo, multiComponentMixture, - constGasThermoPhysics + constGasHThermoPhysics ); makeReactionMixtureThermo @@ -196,11 +196,62 @@ makeReactionMixtureThermo psiReactionThermo, hePsiThermo, multiComponentMixture, - gasThermoPhysics + gasHThermoPhysics ); -// Multi-component reaction thermo +// Multi-component thermo for internal energy + +makeReactionMixtureThermo +( + psiThermo, + psiReactionThermo, + hePsiThermo, + multiComponentMixture, + constGasEThermoPhysics +); + +makeReactionMixtureThermo +( + psiThermo, + psiReactionThermo, + hePsiThermo, + multiComponentMixture, + gasEThermoPhysics +); + + +// Multi-component reaction thermo for sensible enthalpy + +makeReactionMixtureThermo +( + psiThermo, + psiReactionThermo, + hePsiThermo, + reactingMixture, + constGasHThermoPhysics +); + +makeReactionMixtureThermo +( + psiThermo, + psiReactionThermo, + hePsiThermo, + reactingMixture, + gasHThermoPhysics +); + +makeReactionMixtureThermo +( + psiThermo, + psiReactionThermo, + hePsiThermo, + singleStepReactingMixture, + gasHThermoPhysics +); + + +// Multi-component reaction thermo for internal energy makeReactionMixtureThermo ( @@ -208,7 +259,7 @@ makeReactionMixtureThermo psiReactionThermo, hePsiThermo, reactingMixture, - constGasThermoPhysics + constGasEThermoPhysics ); makeReactionMixtureThermo @@ -217,7 +268,7 @@ makeReactionMixtureThermo psiReactionThermo, hePsiThermo, reactingMixture, - gasThermoPhysics + gasEThermoPhysics ); makeReactionMixtureThermo @@ -226,7 +277,7 @@ makeReactionMixtureThermo psiReactionThermo, hePsiThermo, singleStepReactingMixture, - gasThermoPhysics + gasEThermoPhysics ); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermos.C b/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermos.C index 6dbf589bce9ecbcc9ee02a9274adb18e4753bb29..a6a880ca764bd63d4853a324abbb9adfffd29c8a 100644 --- a/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermos.C +++ b/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermos.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -213,7 +213,7 @@ makeReactionThermo ); -// Multi-component thermo +// Multi-component thermo for internal energy makeReactionMixtureThermo ( @@ -221,7 +221,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, multiComponentMixture, - constGasThermoPhysics + constGasEThermoPhysics ); makeReactionMixtureThermo @@ -230,7 +230,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, multiComponentMixture, - gasThermoPhysics + gasEThermoPhysics ); makeReactionMixtureThermo @@ -239,7 +239,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, multiComponentMixture, - constIncompressibleGasThermoPhysics + constIncompressibleGasEThermoPhysics ); makeReactionMixtureThermo @@ -248,7 +248,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, multiComponentMixture, - incompressibleGasThermoPhysics + incompressibleGasEThermoPhysics ); makeReactionMixtureThermo @@ -257,7 +257,114 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, multiComponentMixture, - icoPoly8ThermoPhysics + icoPoly8EThermoPhysics +); + + + // Multi-component reaction thermo + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + reactingMixture, + constGasEThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + reactingMixture, + gasEThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + reactingMixture, + constIncompressibleGasEThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + reactingMixture, + incompressibleGasEThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + reactingMixture, + icoPoly8EThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + singleStepReactingMixture, + gasEThermoPhysics +); + + + + +// Multi-component thermo for sensible enthalpy + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + multiComponentMixture, + constGasHThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + multiComponentMixture, + gasHThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + multiComponentMixture, + constIncompressibleGasHThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + multiComponentMixture, + incompressibleGasHThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + multiComponentMixture, + icoPoly8HThermoPhysics ); @@ -269,7 +376,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, reactingMixture, - constGasThermoPhysics + constGasHThermoPhysics ); makeReactionMixtureThermo @@ -278,7 +385,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, reactingMixture, - gasThermoPhysics + gasHThermoPhysics ); makeReactionMixtureThermo @@ -287,7 +394,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, reactingMixture, - constIncompressibleGasThermoPhysics + constIncompressibleGasHThermoPhysics ); makeReactionMixtureThermo @@ -296,7 +403,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, reactingMixture, - incompressibleGasThermoPhysics + incompressibleGasHThermoPhysics ); makeReactionMixtureThermo @@ -305,7 +412,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, reactingMixture, - icoPoly8ThermoPhysics + icoPoly8HThermoPhysics ); makeReactionMixtureThermo @@ -314,7 +421,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, singleStepReactingMixture, - gasThermoPhysics + gasHThermoPhysics ); diff --git a/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModels.C b/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModels.C index 104fa11a7d7a5d55c5073a324ee2d72c08c790ed..d51976f196c2c8d74101aabcc844d8f078981463 100644 --- a/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModels.C +++ b/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,7 @@ namespace Foam ODESolidChemistryModel, solidChemistryModel, hConstSolidThermoPhysics, - gasThermoPhysics + gasHThermoPhysics ); makeSolidChemistryModel @@ -54,7 +54,7 @@ namespace Foam ODESolidChemistryModel, solidChemistryModel, hExponentialSolidThermoPhysics, - gasThermoPhysics + gasHThermoPhysics ); } diff --git a/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolvers.C b/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolvers.C index 9c8a6df052fbd0e7be6f5efc0ce21c519c2582e7..3b6f13f486398a810b1c9bff714b95d5b095ef72 100644 --- a/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolvers.C +++ b/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolvers.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,7 +41,7 @@ namespace Foam ode, solidChemistryModel, hConstSolidThermoPhysics, - gasThermoPhysics + gasHThermoPhysics ) makeSolidChemistrySolverType @@ -49,7 +49,7 @@ namespace Foam ode, solidChemistryModel, hExponentialSolidThermoPhysics, - gasThermoPhysics + gasHThermoPhysics ) } diff --git a/src/thermophysicalModels/solidSpecie/transport/const/constAnIsoSolidTransport.H b/src/thermophysicalModels/solidSpecie/transport/const/constAnIsoSolidTransport.H index 60b846fd7ad03646e72b769e294bafa3ae402d3f..718f648143354953ad3b02ed04e8b19548e42b06 100644 --- a/src/thermophysicalModels/solidSpecie/transport/const/constAnIsoSolidTransport.H +++ b/src/thermophysicalModels/solidSpecie/transport/const/constAnIsoSolidTransport.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -111,6 +111,9 @@ public: return "constAnIso<" + Thermo::typeName() + '>'; } + //- Is the thermal conductivity isotropic + static const bool isotropic = false; + //- Isotropic thermal conductivity [W/mK] inline scalar kappa(const scalar p, const scalar T) const; diff --git a/src/thermophysicalModels/solidSpecie/transport/const/constIsoSolidTransport.H b/src/thermophysicalModels/solidSpecie/transport/const/constIsoSolidTransport.H index 5b49beab675742b8b004c4381e942c9a1a0f4cd2..fc9cb4438a5d999d22bd58777a512a27f533d75a 100644 --- a/src/thermophysicalModels/solidSpecie/transport/const/constIsoSolidTransport.H +++ b/src/thermophysicalModels/solidSpecie/transport/const/constIsoSolidTransport.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -112,6 +112,9 @@ public: return "constIso<" + Thermo::typeName() + '>'; } + //- Is the thermal conductivity isotropic + static const bool isotropic = true; + //- Isotropic thermal conductivity [W/mK] inline scalar kappa(const scalar p, const scalar T) const; diff --git a/src/thermophysicalModels/solidSpecie/transport/exponential/exponentialSolidTransport.H b/src/thermophysicalModels/solidSpecie/transport/exponential/exponentialSolidTransport.H index 00cc81e1b3be90735d58939f5009204c87e80d4f..3592626d8045b8846d58a092bde25a53ab74750d 100644 --- a/src/thermophysicalModels/solidSpecie/transport/exponential/exponentialSolidTransport.H +++ b/src/thermophysicalModels/solidSpecie/transport/exponential/exponentialSolidTransport.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -121,6 +121,9 @@ public: return "exponential<" + Thermo::typeName() + '>'; } + //- Is the thermal conductivity isotropic + static const bool isotropic = true; + //- Thermal conductivity [W/mK] inline scalar kappa(const scalar p, const scalar T) const; diff --git a/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.H b/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.H index 8d13ea6e28a61c7467f6b90b0922e40e5b587125..146656d69e97a30e7dbebf5a4eb1a86a9b64ff38 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.H +++ b/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -99,6 +99,12 @@ public: //- Anisotropic thermal conductivity [W/m/K] virtual tmp<volVectorField> Kappa() const; + //- Return true if thermal conductivity is isotropic + virtual bool isotropic() const + { + return MixtureType::thermoType::isotropic; + } + // Per patch calculation diff --git a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H index e3cf9b8e19d641b554e549be24ac75700857dbe9..04934ca950cf559da6bdf6fdbb9fc35245fb7e23 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H +++ b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -144,6 +144,9 @@ public: //- Thermal conductivity [W/m/K] virtual tmp<volVectorField> Kappa() const = 0; + //- Return true if thermal conductivity is isotropic + virtual bool isotropic() const = 0; + // Per patch calculation diff --git a/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGas.H b/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGas.H index 7ff3f054e3adfc9a42567bfbf2835eca07fd1121..566c3c972911bfdb5634ba70ac6699d47833bdcf 100644 --- a/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGas.H +++ b/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGas.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,7 +105,10 @@ public: // Constructors //- Construct from components - inline incompressiblePerfectGas(const Specie& sp); + inline incompressiblePerfectGas(const Specie& sp, const scalar pRef); + + //- Construct from incompressiblePerfectGas + inline incompressiblePerfectGas(const incompressiblePerfectGas& sp); //- Construct from Istream incompressiblePerfectGas(Istream&); @@ -173,6 +176,10 @@ public: // Member operators + inline incompressiblePerfectGas& operator= + ( + const incompressiblePerfectGas& + ); inline void operator+=(const incompressiblePerfectGas&); inline void operator-=(const incompressiblePerfectGas&); diff --git a/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGasI.H b/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGasI.H index 340d4b1e4c5f502320282a3256228329ee53abe2..ff2f3e233dfccfa21d08c5cb150ca4070fa0ff89 100644 --- a/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGasI.H +++ b/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGasI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,28 +25,40 @@ License #include "incompressiblePerfectGas.H" -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Specie> inline Foam::incompressiblePerfectGas<Specie>::incompressiblePerfectGas ( - const Specie& sp + const Specie& sp, const scalar pRef ) : - Specie(sp) + Specie(sp), + pRef_(pRef) {} -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +template<class Specie> +inline Foam::incompressiblePerfectGas<Specie>::incompressiblePerfectGas +( + const incompressiblePerfectGas& ipg +) +: + Specie(ipg), + pRef_(ipg.pRef_) +{} + template<class Specie> inline Foam::incompressiblePerfectGas<Specie>::incompressiblePerfectGas ( const word& name, - const incompressiblePerfectGas<Specie>& pg + const incompressiblePerfectGas<Specie>& ipg ) : - Specie(name, pg) + Specie(name, ipg), + pRef_(ipg.pRef_) {} @@ -109,7 +121,7 @@ inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::psi scalar T ) const { - return 0.0; + return 1.0/(this->R()*T); } @@ -120,7 +132,7 @@ inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::Z scalar ) const { - return 0.0; + return 1.0; } @@ -138,23 +150,43 @@ inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::cpMcv // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // +template<class Specie> +inline Foam::incompressiblePerfectGas<Specie>& +Foam::incompressiblePerfectGas<Specie>::operator= +( + const incompressiblePerfectGas<Specie>& ipg +) +{ + Specie::operator=(ipg); + + pRef_ = ipg.pRef_; + + return *this; +} + template<class Specie> inline void Foam::incompressiblePerfectGas<Specie>::operator+= ( - const incompressiblePerfectGas<Specie>& pg + const incompressiblePerfectGas<Specie>& ipg ) { - Specie::operator+=(pg); + scalar molr1 = this->nMoles(); + Specie::operator+=(ipg); + molr1 /= this->nMoles(); + scalar molr2 = ipg.nMoles()/this->nMoles(); + + pRef_ = molr1*pRef_ + molr2*ipg.pRef_; } template<class Specie> inline void Foam::incompressiblePerfectGas<Specie>::operator-= ( - const incompressiblePerfectGas<Specie>& pg + const incompressiblePerfectGas<Specie>& ipg ) { - Specie::operator-=(pg); + Specie::operator-=(ipg); + pRef_ = ipg.pRef_; } @@ -170,14 +202,19 @@ inline void Foam::incompressiblePerfectGas<Specie>::operator*=(const scalar s) template<class Specie> inline Foam::incompressiblePerfectGas<Specie> Foam::operator+ ( - const incompressiblePerfectGas<Specie>& pg1, - const incompressiblePerfectGas<Specie>& pg2 + const incompressiblePerfectGas<Specie>& ipg1, + const incompressiblePerfectGas<Specie>& ipg2 ) { + scalar nMoles = ipg1.nMoles() + ipg2.nMoles(); + scalar molr1 = ipg1.nMoles()/nMoles; + scalar molr2 = ipg2.nMoles()/nMoles; + return incompressiblePerfectGas<Specie> ( - static_cast<const Specie&>(pg1) - + static_cast<const Specie&>(pg2) + static_cast<const Specie&>(ipg1) + + static_cast<const Specie&>(ipg2), + molr1*ipg1.pRef_ + molr2*ipg2.pRef_ ); } @@ -185,14 +222,15 @@ inline Foam::incompressiblePerfectGas<Specie> Foam::operator+ template<class Specie> inline Foam::incompressiblePerfectGas<Specie> Foam::operator- ( - const incompressiblePerfectGas<Specie>& pg1, - const incompressiblePerfectGas<Specie>& pg2 + const incompressiblePerfectGas<Specie>& ipg1, + const incompressiblePerfectGas<Specie>& ipg2 ) { return incompressiblePerfectGas<Specie> ( - static_cast<const Specie&>(pg1) - - static_cast<const Specie&>(pg2) + static_cast<const Specie&>(ipg1) + - static_cast<const Specie&>(ipg2), + ipg1.pRef_ ); } @@ -201,10 +239,14 @@ template<class Specie> inline Foam::incompressiblePerfectGas<Specie> Foam::operator* ( const scalar s, - const incompressiblePerfectGas<Specie>& pg + const incompressiblePerfectGas<Specie>& ipg ) { - return incompressiblePerfectGas<Specie>(s*static_cast<const Specie&>(pg)); + return incompressiblePerfectGas<Specie> + ( + s*static_cast<const Specie&>(ipg), + ipg.pRef_ + ); } diff --git a/src/thermophysicalModels/specie/include/reactionTypes.H b/src/thermophysicalModels/specie/include/reactionTypes.H index 8b0a5f20d559f128a46e7624d8a016da46562328..e6af91d8967d473b36fbed027e4211b14f99003c 100644 --- a/src/thermophysicalModels/specie/include/reactionTypes.H +++ b/src/thermophysicalModels/specie/include/reactionTypes.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,16 +43,31 @@ Description namespace Foam { - typedef Reaction<constGasThermoPhysics> constGasReaction; + // sensible enthalpy based reactions + typedef Reaction<constGasHThermoPhysics> constGasHReaction; - typedef Reaction<gasThermoPhysics> gasReaction; + typedef Reaction<gasHThermoPhysics> gasHReaction; - typedef Reaction<constIncompressibleGasThermoPhysics> - constIncompressibleGasReaction; + typedef Reaction<constIncompressibleGasHThermoPhysics> + constIncompressibleGasHReaction; - typedef Reaction<incompressibleGasThermoPhysics> incompressibleGasReaction; + typedef Reaction<incompressibleGasHThermoPhysics> + incompressibleGasHReaction; - typedef Reaction<icoPoly8ThermoPhysics> icoPoly8Reaction; + typedef Reaction<icoPoly8HThermoPhysics> icoPoly8HReaction; + + // internal ennergy based reactions + typedef Reaction<constGasEThermoPhysics> constGasEReaction; + + typedef Reaction<gasEThermoPhysics> gasEReaction; + + typedef Reaction<constIncompressibleGasEThermoPhysics> + constIncompressibleGasEReaction; + + typedef Reaction<incompressibleGasEThermoPhysics> + incompressibleGasEReaction; + + typedef Reaction<icoPoly8EThermoPhysics> icoPoly8EReaction; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H b/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H index a3a276b926a44c307671aaeecfcd2a809fa72601..cb17a56a1419b064ece1a1d6d6e613609832b545 100644 --- a/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H +++ b/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,7 +37,9 @@ Description #include "incompressiblePerfectGas.H" #include "hConstThermo.H" #include "janafThermo.H" + #include "sensibleEnthalpy.H" +#include "sensibleInternalEnergy.H" #include "thermo.H" #include "sutherlandTransport.H" #include "constTransport.H" @@ -50,6 +52,7 @@ Description namespace Foam { + // thermo physics types based on sensibleEnthalpy typedef constTransport < @@ -61,7 +64,7 @@ namespace Foam >, sensibleEnthalpy > - > constGasThermoPhysics; + > constGasHThermoPhysics; typedef sutherlandTransport @@ -74,7 +77,7 @@ namespace Foam >, sensibleEnthalpy > - > gasThermoPhysics; + > gasHThermoPhysics; typedef constTransport @@ -87,7 +90,7 @@ namespace Foam >, sensibleEnthalpy > - > constIncompressibleGasThermoPhysics; + > constIncompressibleGasHThermoPhysics; typedef sutherlandTransport @@ -100,7 +103,7 @@ namespace Foam >, sensibleEnthalpy > - > incompressibleGasThermoPhysics; + > incompressibleGasHThermoPhysics; typedef polynomialTransport @@ -115,7 +118,76 @@ namespace Foam sensibleEnthalpy >, 8 - > icoPoly8ThermoPhysics; + > icoPoly8HThermoPhysics; + + + // thermo physics types based on sensibleInternalEnergy + typedef + constTransport + < + species::thermo + < + hConstThermo + < + perfectGas<specie> + >, + sensibleInternalEnergy + > + > constGasEThermoPhysics; + + typedef + sutherlandTransport + < + species::thermo + < + janafThermo + < + perfectGas<specie> + >, + sensibleInternalEnergy + > + > gasEThermoPhysics; + + typedef + constTransport + < + species::thermo + < + hConstThermo + < + incompressiblePerfectGas<specie> + >, + sensibleInternalEnergy + > + > constIncompressibleGasEThermoPhysics; + + typedef + sutherlandTransport + < + species::thermo + < + janafThermo + < + incompressiblePerfectGas<specie> + >, + sensibleInternalEnergy + > + > incompressibleGasEThermoPhysics; + + typedef + polynomialTransport + < + species::thermo + < + hPolynomialThermo + < + icoPolynomial<specie, 8>, + 8 + >, + sensibleInternalEnergy + >, + 8 + > icoPoly8EThermoPhysics; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/specie/reaction/reactions/makeLangmuirHinshelwoodReactions.C b/src/thermophysicalModels/specie/reaction/reactions/makeLangmuirHinshelwoodReactions.C index 6f98a4bc3570eb7b426109b6437138c9aa93f5b8..b5d8c0ad1d1f5ff0addceb56b4895d23d19f63e6 100644 --- a/src/thermophysicalModels/specie/reaction/reactions/makeLangmuirHinshelwoodReactions.C +++ b/src/thermophysicalModels/specie/reaction/reactions/makeLangmuirHinshelwoodReactions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,8 +31,11 @@ License namespace Foam { - makeIRReactions(gasThermoPhysics, LangmuirHinshelwoodReactionRate) - makeIRReactions(icoPoly8ThermoPhysics, LangmuirHinshelwoodReactionRate) + makeIRReactions(gasHThermoPhysics, LangmuirHinshelwoodReactionRate) + makeIRReactions(icoPoly8HThermoPhysics, LangmuirHinshelwoodReactionRate) + + makeIRReactions(gasEThermoPhysics, LangmuirHinshelwoodReactionRate) + makeIRReactions(icoPoly8EThermoPhysics, LangmuirHinshelwoodReactionRate) } // ************************************************************************* // diff --git a/src/thermophysicalModels/specie/reaction/reactions/makeReactions.C b/src/thermophysicalModels/specie/reaction/reactions/makeReactions.C index ff13e68b69abdadc537f0f84799f620c7e0003d6..4dfd73d6a033d9cfdd17a84d8037125187371604 100644 --- a/src/thermophysicalModels/specie/reaction/reactions/makeReactions.C +++ b/src/thermophysicalModels/specie/reaction/reactions/makeReactions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -83,15 +83,26 @@ License namespace Foam { - makeReactions(constGasThermoPhysics, constGasReaction) - makeReactions(gasThermoPhysics, gasReaction) + // sensible enthalpy based reactions + makeReactions(constGasHThermoPhysics, constGasHReaction) + makeReactions(gasHThermoPhysics, gasHReaction) makeReactions ( - constIncompressibleGasThermoPhysics, - constIncompressibleGasReaction + constIncompressibleGasHThermoPhysics, + constIncompressibleGasHReaction ) - makeReactions(incompressibleGasThermoPhysics, incompressibleGasReaction) - makeReactions(icoPoly8ThermoPhysics, icoPoly8Reaction) + makeReactions(incompressibleGasHThermoPhysics, incompressibleGasHReaction) + makeReactions(icoPoly8HThermoPhysics, icoPoly8HReaction) + + makeReactions(constGasEThermoPhysics, constGasEReaction) + makeReactions(gasEThermoPhysics, gasEReaction) + makeReactions + ( + constIncompressibleGasEThermoPhysics, + constIncompressibleGasEReaction + ) + makeReactions(incompressibleGasEThermoPhysics, incompressibleGasEReaction) + makeReactions(icoPoly8EThermoPhysics, icoPoly8EReaction) } // ************************************************************************* // diff --git a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/combustionProperties b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/combustionProperties index 30c31c7471bffc10fc8a57c75bc336190538f89d..643c593447c13d0d44977f4bbd6d06fab50fa0e8 100644 --- a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/combustionProperties +++ b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/combustionProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel infinitelyFastChemistry<psiThermoCombustion,gasThermoPhysics>; +combustionModel infinitelyFastChemistry<psiThermoCombustion,gasHThermoPhysics>; active true; diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/combustionProperties b/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/combustionProperties index 1576592b91a3a00fb93f3adfbf53029216dabd7c..51e80f82d64f8071b585d60ff043dd8742ab02b5 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/combustionProperties +++ b/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/combustionProperties @@ -15,9 +15,8 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -//combustionModel noCombustion<psiThermoCombustion>; -combustionModel infinitelyFastChemistry<psiThermoCombustion,gasThermoPhysics>; -//combustionModel FSD<psiThermoCombustion,gasThermoPhysics>; +combustionModel infinitelyFastChemistry<psiThermoCombustion,gasHThermoPhysics>; +//combustionModel FSD<psiThermoCombustion,gasHThermoPhysics>; active true; diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/combustionProperties b/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/combustionProperties index 689dc54c6295bdc4da1324124adb9fe69fb1e281..cedf34b4115448cd5a88c36120d5b7949fa97e8f 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/combustionProperties +++ b/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/combustionProperties @@ -16,7 +16,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel infinitelyFastChemistry<psiThermoCombustion,gasThermoPhysics>; +combustionModel infinitelyFastChemistry<psiThermoCombustion,gasHThermoPhysics>; active on; diff --git a/tutorials/compressible/rhoPimpleFoam/ras/mixerVessel2D/constant/porosityProperties b/tutorials/compressible/rhoPimpleFoam/ras/mixerVessel2D/constant/porosityProperties deleted file mode 100644 index 6c2f939ea683a4b1d9091887a58c0588ba0d5fbf..0000000000000000000000000000000000000000 --- a/tutorials/compressible/rhoPimpleFoam/ras/mixerVessel2D/constant/porosityProperties +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object porosityProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -porosity1 -{ - type DarcyForchheimer; - active yes; - cellZone stator; - - DarcyForchheimerCoeffs - { - d d [0 -2 0 0 0 0 0] (1e5 -1000 -1000); - f f [0 -1 0 0 0 0 0] (0 0 0); - - coordinateSystem - { - type cartesian; - origin (0 0 0); - coordinateRotation - { - type axesRotation; - e1 (1 0 0); - e2 (0 1 0); - } - } - } -} - -// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/ras/mixerVessel2D/system/fvOptions b/tutorials/compressible/rhoPimpleFoam/ras/mixerVessel2D/system/fvOptions new file mode 100644 index 0000000000000000000000000000000000000000..ad93222fb976459e9afc1d5924b2d40834a29c46 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/ras/mixerVessel2D/system/fvOptions @@ -0,0 +1,69 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvOptions; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +porosity1 +{ + type explicitPorositySource; + active yes; + selectionMode cellZone; + cellZone stator; + + explicitPorositySourceCoeffs + { + type DarcyForchheimer; + + DarcyForchheimerCoeffs + { + d d [0 -2 0 0 0 0 0] (1e5 -1000 -1000); + f f [0 -1 0 0 0 0 0] (0 0 0); + + coordinateSystem + { + type cartesian; + origin (0 0 0); + coordinateRotation + { + type axesRotation; + e1 (1 0 0); + e2 (0 1 0); + } + } + } + } +} + + +MRF1 +{ + type MRFSource; + active yes; + selectionMode cellZone; + cellZone rotor; + + MRFSourceCoeffs + { + // Fixed patches (by default they 'move' with the MRF zone) + nonRotatingPatches (); + + origin (0 0 0); + axis (0 0 1); + omega constant 1047.2; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 b/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 index 79da11e10ac8f655aa16fc6287c9496875d8672f..2e865a7856a7ac268e22302a7b752184d8bc0ba7 100644 --- a/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 +++ b/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 @@ -107,55 +107,79 @@ edges ( ); -patches +boundary ( // is there no way of defining all my 'defaultFaces' to be 'wall'? - wall front - ( - // inlet block - frontQuad(in1, join1, join2, in2) - // outlet block - frontQuad(poro1, out1, out2, poro2) - ) - - wall back - ( - // inlet block - backQuad(in1, join1, join2, in2) - // outlet block - backQuad(poro1, out1, out2, poro2) - ) - - wall wall - ( - // inlet block - quad2D(in1, join1) - quad2D(join2, in2) - // outlet block - quad2D(poro1, out1) - quad2D(out2, poro2) - ) - - wall porosityWall - ( - // porosity block - frontQuad(join1, poro1, poro2, join2) - // porosity block - backQuad(join1, poro1, poro2, join2) - // porosity block - quad2D(join1, poro1) - quad2D(poro2, join2) - ) - - patch inlet - ( - quad2D(in2, in1) - ) - - patch outlet - ( - quad2D(out2, out1) - ) + front + { + type wall; + faces + ( + // inlet block + frontQuad(in1, join1, join2, in2) + // outlet block + frontQuad(poro1, out1, out2, poro2) + ); + } + + back + { + type wall; + faces + ( + // inlet block + backQuad(in1, join1, join2, in2) + // outlet block + backQuad(poro1, out1, out2, poro2) + ); + } + + wall + { + type wall; + faces + ( + // inlet block + quad2D(in1, join1) + quad2D(join2, in2) + // outlet block + quad2D(poro1, out1) + quad2D(out2, poro2) + ); + } + + porosityWall + { + type wall; + faces + ( + // porosity block + frontQuad(join1, poro1, poro2, join2) + // porosity block + backQuad(join1, poro1, poro2, join2) + // porosity block + quad2D(join1, poro1) + quad2D(poro2, join2) + ); + } + + inlet + { + type patch; + faces + ( + quad2D(in2, in1) + ); + } + + outlet + { + type patch; + faces + ( + quad2D(out2, out1) + ); + } ); mergePatchPairs diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvOptions b/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvOptions index 3cb9357ca0e6344250e3fc9c6ac9961b531c147b..b150d51b8f0bd76a38f2c675609965072624ec03 100644 --- a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvOptions +++ b/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvOptions @@ -18,7 +18,7 @@ FoamFile porosity1 { type explicitPorositySource; - active false; + active true; selectionMode cellZone; cellZone porosity; @@ -28,23 +28,17 @@ porosity1 DarcyForchheimerCoeffs { - d d [0 -2 0 0 0 0 0] (5e5 -1000 -1000); + d d [0 -2 0 0 0 0 0] (7e5 -1000 -1000); f f [0 -1 0 0 0 0 0] (0 0 0); coordinateSystem { - type cartesian; - origin (0 0 0); - coordinateRotation - { - type axesRotation; - e1 (0.70710678 0.70710678 0); - e2 (0 0 1); - } + e1 (0.70710678 0.70710678 0); + e3 (0 0 1); } } } } -//************************************************************************* // +//************************************************************************ // diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvSolution b/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvSolution index 4a126ed8e44ac2adea221069d86969dc2c51456a..3f77479c31016c975eebcee01f6f429602e7746e 100644 --- a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvSolution +++ b/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvSolution @@ -21,14 +21,14 @@ solvers { solver PCG; preconditioner DIC; - tolerance 1e-06; + tolerance 1e-07; relTol 0.01; } pFinal { $p; - tolerance 1e-06; + tolerance 1e-07; relTol 0; } @@ -36,14 +36,14 @@ solvers { solver PBiCG; preconditioner DILU; - tolerance 1e-05; + tolerance 1e-06; relTol 0.1; } "(rho|U|h|k|epsilon|omega)Final" { $U; - tolerance 1e-05; + tolerance 1e-06; relTol 0; } @@ -56,8 +56,8 @@ PIMPLE nOuterCorrectors 50; nCorrectors 1; nNonOrthogonalCorrectors 0; - rhoMin rhoMin [ 1 -3 0 0 0 ] 0.1; - rhoMax rhoMax [ 1 -3 0 0 0 ] 3.0; + rhoMin rhoMin [ 1 -3 0 0 0 ] 0.5; + rhoMax rhoMax [ 1 -3 0 0 0 ] 2.0; residualControl { @@ -75,13 +75,12 @@ relaxationFactors { fields { - "p.*" 1; + "p.*" 0.3; "rho.*" 1; } equations { - "(U|h|k|epsilon|omega).*" 0.85; - "p.*" 1; + "(U|h|k|epsilon|omega).*" 0.7; } } diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSolution b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSolution index a1e310922224d85f5ade01fa361b7ed0e1aeba01..e2bc9c870dd195f36ae69dac774451bf91191614 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSolution +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSolution @@ -64,7 +64,7 @@ SIMPLE { p 1e-2; U 1e-4; - T 1e-3; + e 1e-3; // possibly check turbulence fields "(k|epsilon|omega)" 1e-3; @@ -76,7 +76,7 @@ relaxationFactors fields { p 0.3; - rho 0.05; + rho 0.03; } equations { diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/MRFProperties b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/MRFProperties deleted file mode 100644 index fd749d03963870c76ab4a9d85ad86bd95c33a71f..0000000000000000000000000000000000000000 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/MRFProperties +++ /dev/null @@ -1,20 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object MRFProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// none - -// ************************************************************************* // diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSolution b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSolution index 65a9606e7fb75aadf0be3b521903be30b9f3f193..1fb7a16e855de7f1a5a729571f5fa55b95f7a227 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSolution +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSolution @@ -58,7 +58,7 @@ SIMPLE { p 1e-3; U 1e-4; - T 1e-3; + e 1e-3; // possibly check turbulence fields "(k|epsilon|omega)" 1e-3; diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvOptions b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvOptions index 5aee15c82d46da3cfcdc17d8c67d85374309a25f..43b573b7a90e2e90e0f3d2b85648dbfe00d4f4ba 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvOptions +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvOptions @@ -65,4 +65,4 @@ porosity1 } -//************************************************************************* // +//***************************************************************************// diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSolution b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSolution index a1e310922224d85f5ade01fa361b7ed0e1aeba01..25b10212a3e5bd6efbc0c30f98acf844cae3eb93 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSolution +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSolution @@ -64,7 +64,7 @@ SIMPLE { p 1e-2; U 1e-4; - T 1e-3; + e 1e-3; // possibly check turbulence fields "(k|epsilon|omega)" 1e-3; diff --git a/tutorials/compressible/rhoSimplecFoam/squareBend/system/fvSolution b/tutorials/compressible/rhoSimplecFoam/squareBend/system/fvSolution index 812766041a21bed2e68133a8532c64336f224a37..24db1f2af0146d9f8cad648232676823b748848f 100644 --- a/tutorials/compressible/rhoSimplecFoam/squareBend/system/fvSolution +++ b/tutorials/compressible/rhoSimplecFoam/squareBend/system/fvSolution @@ -54,6 +54,16 @@ SIMPLE rhoMin rhoMin [1 -3 0 0 0] 0.1; rhoMax rhoMax [1 -3 0 0 0] 1.0; transonic yes; + + residualControl + { + p 1e-3; + U 1e-4; + e 1e-3; + + // possibly check turbulence fields + "(k|epsilon|omega)" 1e-3; + } } relaxationFactors diff --git a/tutorials/electromagnetics/electrostaticFoam/chargedWire/system/fvSchemes b/tutorials/electromagnetics/electrostaticFoam/chargedWire/system/fvSchemes index e60b3cbff166383be12aa5b3ad5c4d934c663b2a..7e4087cf142fcda51ec132c51811f9c51d7b2290 100644 --- a/tutorials/electromagnetics/electrostaticFoam/chargedWire/system/fvSchemes +++ b/tutorials/electromagnetics/electrostaticFoam/chargedWire/system/fvSchemes @@ -28,7 +28,7 @@ gradSchemes divSchemes { default none; - div(rhoFlux,rho) Gauss limitedLinear 1; + div(rhoFlux,rho) Gauss upwind; } laplacianSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/fvOptions b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/fvOptions index 00978429d9b793b60ee8a71b46e1991097ba27ff..475ac8e04026f46bd037d6bde5a6ece872345137 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/fvOptions +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/fvOptions @@ -69,7 +69,7 @@ MRF1 { origin (0.25 0.25 0.25); axis (0 0 1); - omega 5.305; // 500 rpm + omega 477.5; // 500 rpm } } diff --git a/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/constant/MRFProperties b/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/constant/MRFProperties deleted file mode 100644 index 623823d3ab9ee5cc818a1b745aa3cc9cceefd2a9..0000000000000000000000000000000000000000 --- a/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/constant/MRFProperties +++ /dev/null @@ -1,31 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object MRFProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -zone1 -{ - cellZone rotor; - active yes; - - // Fixed patches (by default they 'move' with the MRF zone) - nonRotatingPatches (); - - origin (0 0 0); - axis (0 0 1); - omega constant 104.72; -} - -// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/forceCoeffs b/tutorials/incompressible/simpleFoam/motorBike/system/forceCoeffs index c3a066a07f8053cb5dba6f792bb4bc3d4da318b3..7ecdf6047874fcd47b307c4fbd469df4bf7e2bcc 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/forceCoeffs +++ b/tutorials/incompressible/simpleFoam/motorBike/system/forceCoeffs @@ -10,8 +10,7 @@ forceCoeffs1 { type forceCoeffs; functionObjectLibs ( "libforces.so" ); - outputControl timeStep; - outputInterval 1; + outputControl outputTime; log yes; patches ( "motorBike.*" ); diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/constant/reactingCloud1Properties index bcb3e3e80d63667f4ed013fb1be631777cff6e33..b59b42445e9092a2997977b7433fd3d158f968d4 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/constant/reactingCloud1Properties @@ -89,7 +89,7 @@ subModels duration 10.0; parcelsPerSecond 200; } - ] + } dispersionModel none; diff --git a/tutorials/lagrangian/reactingParcelFoam/filter/Allrun b/tutorials/lagrangian/reactingParcelFoam/filter/Allrun index 7db81c26764f11073eff2d532bd2f1c1ba524b88..4bebf16ca7c09519359d95eeb65552e919e5657a 100755 --- a/tutorials/lagrangian/reactingParcelFoam/filter/Allrun +++ b/tutorials/lagrangian/reactingParcelFoam/filter/Allrun @@ -13,7 +13,7 @@ runApplication blockMesh runApplication topoSet # create baffles and fields -createBaffles -overwrite +runApplication createBaffles -overwrite runApplication $application diff --git a/tutorials/lagrangian/reactingParcelFoam/filter/constant/porosityProperties b/tutorials/lagrangian/reactingParcelFoam/filter/constant/porosityProperties deleted file mode 100644 index af10f81b16814de574eab4721350bdd54fa422ef..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/filter/constant/porosityProperties +++ /dev/null @@ -1,44 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object porosityProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -filter1 -{ - cellZone filter; - active true; - type DarcyForchheimer; - - DarcyForchheimerCoeffs - { - d d [0 -2 0 0 0 0 0] (500000 -1000 -1000); - f f [0 -1 0 0 0 0 0] (0 0 0); - - coordinateSystem - { - type cartesian; - origin (0 0 0); - coordinateRotation - { - type axesRotation; - e1 (1 0 0); - e2 (0 1 0); - } - } - } -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/filter/system/fvOptions b/tutorials/lagrangian/reactingParcelFoam/filter/system/fvOptions index c7dd4992aa7e4c03c46cff585984fe7162ecde89..a6fa8898ba577ffbd6af1c575adf5d43f08ac45c 100644 --- a/tutorials/lagrangian/reactingParcelFoam/filter/system/fvOptions +++ b/tutorials/lagrangian/reactingParcelFoam/filter/system/fvOptions @@ -15,6 +15,32 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +filter1 +{ + type explicitPorositySource; + selectionMode cellZone; + cellZone filter; + active true; + + explicitPorositySourceCoeffs + { + type DarcyForchheimer; + + DarcyForchheimerCoeffs + { + d d [0 -2 0 0 0 0 0] (500000 -1000 -1000); + f f [0 -1 0 0 0 0 0] (0 0 0); + + coordinateSystem + { + e1 (1 0 0); + e2 (0 1 0); + } + } + } +} + + massSource1 { type scalarSemiImplicitSource; diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle/0/k b/tutorials/multiphase/cavitatingFoam/les/throttle/0/k index b8e8e662f88b1198baf6581d758d88e99e8ad9ad..25ca30f1e13f1092112b38fef9f1bcabad7533b5 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle/0/k +++ b/tutorials/multiphase/cavitatingFoam/les/throttle/0/k @@ -10,36 +10,37 @@ FoamFile version 2.0; format ascii; class volScalarField; + location "0"; object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 2 -2 0 0]; +dimensions [0 2 -2 0 0 0 0]; -internalField uniform 10.0; +internalField uniform 10; boundaryField { inlet { - type fixedValue; - value uniform 0.5; + type turbulentIntensityKineticEnergyInlet; + intensity 0.05; + value uniform 0.05; } - outlet { type zeroGradient; } - walls { - type zeroGradient; + type kqRWallFunction; + value uniform 10; } - frontBack { type empty; } } + // ************************************************************************* // diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle/0/nuSgs b/tutorials/multiphase/cavitatingFoam/les/throttle/0/nuSgs index d23afe73b472f4ac467a2fdac84f7f3073f17536..6d4b26abea7615f2413b0fad7d4956782bccc968 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle/0/nuSgs +++ b/tutorials/multiphase/cavitatingFoam/les/throttle/0/nuSgs @@ -10,27 +10,30 @@ FoamFile version 2.0; format ascii; class volScalarField; + location "0"; object nuSgs; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; -internalField uniform 1e-11; +internalField uniform 0; boundaryField { inlet { - type zeroGradient; + type calculated; + value uniform 0; } outlet { - type zeroGradient; + type calculated; + value uniform 0; } walls { - type fixedValue; + type nutUSpaldingWallFunction; value uniform 0; } frontBack @@ -39,4 +42,5 @@ boundaryField } } + // ************************************************************************* // diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle/system/fvSchemes b/tutorials/multiphase/cavitatingFoam/les/throttle/system/fvSchemes index 3d506aa1d7f2e631efb8635916edcd7f8dcc0ab1..08a4e20e6b535bf4f6e40aa4a780238af6bbec17 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle/system/fvSchemes +++ b/tutorials/multiphase/cavitatingFoam/les/throttle/system/fvSchemes @@ -28,9 +28,9 @@ interpolationSchemes divSchemes { default none; - div(phiv,rho) Gauss limitedLinear 0.2; - div(phi,U) Gauss filteredLinear2V 0.2 0; - div(phiv,k) Gauss filteredLinear2 0.2 0; + div(phiv,rho) Gauss vanLeer; + div(phi,U) Gauss LUST grad(U); + div(phiv,k) Gauss LUST grad(k); div((muEff*dev(T(grad(U))))) Gauss linear; } diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/0.org/k b/tutorials/multiphase/cavitatingFoam/les/throttle3D/0.org/k index 567bb997b9e99779c99732cfd88010ca19678ac4..9df6a831bf7d92eee132130ce0f14958784163a5 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle3D/0.org/k +++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/0.org/k @@ -16,14 +16,15 @@ FoamFile dimensions [0 2 -2 0 0]; -internalField uniform 10.0; +internalField uniform 10; boundaryField { inlet { - type fixedValue; - value uniform 0.5; + type turbulentIntensityKineticEnergyInlet; + intensity 0.05; + value uniform 0.05; } outlet @@ -33,7 +34,8 @@ boundaryField walls { - type zeroGradient; + type kqRWallFunction; + value uniform 10; } frontBack diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/0.org/nuSgs b/tutorials/multiphase/cavitatingFoam/les/throttle3D/0.org/nuSgs index 87011efb061f19f0e45da082b0855543320704b9..c4d32cf2ff7d6597b53e84048a1078b387fa7df9 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle3D/0.org/nuSgs +++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/0.org/nuSgs @@ -10,34 +10,38 @@ FoamFile version 2.0; format ascii; class volScalarField; + location "0"; object nuSgs; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; -internalField uniform 1e-11; +internalField uniform 0; boundaryField { inlet { - type zeroGradient; + type calculated; + value uniform 0; } outlet { - type zeroGradient; + type calculated; + value uniform 0; } walls { - type fixedValue; + type nutUSpaldingWallFunction; value uniform 0; } frontBack { - type fixedValue; + type nutUSpaldingWallFunction; value uniform 0; } } + // ************************************************************************* // diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/0/k b/tutorials/multiphase/cavitatingFoam/les/throttle3D/0/k index 567bb997b9e99779c99732cfd88010ca19678ac4..9df6a831bf7d92eee132130ce0f14958784163a5 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle3D/0/k +++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/0/k @@ -16,14 +16,15 @@ FoamFile dimensions [0 2 -2 0 0]; -internalField uniform 10.0; +internalField uniform 10; boundaryField { inlet { - type fixedValue; - value uniform 0.5; + type turbulentIntensityKineticEnergyInlet; + intensity 0.05; + value uniform 0.05; } outlet @@ -33,7 +34,8 @@ boundaryField walls { - type zeroGradient; + type kqRWallFunction; + value uniform 10; } frontBack diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/0/nuSgs b/tutorials/multiphase/cavitatingFoam/les/throttle3D/0/nuSgs index 87011efb061f19f0e45da082b0855543320704b9..c4d32cf2ff7d6597b53e84048a1078b387fa7df9 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle3D/0/nuSgs +++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/0/nuSgs @@ -10,34 +10,38 @@ FoamFile version 2.0; format ascii; class volScalarField; + location "0"; object nuSgs; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; -internalField uniform 1e-11; +internalField uniform 0; boundaryField { inlet { - type zeroGradient; + type calculated; + value uniform 0; } outlet { - type zeroGradient; + type calculated; + value uniform 0; } walls { - type fixedValue; + type nutUSpaldingWallFunction; value uniform 0; } frontBack { - type fixedValue; + type nutUSpaldingWallFunction; value uniform 0; } } + // ************************************************************************* // diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/Allrun b/tutorials/multiphase/cavitatingFoam/les/throttle3D/Allrun index 4314556cfc66040c96b55dda75e40488d46144d9..91c8379fa0ffbbbb49b45c91c10604864057f1ff 100755 --- a/tutorials/multiphase/cavitatingFoam/les/throttle3D/Allrun +++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/Allrun @@ -29,8 +29,8 @@ cp -r 0.org 0 runApplication blockMesh refineMeshByCellSet 1 2 3 -echo "mapping fields from 2D throttle case" -runApplication mapFields ../throttle -sourceTime latestTime +#echo "mapping fields from 2D throttle case" +#runApplication mapFields ../throttle -sourceTime latestTime runApplication decomposePar runParallel $application 4 diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/fvSchemes b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/fvSchemes index 3d506aa1d7f2e631efb8635916edcd7f8dcc0ab1..08a4e20e6b535bf4f6e40aa4a780238af6bbec17 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/fvSchemes +++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/fvSchemes @@ -28,9 +28,9 @@ interpolationSchemes divSchemes { default none; - div(phiv,rho) Gauss limitedLinear 0.2; - div(phi,U) Gauss filteredLinear2V 0.2 0; - div(phiv,k) Gauss filteredLinear2 0.2 0; + div(phiv,rho) Gauss vanLeer; + div(phi,U) Gauss LUST grad(U); + div(phiv,k) Gauss LUST grad(k); div((muEff*dev(T(grad(U))))) Gauss linear; } diff --git a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/U b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/U index 668d7aba83aea43be5856d2d1b1f17c16bc946f2..a9f5e35e969c3fa46e9af0fb5fdfc30dc61198aa 100644 --- a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/U +++ b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/U @@ -41,6 +41,10 @@ boundaryField type pressureInletOutletVelocity; value uniform (0 0 0); } + defaultFaces + { + type empty; + } porous_half0 { type cyclic; @@ -49,10 +53,6 @@ boundaryField { type cyclic; } - defaultFaces - { - type empty; - } } diff --git a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/alpha1 b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/alpha1 index 6e0ae20fd8fd38dab56c824a87642acadfa018b0..bf6106677fc7d27dc3791d3ab7196a30e9a2c411 100644 --- a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/alpha1 +++ b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/alpha1 @@ -39,6 +39,10 @@ boundaryField inletValue uniform 0; value uniform 0; } + defaultFaces + { + type empty; + } porous_half0 { type cyclic; @@ -47,10 +51,6 @@ boundaryField { type cyclic; } - defaultFaces - { - type empty; - } } diff --git a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/alpha1.org b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/alpha1.org index 6e0ae20fd8fd38dab56c824a87642acadfa018b0..bf6106677fc7d27dc3791d3ab7196a30e9a2c411 100644 --- a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/alpha1.org +++ b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/alpha1.org @@ -39,6 +39,10 @@ boundaryField inletValue uniform 0; value uniform 0; } + defaultFaces + { + type empty; + } porous_half0 { type cyclic; @@ -47,10 +51,6 @@ boundaryField { type cyclic; } - defaultFaces - { - type empty; - } } diff --git a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/epsilon b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/epsilon index 6a39556a33feb3ded4336046ab48296744df9e67..e8f209f7c1ce1b7aacde6163358e2be901e1d96d 100644 --- a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/epsilon +++ b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/epsilon @@ -24,16 +24,25 @@ boundaryField leftWall { type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; value uniform 0.1; } rightWall { type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; value uniform 0.1; } lowerWall { type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; value uniform 0.1; } atmosphere @@ -42,6 +51,10 @@ boundaryField inletValue uniform 0.1; value uniform 0.1; } + defaultFaces + { + type empty; + } porous_half0 { type cyclic; @@ -50,10 +63,6 @@ boundaryField { type cyclic; } - defaultFaces - { - type empty; - } } diff --git a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/k b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/k index b41cfbed79ce11215fd2a8a0e46db2b7c672294c..dc8fe2b2d099d7d83a2af62cf2875edd0e5899cc 100644 --- a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/k +++ b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/k @@ -42,6 +42,10 @@ boundaryField inletValue uniform 0.1; value uniform 0.1; } + defaultFaces + { + type empty; + } porous_half0 { type cyclic; @@ -50,10 +54,6 @@ boundaryField { type cyclic; } - defaultFaces - { - type empty; - } } diff --git a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/nuTilda b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/nuTilda index f5c21a8e5af8425613988b61e1a62c9e20a92337..ad8366577c71dc04da878ee639ba0d52b0fb14a9 100644 --- a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/nuTilda +++ b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/nuTilda @@ -39,6 +39,10 @@ boundaryField inletValue uniform 0; value uniform 0; } + defaultFaces + { + type empty; + } porous_half0 { type cyclic; @@ -47,10 +51,6 @@ boundaryField { type cyclic; } - defaultFaces - { - type empty; - } } diff --git a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/nut b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/nut index bc57ae2a976bbc40492b22a15c8aa31e1680b7da..53aeee97bf16b8de171f1eff4422b10b1a94095a 100644 --- a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/nut +++ b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/nut @@ -24,16 +24,25 @@ boundaryField leftWall { type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; value uniform 0; } rightWall { type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; value uniform 0; } lowerWall { type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; value uniform 0; } atmosphere @@ -41,6 +50,10 @@ boundaryField type calculated; value uniform 0; } + defaultFaces + { + type empty; + } porous_half0 { type cyclic; @@ -49,10 +62,6 @@ boundaryField { type cyclic; } - defaultFaces - { - type empty; - } } diff --git a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/p_rgh b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/p_rgh index c085da2cb601d8fefbe9daf36bd3be31cf44688d..cb36fb3b7dfaedd6e882b4e2afe3e553bb0955df 100644 --- a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/p_rgh +++ b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/p_rgh @@ -25,19 +25,16 @@ boundaryField { type fixedFluxPressure; gradient uniform 0; - value uniform 0; } rightWall { type fixedFluxPressure; gradient uniform 0; - value uniform 0; } lowerWall { type fixedFluxPressure; gradient uniform 0; - value uniform 0; } atmosphere { @@ -48,29 +45,28 @@ boundaryField p0 uniform 0; value uniform 0; } + defaultFaces + { + type empty; + } porous_half0 { type porousBafflePressure; patchType cyclic; jump uniform 0; + value uniform 0; D 700; I 500; length 1.05; - value uniform 0; } porous_half1 { type porousBafflePressure; patchType cyclic; - jump uniform 0; + value uniform 0; D 700; I 500; length 1.05; - value uniform 0; - } - defaultFaces - { - type empty; } } diff --git a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/constant/polyMesh/boundary b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/constant/polyMesh/boundary new file mode 100644 index 0000000000000000000000000000000000000000..49282f81f06ff1afeface41c55ac7aedfadccc14 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/constant/polyMesh/boundary @@ -0,0 +1,73 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +7 +( + leftWall + { + type wall; + nFaces 50; + startFace 4419; + } + rightWall + { + type wall; + nFaces 50; + startFace 4469; + } + lowerWall + { + type wall; + nFaces 62; + startFace 4519; + } + atmosphere + { + type patch; + nFaces 46; + startFace 4581; + } + defaultFaces + { + type empty; + inGroups 1(empty); + nFaces 4536; + startFace 4627; + } + porous_half0 + { + type cyclic; + inGroups 1(cyclic); + nFaces 13; + startFace 9163; + matchTolerance 0.0001; + transform unknown; + neighbourPatch porous_half1; + } + porous_half1 + { + type cyclic; + inGroups 1(cyclic); + nFaces 13; + startFace 9176; + matchTolerance 0.0001; + transform unknown; + neighbourPatch porous_half0; + } +) + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/system/createBafflesDict b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/system/createBafflesDict index c127ff67d25c8e2175277ec631ffa86c6f6f7730..46e0c66bf817f5a8ee41f406537d8e130e9ad627 100644 --- a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/system/createBafflesDict +++ b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/system/createBafflesDict @@ -65,7 +65,10 @@ baffles type cyclic; neighbourPatch porous_half0; - ${..master.patchFields} + patchFields + { + ${...master.patchFields} + } } } } diff --git a/tutorials/multiphase/settlingFoam/ras/dahl/system/controlDict b/tutorials/multiphase/settlingFoam/ras/dahl/system/controlDict index 6c824638638ac93677155e8c851d30e944a6cae7..63da42914cee299300a6090a251e8acef3930129 100644 --- a/tutorials/multiphase/settlingFoam/ras/dahl/system/controlDict +++ b/tutorials/multiphase/settlingFoam/ras/dahl/system/controlDict @@ -17,7 +17,7 @@ FoamFile application settlingFoam; -startFrom startTime; +startFrom latestTime; startTime 0; @@ -47,7 +47,7 @@ runTimeModifiable yes; adjustTimeStep on; -maxCo 0.5; +maxCo 0.4; maxDeltaT 1;