diff --git a/ReleaseNotes-dev b/ReleaseNotes-dev index 8daf5ef6f4..b49004337d 100644 --- a/ReleaseNotes-dev +++ b/ReleaseNotes-dev @@ -105,7 +105,15 @@ + Additional wall functions for primary region momentum and temperature taking film into account + Parallel aware -*** *New* ptscotch decomposition method +*** *New* ptscotch decomposition method. +*** *New* multiLevel decomposition method. + Decomposes in levels, e.g. first decompose onto number of nodes and + then onto number of cores per node. This will minimise off-node + communication. Each level can use any of the other decomposition methods +*** *New* structured decomposition method. + Does a 2D decomposition of a mesh. Valid only for an 'extruded' mesh, i.e. + columns of cells originating from a patch. Bases decomposition on this + patch and assigns the cells according to the patch decomposition. *** *Updated* scotch decomposition method to run in parallel by doing decomposition on the master. Unfortunately scotch and ptscotch cannot be linked in to the same executable. @@ -212,7 +220,8 @@ } #+END_SRC See also [[./doc/changes/dynamicCode.org]] - + + cyclicSlip: cyclic with point motion constrained to tangential plane. + Can be used with any mesh movement, e.g. snapping in snappyHexMesh. * Utilities There have been some utilities added and updated in this release. *** *New* utilities @@ -229,7 +238,8 @@ (nonuniformTransform)cyclic _ + extrudes into master direction (i.e. away from the owner cell if flipMap is false) - + =topoSet=: replacement of cellSet,faceSet,pointSet utilities. + + =topoSet=: replacement of cellSet,faceSet,pointSet utilities. Multiple + commands operating on different sets. Comparable to a dictionary driven =setSet= utility. *** Updated utilities + =setFields=: optionally use faceSets to set patch values (see @@ -244,6 +254,8 @@ - works in parallel + =snappyHexMesh=: + extrude across multi-processor boundaries + + specify type of patches created during meshing + + handle cyclics in initial mesh (non parallel meshing only) + preserve faceZones shape during layering + combining coincident patch faces is now default after snapping + *Warning*: diff --git a/applications/solvers/combustion/fireFoam/Make/files b/applications/solvers/combustion/fireFoam/Make/files index 826d736bd0..2d50e5e765 100644 --- a/applications/solvers/combustion/fireFoam/Make/files +++ b/applications/solvers/combustion/fireFoam/Make/files @@ -1,4 +1,3 @@ fireFoam.C EXE = $(FOAM_APPBIN)/fireFoam - diff --git a/applications/solvers/combustion/fireFoam/Make/options b/applications/solvers/combustion/fireFoam/Make/options index 045e37a344..cf5b4b0976 100644 --- a/applications/solvers/combustion/fireFoam/Make/options +++ b/applications/solvers/combustion/fireFoam/Make/options @@ -1,20 +1,52 @@ EXE_INC = \ - -I./combustionModels/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I${LIB_SRC}/meshTools/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ - -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude + -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solid/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solidChemistryModel/lnInclude \ + -I$(LIB_SRC)/combustionModels/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ + -I$(LIB_SRC)/combustionModels/lnInclude \ + -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ + -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ + -I$(LIB_SRC)/regionModels/pyrolysisModels/lnInclude \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ + -I$(LIB_SRC)/ODE/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ - -lcombustionModels \ - -lspecie \ - -lreactionThermophysicalModels \ - -lbasicThermophysicalModels \ -lfiniteVolume \ - -lcompressibleTurbulenceModel \ - -lcompressibleLESModels \ + -lmeshTools \ -lcompressibleRASModels \ - -lradiationModels + -lcompressibleLESModels \ + -lspecie \ + -lbasicThermophysicalModels \ + -lsolidProperties \ + -lsolidMixtureProperties \ + -lthermophysicalFunctions \ + -lreactionThermophysicalModels \ + -lSLGThermo \ + -lchemistryModel \ + -lsolidChemistryModel \ + -lcombustionModels \ + -lregionModels \ + -lradiationModels \ + -lsurfaceFilmModels \ + -lpyrolysisModels \ + -llagrangianIntermediate \ + -lODE \ + -lsampling diff --git a/applications/solvers/combustion/fireFoam/UEqn.H b/applications/solvers/combustion/fireFoam/UEqn.H index a77c262831..a64e50a2d2 100644 --- a/applications/solvers/combustion/fireFoam/UEqn.H +++ b/applications/solvers/combustion/fireFoam/UEqn.H @@ -1,21 +1,26 @@ -fvVectorMatrix UEqn -( - fvm::ddt(rho, U) - + fvm::div(phi, U) - + turbulence->divDevRhoReff(U) -); - -UEqn.relax(); - -solve -( - UEqn - == - fvc::reconstruct + fvVectorMatrix UEqn ( + fvm::ddt(rho, U) + + fvm::div(phi, U) + + turbulence->divDevRhoReff(U) + == + parcels.SU(U) + ); + + UEqn.relax(); + + if (pimple.momentumPredictor()) + { + solve ( - - ghf*fvc::snGrad(rho) - - fvc::snGrad(p_rgh) - )*mesh.magSf() - ) -); + UEqn + == + fvc::reconstruct + ( + ( + - ghf*fvc::snGrad(rho) + - fvc::snGrad(p_rgh) + )*mesh.magSf() + ) + ); + } diff --git a/applications/solvers/combustion/fireFoam/YhsEqn.H b/applications/solvers/combustion/fireFoam/YhsEqn.H new file mode 100644 index 0000000000..aed41a4431 --- /dev/null +++ b/applications/solvers/combustion/fireFoam/YhsEqn.H @@ -0,0 +1,70 @@ +tmp > mvConvection +( + fv::convectionScheme::New + ( + mesh, + fields, + phi, + mesh.divScheme("div(phi,Yi_hs)") + ) +); +{ + radiation->correct(); + combustion->correct(); + dQ = combustion->dQ(); + label inertIndex = -1; + volScalarField Yt(0.0*Y[0]); + + forAll(Y, i) + { + if (Y[i].name() != inertSpecie) + { + volScalarField& Yi = Y[i]; + fvScalarMatrix R(combustion->R(Yi)); + + fvScalarMatrix YiEqn + ( + fvm::ddt(rho, Yi) + + mvConvection->fvmDiv(phi, Yi) + - fvm::laplacian(turbulence->alphaEff(), Yi) + == + parcels.SYi(i, Yi) + + surfaceFilm.Srho(i) + + R + ); + + YiEqn.relax(); + YiEqn.solve(mesh.solver("Yi")); + + Yi.max(0.0); + Yt += Yi; + } + else + { + inertIndex = i; + } + } + + Y[inertIndex] = scalar(1) - Yt; + Y[inertIndex].max(0.0); + + fvScalarMatrix hsEqn + ( + fvm::ddt(rho, hs) + + mvConvection->fvmDiv(phi, hs) + - fvm::laplacian(turbulence->alphaEff(), hs) + == + DpDt + + dQ + + radiation->Shs(thermo) + + parcels.Sh(hs) + + surfaceFilm.Sh() + ); + + hsEqn.relax(); + hsEqn.solve(); + + thermo.correct(); + + Info<< "min/max(T) = " << min(T).value() << ", " << max(T).value() << endl; +} diff --git a/applications/solvers/combustion/fireFoam/createClouds.H b/applications/solvers/combustion/fireFoam/createClouds.H new file mode 100644 index 0000000000..c568be12a1 --- /dev/null +++ b/applications/solvers/combustion/fireFoam/createClouds.H @@ -0,0 +1,9 @@ +Info<< "\nConstructing reacting cloud" << endl; +basicReactingCloud parcels +( + "reactingCloud1", + rho, + U, + g, + slgThermo +); diff --git a/applications/solvers/combustion/fireFoam/createFields.H b/applications/solvers/combustion/fireFoam/createFields.H index 73686c5668..f1e152dc32 100644 --- a/applications/solvers/combustion/fireFoam/createFields.H +++ b/applications/solvers/combustion/fireFoam/createFields.H @@ -1,147 +1,154 @@ -Info<< "Reading thermophysical properties\n" << endl; + Info<< "Reading thermophysical properties\n" << endl; -autoPtr pThermo -( - hsCombustionThermo::New(mesh) -); - -hsCombustionThermo& thermo = pThermo(); - -basicMultiComponentMixture& composition = thermo.composition(); - -volScalarField rho -( - IOobject + autoPtr pThermo ( - "rho", - runTime.timeName(), + hsCombustionThermo::New(mesh) + ); + hsCombustionThermo& thermo = pThermo(); + + SLGThermo slgThermo(mesh, thermo); + + basicMultiComponentMixture& composition = thermo.composition(); + PtrList& Y = composition.Y(); + + const word inertSpecie(thermo.lookup("inertSpecie")); + + Info<< "Creating field rho\n" << endl; + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + thermo.rho() + ); + + volScalarField& p = thermo.p(); + volScalarField& hs = thermo.hs(); + const volScalarField& T = thermo.T(); + const volScalarField& psi = thermo.psi(); + + Info<< "\nReading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + #include "compressibleCreatePhi.H" + + Info<< "Creating turbulence model\n" << endl; + autoPtr turbulence + ( + compressible::turbulenceModel::New + ( + rho, + U, + phi, + thermo + ) + ); + + IOdictionary combustionProperties + ( + IOobject + ( + "combustionProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE + ) + ); + + Info<< "Creating combustion model\n" << endl; + autoPtr combustion + ( + combustionModel::combustionModel::New + ( + combustionProperties, + thermo, + turbulence(), + phi, + rho + ) + ); + + volScalarField dQ + ( + IOobject + ( + "dQ", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - thermo.rho() -); + dimensionedScalar("dQ", dimMass/pow3(dimTime)/dimLength, 0.0) + ); -dimensionedScalar stoicRatio -( - thermo.lookup("stoichiometricAirFuelMassRatio") -); - -volScalarField& p = thermo.p(); -volScalarField& hs = thermo.hs(); - -const volScalarField& psi = thermo.psi(); - -volScalarField& ft = composition.Y("ft"); -volScalarField& fu = composition.Y("fu"); - - -Info<< "Reading field U\n" << endl; - -volVectorField U -( - IOobject + Info<< "Creating field DpDt\n" << endl; + volScalarField DpDt ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh -); + "DpDt", + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) + ); -#include "compressibleCreatePhi.H" -Info<< "Creating turbulence model\n" << endl; -autoPtr turbulence -( - compressible::turbulenceModel::New(rho, U, phi, thermo) -); + Info<< "Calculating field g.h\n" << endl; + volScalarField gh("gh", g & mesh.C()); -IOdictionary combustionProperties -( - IOobject + surfaceScalarField ghf("ghf", g & mesh.Cf()); + + volScalarField p_rgh ( - "combustionProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) -); + IOobject + ( + "p_rgh", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); -Info<< "Creating combustion model\n" << endl; -autoPtr combustion -( - combustionModel::combustionModel::New + // Force p_rgh to be consistent with p + p_rgh = p - rho*gh; + + multivariateSurfaceInterpolationScheme::fieldTable fields; + + forAll(Y, i) + { + fields.add(Y[i]); + } + fields.add(hs); + + IOdictionary additionalControlsDict ( - combustionProperties, - thermo, - turbulence(), - phi, - rho - ) -); + IOobject + ( + "additionalControls", + runTime.constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE + ) + ); - -Info<< "Calculating field g.h\n" << endl; -volScalarField gh("gh", g & mesh.C()); -surfaceScalarField ghf("gh", g & mesh.Cf()); - -Info<< "Reading field p_rgh\n" << endl; -volScalarField p_rgh -( - IOobject + Switch solvePrimaryRegion ( - "p_rgh", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh -); - -// Force p_rgh to be consistent with p -p_rgh = p - rho*gh; - - -volScalarField dQ -( - IOobject - ( - "dQ", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - mesh, - dimensionedScalar("dQ", dimMass/pow3(dimTime)/dimLength, 0.0) -); - - -Info<< "Creating field DpDt\n" << endl; -volScalarField DpDt -( - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) -); - - -dimensionedScalar initialMass = fvc::domainIntegrate(rho); - - -multivariateSurfaceInterpolationScheme::fieldTable fields; - -if (composition.contains("ft")) -{ - fields.add(composition.Y("ft")); -} - -if (composition.contains("fu")) -{ - fields.add(composition.Y("fu")); -} - -fields.add(hs); + additionalControlsDict.lookup("solvePrimaryRegion") + ); diff --git a/applications/solvers/combustion/fireFoam/createPyrolysisModel.H b/applications/solvers/combustion/fireFoam/createPyrolysisModel.H new file mode 100644 index 0000000000..e5b8d4e457 --- /dev/null +++ b/applications/solvers/combustion/fireFoam/createPyrolysisModel.H @@ -0,0 +1,6 @@ +Info<< "Creating pyrolysis model" << endl; + +autoPtr pyrolysis +( + regionModels::pyrolysisModels::pyrolysisModel::New(mesh) +); diff --git a/applications/solvers/combustion/fireFoam/createSurfaceFilmModel.H b/applications/solvers/combustion/fireFoam/createSurfaceFilmModel.H new file mode 100644 index 0000000000..8ddcc77a5f --- /dev/null +++ b/applications/solvers/combustion/fireFoam/createSurfaceFilmModel.H @@ -0,0 +1,6 @@ +Info<< "\nConstructing surface film model" << endl; + +typedef regionModels::surfaceFilmModels::surfaceFilmModel filmModelType; + +autoPtr tsurfaceFilm(filmModelType::New(mesh, g)); +filmModelType& surfaceFilm = tsurfaceFilm(); diff --git a/applications/solvers/combustion/fireFoam/fireFoam.C b/applications/solvers/combustion/fireFoam/fireFoam.C index a517eccde1..7c58a722d1 100644 --- a/applications/solvers/combustion/fireFoam/fireFoam.C +++ b/applications/solvers/combustion/fireFoam/fireFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,15 +25,22 @@ Application fireFoam Description - Transient Solver for Fires and turbulent diffusion flames + Transient PIMPLE solver for Fires and turbulent diffusion flames with + reacting Lagrangian parcels, surface film and pyrolysis modelling. \*---------------------------------------------------------------------------*/ +#include "mapDistribute.H" #include "fvCFD.H" -#include "hsCombustionThermo.H" #include "turbulenceModel.H" -#include "combustionModel.H" +#include "basicReactingCloud.H" +#include "surfaceFilmModel.H" +#include "pyrolysisModel.H" #include "radiationModel.H" +#include "SLGThermo.H" +#include "hsCombustionThermo.H" +#include "solidChemistryModel.H" +#include "combustionModel.H" #include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -41,19 +48,25 @@ Description int main(int argc, char *argv[]) { #include "setRootCase.H" + #include "createTime.H" #include "createMesh.H" + #include "readChemistryProperties.H" #include "readGravitationalAcceleration.H" - #include "initContinuityErrs.H" #include "createFields.H" + #include "createClouds.H" + #include "createSurfaceFilmModel.H" + #include "createPyrolysisModel.H" #include "createRadiationModel.H" + #include "initContinuityErrs.H" #include "readTimeControls.H" #include "compressibleCourantNo.H" #include "setInitialDeltaT.H" + #include "readPyrolysisTimeControls.H" pimpleControl pimple(mesh); - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -61,46 +74,56 @@ int main(int argc, char *argv[]) { #include "readTimeControls.H" #include "compressibleCourantNo.H" + #include "solidRegionDiffusionNo.H" + #include "setMultiRegionDeltaT.H" #include "setDeltaT.H" runTime++; + Info<< "Time = " << runTime.timeName() << nl << endl; - #include "rhoEqn.H" + parcels.evolve(); - // --- Pressure-velocity PIMPLE corrector loop - for (pimple.start(); pimple.loop(); pimple++) + surfaceFilm.evolve(); + + pyrolysis->evolve(); + + if (solvePrimaryRegion) { - #include "UEqn.H" + #include "rhoEqn.H" - #include "ftEqn.H" - #include "fuhsEqn.H" - - // --- PISO loop - for (int corr=0; corrcorrect(); + } } - if (pimple.turbCorr()) - { - turbulence->correct(); - } + rho = thermo.rho(); } - rho = thermo.rho(); - runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; - } - Info<< "End\n" << endl; + Info<< "End" << endl; - return 0; + return(0); } + // ************************************************************************* // diff --git a/applications/solvers/combustion/fireFoam/ftEqn.H b/applications/solvers/combustion/fireFoam/ftEqn.H deleted file mode 100644 index 57406da753..0000000000 --- a/applications/solvers/combustion/fireFoam/ftEqn.H +++ /dev/null @@ -1,25 +0,0 @@ -tmp > mvConvection -( - fv::convectionScheme::New - ( - mesh, - fields, - phi, - mesh.divScheme("div(phi,ft_b_h)") - ) -); - -{ - fvScalarMatrix ftEqn - ( - fvm::ddt(rho, ft) - + mvConvection->fvmDiv(phi, ft) - - fvm::laplacian(turbulence->alphaEff(), ft) - ); - - ftEqn.relax(); - ftEqn.solve(); -} - -Info<< "max(ft) = " << max(ft).value() << endl; -Info<< "min(ft) = " << min(ft).value() << endl; diff --git a/applications/solvers/combustion/fireFoam/fuhsEqn.H b/applications/solvers/combustion/fireFoam/fuhsEqn.H deleted file mode 100644 index 6494ead4f4..0000000000 --- a/applications/solvers/combustion/fireFoam/fuhsEqn.H +++ /dev/null @@ -1,47 +0,0 @@ -{ - // Solve fuel equation - // ~~~~~~~~~~~~~~~~~~~ - fvScalarMatrix R(combustion->R(fu)); - - { - fvScalarMatrix fuEqn - ( - fvm::ddt(rho, fu) - + mvConvection->fvmDiv(phi, fu) - - fvm::laplacian(turbulence->alphaEff(), fu) - == - R - ); - - fuEqn.relax(); - fuEqn.solve(); - } - - Info<< "max(fu) = " << max(fu).value() << endl; - Info<< "min(fu) = " << min(fu).value() << endl; - - - // Solve sensible enthalpy equation - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - radiation->correct(); - dQ = combustion->dQ(R); - - { - fvScalarMatrix hsEqn - ( - fvm::ddt(rho, hs) - + mvConvection->fvmDiv(phi,hs) - - fvm::laplacian(turbulence->alphaEff(), hs) - == - DpDt - + dQ - + radiation->Shs(thermo) - ); - - hsEqn.relax(); - hsEqn.solve(); - } - - thermo.correct(); - combustion->correct(); -} diff --git a/applications/solvers/combustion/fireFoam/pEqn.H b/applications/solvers/combustion/fireFoam/pEqn.H index 6813950e19..5c7a4ae33e 100644 --- a/applications/solvers/combustion/fireFoam/pEqn.H +++ b/applications/solvers/combustion/fireFoam/pEqn.H @@ -1,7 +1,7 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); -surfaceScalarField rhorAUf("(rho*(1|A(U)))", fvc::interpolate(rho*rAU)); +surfaceScalarField rhorAUf(rAU.name() + 'f', fvc::interpolate(rho*rAU)); U = rAU*UEqn.H(); surfaceScalarField phiU @@ -17,13 +17,15 @@ phi = phiU - rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf(); for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) { - surfaceScalarField rhorAUf(fvc::interpolate(rho*rAU)); - fvScalarMatrix p_rghEqn ( - fvm::ddt(psi, p_rgh) + fvc::ddt(psi, rho)*gh + fvc::ddt(psi, rho)*gh + fvc::div(phi) + + fvm::ddt(psi, p_rgh) - fvm::laplacian(rhorAUf, p_rgh) + == + parcels.Srho() + + surfaceFilm.Srho() ); p_rghEqn.solve diff --git a/applications/solvers/combustion/fireFoam/readChemistryProperties.H b/applications/solvers/combustion/fireFoam/readChemistryProperties.H new file mode 100644 index 0000000000..f0bcf7597f --- /dev/null +++ b/applications/solvers/combustion/fireFoam/readChemistryProperties.H @@ -0,0 +1,23 @@ +Info<< "Reading chemistry properties\n" << endl; + +IOdictionary chemistryProperties +( + IOobject + ( + "chemistryProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false + ) +); + +Switch turbulentReaction(chemistryProperties.lookup("turbulentReaction")); + +dimensionedScalar Cmix("Cmix", dimless, 1.0); + +if (turbulentReaction) +{ + chemistryProperties.lookup("Cmix") >> Cmix; +} diff --git a/applications/solvers/combustion/fireFoam/readPyrolysisTimeControls.H b/applications/solvers/combustion/fireFoam/readPyrolysisTimeControls.H new file mode 100644 index 0000000000..1fd0ce382c --- /dev/null +++ b/applications/solvers/combustion/fireFoam/readPyrolysisTimeControls.H @@ -0,0 +1,34 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 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 . + +Global + readPyrolysisTimeControls + +Description + + +\*---------------------------------------------------------------------------*/ + +scalar maxDi = pyrolysis->maxDiff(); + +// ************************************************************************* // diff --git a/applications/solvers/combustion/fireFoam/rhoEqn.H b/applications/solvers/combustion/fireFoam/rhoEqn.H new file mode 100644 index 0000000000..c37162df42 --- /dev/null +++ b/applications/solvers/combustion/fireFoam/rhoEqn.H @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 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 . + +Global + rhoEqn + +Description + Solve the continuity for density. + +\*---------------------------------------------------------------------------*/ + +{ + solve + ( + fvm::ddt(rho) + + fvc::div(phi) + == + parcels.Srho(rho) + + surfaceFilm.Srho() + ); +} + +// ************************************************************************* // diff --git a/applications/solvers/combustion/fireFoam/setMultiRegionDeltaT.H b/applications/solvers/combustion/fireFoam/setMultiRegionDeltaT.H new file mode 100644 index 0000000000..6c5a6a7215 --- /dev/null +++ b/applications/solvers/combustion/fireFoam/setMultiRegionDeltaT.H @@ -0,0 +1,64 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 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 . + +Global + setMultiRegionDeltaT + +Description + Reset the timestep to maintain a constant maximum Courant numbers. + Reduction of time-step is immediate, but increase is damped to avoid + unstable oscillations. + +\*---------------------------------------------------------------------------*/ + +if (adjustTimeStep) +{ + if (CoNum == -GREAT) + { + CoNum = SMALL; + } + + if (DiNum == -GREAT) + { + DiNum = SMALL; + } + + + const scalar TFactorFluid = maxCo/(CoNum + SMALL); + const scalar TFactorSolid = maxDi/(DiNum + SMALL); + const scalar TFactorFilm = maxCo/(surfaceFilm.CourantNumber() + SMALL); + + const scalar dt0 = runTime.deltaTValue(); + + runTime.setDeltaT + ( + min + ( + dt0*min(min(TFactorFluid, min(TFactorFilm, TFactorSolid)), 1.2), + maxDeltaT + ) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/combustion/fireFoam/solidRegionDiffusionNo.H b/applications/solvers/combustion/fireFoam/solidRegionDiffusionNo.H new file mode 100644 index 0000000000..2d443c50bf --- /dev/null +++ b/applications/solvers/combustion/fireFoam/solidRegionDiffusionNo.H @@ -0,0 +1 @@ +scalar DiNum = pyrolysis->solidRegionDiffNo(); diff --git a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/Make/files b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/Make/files new file mode 100644 index 0000000000..cd3553a302 --- /dev/null +++ b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/Make/files @@ -0,0 +1,3 @@ +buoyantBaffleSimpleFoam.C + +EXE = $(FOAM_APPBIN)/buoyantBaffleSimpleFoam diff --git a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/Make/options new file mode 100644 index 0000000000..d3a5f0beb2 --- /dev/null +++ b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/Make/options @@ -0,0 +1,20 @@ +EXE_INC = \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/turbulenceModels \ + -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ + -I$(LIB_SRC)/finiteVolume/cfdTools \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ + -I$(LIB_SRC)/regionModels/thermoBaffleModels/lnInclude + +EXE_LIBS = \ + -lmeshTools \ + -lbasicThermophysicalModels \ + -lspecie \ + -lcompressibleTurbulenceModel \ + -lcompressibleRASModels \ + -lfiniteVolume \ + -lmeshTools \ + -lthermoBaffleModels \ + -lregionModels diff --git a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/UEqn.H new file mode 100644 index 0000000000..ca28910aaf --- /dev/null +++ b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/UEqn.H @@ -0,0 +1,25 @@ + // Solve the Momentum equation + + tmp UEqn + ( + fvm::div(phi, U) + + turbulence->divDevRhoReff(U) + ); + + UEqn().relax(); + + if (simple.momentumPredictor()) + { + solve + ( + UEqn() + == + fvc::reconstruct + ( + ( + - ghf*fvc::snGrad(rho) + - fvc::snGrad(p_rgh) + )*mesh.magSf() + ) + ); + } diff --git a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/buoyantBaffleSimpleFoam.C b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/buoyantBaffleSimpleFoam.C new file mode 100644 index 0000000000..6a31904e78 --- /dev/null +++ b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/buoyantBaffleSimpleFoam.C @@ -0,0 +1,86 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 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 . + +Application + buoyantBaffleSimpleFoam + +Description + Steady-state solver for buoyant, turbulent flow of compressible fluids + using thermal baffles + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "basicPsiThermo.H" +#include "RASModel.H" +#include "fixedGradientFvPatchFields.H" +#include "simpleControl.H" +#include "thermoBaffleModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readGravitationalAcceleration.H" + #include "createFields.H" + #include "initContinuityErrs.H" + + simpleControl simple(mesh); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (simple.loop()) + { + Info<< "Time = " << runTime.timeName() << nl << endl; + + p_rgh.storePrevIter(); + rho.storePrevIter(); + + // Pressure-velocity SIMPLE corrector + { + #include "UEqn.H" + #include "hEqn.H" + #include "pEqn.H" + } + + turbulence->correct(); + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/createFields.H new file mode 100644 index 0000000000..7adb8e41e7 --- /dev/null +++ b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/createFields.H @@ -0,0 +1,94 @@ + Info<< "Reading thermophysical properties\n" << endl; + + autoPtr pThermo + ( + basicPsiThermo::New(mesh) + ); + basicPsiThermo& thermo = pThermo(); + + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + thermo.rho() + ); + + volScalarField& p = thermo.p(); + volScalarField& h = thermo.h(); + const volScalarField& psi = thermo.psi(); + + Info<< "Reading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + #include "compressibleCreatePhi.H" + + Info<< "Creating turbulence model\n" << endl; + autoPtr turbulence + ( + compressible::RASModel::New + ( + rho, + U, + phi, + thermo + ) + ); + + + Info<< "Calculating field g.h\n" << endl; + volScalarField gh("gh", g & mesh.C()); + surfaceScalarField ghf("ghf", g & mesh.Cf()); + + Info<< "Reading field p_rgh\n" << endl; + volScalarField p_rgh + ( + IOobject + ( + "p_rgh", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + // Force p_rgh to be consistent with p + p_rgh = p - rho*gh; + + + label pRefCell = 0; + scalar pRefValue = 0.0; + setRefCell + ( + p, + p_rgh, + mesh.solutionDict().subDict("SIMPLE"), + pRefCell, + pRefValue + ); + + autoPtr baffles + ( + regionModels::thermoBaffleModels::thermoBaffleModel::New(mesh) + ); + + dimensionedScalar initialMass = fvc::domainIntegrate(rho); + dimensionedScalar totalVolume = sum(mesh.V()); diff --git a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/hEqn.H b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/hEqn.H new file mode 100644 index 0000000000..23313b56cf --- /dev/null +++ b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/hEqn.H @@ -0,0 +1,17 @@ +{ + fvScalarMatrix hEqn + ( + fvm::div(phi, h) + - fvm::Sp(fvc::div(phi), h) + - fvm::laplacian(turbulence->alphaEff(), h) + == + fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p)) + - p*fvc::div(phi/fvc::interpolate(rho)) + ); + + hEqn.relax(); + hEqn.solve(); + + baffles->evolve(); + thermo.correct(); +} diff --git a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/pEqn.H new file mode 100644 index 0000000000..17bf590f29 --- /dev/null +++ b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/pEqn.H @@ -0,0 +1,59 @@ +{ + rho = thermo.rho(); + rho.relax(); + + volScalarField rAU(1.0/UEqn().A()); + surfaceScalarField rhorAUf("(rho*(1|A(U)))", fvc::interpolate(rho*rAU)); + + U = rAU*UEqn().H(); + UEqn.clear(); + + phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf()); + bool closedVolume = adjustPhi(phi, U, p_rgh); + + surfaceScalarField buoyancyPhi(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); + phi -= buoyancyPhi; + + for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++) + { + fvScalarMatrix p_rghEqn + ( + fvm::laplacian(rhorAUf, p_rgh) == fvc::div(phi) + ); + + p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); + p_rghEqn.solve(); + + if (nonOrth == simple.nNonOrthCorr()) + { + // Calculate the conservative fluxes + phi -= p_rghEqn.flux(); + + // Explicitly relax pressure for momentum corrector + p_rgh.relax(); + + // Correct the momentum source with the pressure gradient flux + // calculated from the relaxed pressure + U -= rAU*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rhorAUf); + U.correctBoundaryConditions(); + } + } + + #include "continuityErrs.H" + + p = p_rgh + rho*gh; + + // For closed-volume cases adjust the pressure level + // to obey overall mass continuity + if (closedVolume) + { + p += (initialMass - fvc::domainIntegrate(psi*p)) + /fvc::domainIntegrate(psi); + p_rgh = p - rho*gh; + } + + rho = thermo.rho(); + rho.relax(); + Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() + << endl; +} diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/files b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/files index 7e253a8b32..8e2cf71dcc 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/files +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/files @@ -1,4 +1,3 @@ -turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C LIB = $(FOAM_LIBBIN)/libcoupledDerivedFvPatchFields diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C index 03d932975f..66788946a4 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C @@ -202,7 +202,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() return; } - if(oldMode_ == fixedHeatFlux) + if (oldMode_ == fixedHeatFlux) { this->refGrad() = q_/K(*this); this->refValue() = 0.0; diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H index 4156f784d6..2df7613542 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H @@ -54,8 +54,6 @@ SourceFiles #ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H #define solidWallHeatFluxTemperatureFvPatchScalarField_H -//#include "fixedGradientFvPatchFields.H" - #include "mixedFvPatchFields.H" #include "temperatureCoupledBase.H" diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H index a5a87c73ef..e2db33f1f7 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H @@ -88,7 +88,7 @@ Info<< "Calculating field g.h\n" << endl; volScalarField gh("gh", g & mesh.C()); - surfaceScalarField ghf("gh", g & mesh.Cf()); + surfaceScalarField ghf("ghf", g & mesh.Cf()); volScalarField p_rgh ( diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H index bbfb5be051..5c7a4ae33e 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H @@ -1,7 +1,7 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); -surfaceScalarField rhorAUf(rAU.name(), fvc::interpolate(rho*rAU)); +surfaceScalarField rhorAUf(rAU.name() + 'f', fvc::interpolate(rho*rAU)); U = rAU*UEqn.H(); surfaceScalarField phiU diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C index 46c0171e5a..b4c6020e1b 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C @@ -132,6 +132,7 @@ Usage #include "surfaceFields.H" #include "syncTools.H" #include "cyclicPolyPatch.H" +#include "wedgePolyPatch.H" #include "nonuniformTransformCyclicPolyPatch.H" #include "extrudeModel.H" @@ -951,6 +952,12 @@ int main(int argc, char *argv[]) // Region const word shellRegionName(dict.lookup("region")); const wordList zoneNames(dict.lookup("faceZones")); + wordList zoneShadowNames(0); + if (dict.found("faceZonesShadow")) + { + dict.lookup("faceZonesShadow") >> zoneShadowNames; + } + const Switch oneD(dict.lookup("oneD")); const Switch adaptMesh(dict.lookup("adaptMesh")); @@ -1007,6 +1014,47 @@ int main(int argc, char *argv[]) } } + labelList zoneShadowIDs; + if (zoneShadowNames.size()) + { + zoneShadowIDs.setSize(zoneShadowNames.size()); + forAll(zoneShadowNames, i) + { + zoneShadowIDs[i] = faceZones.findZoneID(zoneShadowNames[i]); + if (zoneShadowIDs[i] == -1) + { + FatalErrorIn(args.executable()) + << "Cannot find zone " << zoneShadowNames[i] << endl + << "Valid zones are " << faceZones.names() + << exit(FatalError); + } + } + } + + label nShadowFaces = 0; + forAll(zoneShadowIDs, i) + { + nShadowFaces += faceZones[zoneShadowIDs[i]].size(); + } + + labelList extrudeMeshShadowFaces(nShadowFaces); + boolList zoneShadowFlipMap(nShadowFaces); + labelList zoneShadowID(nShadowFaces); + + nShadowFaces = 0; + forAll(zoneShadowIDs, i) + { + const faceZone& fz = faceZones[zoneShadowIDs[i]]; + forAll(fz, j) + { + extrudeMeshShadowFaces[nShadowFaces] = fz[j]; + zoneShadowFlipMap[nShadowFaces] = fz.flipMap()[j]; + zoneShadowID[nShadowFaces] = zoneShadowIDs[i]; + nShadowFaces++; + } + } + + // Collect faces to extrude and per-face information // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1047,6 +1095,19 @@ int main(int argc, char *argv[]) << nl << endl; + // Check nExtrudeFaces = nShadowFaces + if (zoneShadowNames.size()) + { + if (nExtrudeFaces != nShadowFaces) + { + FatalErrorIn(args.executable()) + << "Extruded faces " << nExtrudeFaces << endl + << "is different from shadow faces. " << nShadowFaces + << "This is not permitted " << endl + << exit(FatalError); + } + } + // Determine corresponding mesh edges const labelList extrudeMeshEdges @@ -1135,7 +1196,7 @@ int main(int argc, char *argv[]) << '\t' << patches[interRegionBottomPatch[i]].type() << nl; } - else + else if (zoneShadowNames.size() == 0) { interRegionTopPatch[i] = addPatch ( @@ -1159,6 +1220,31 @@ int main(int argc, char *argv[]) << '\t' << patches[interRegionBottomPatch[i]].type() << nl; } + else if (zoneShadowNames.size() > 0) //patch using shadow face zones. + { + interRegionTopPatch[i] = addPatch + ( + mesh, + zoneShadowNames[i] + "_top" + ); + nCoupled++; + Info<< interRegionTopPatch[i] + << '\t' << patches[interRegionTopPatch[i]].name() + << '\t' << patches[interRegionTopPatch[i]].type() + << nl; + + interRegionBottomPatch[i] = addPatch + ( + mesh, + interName + ); + nCoupled++; + Info<< interRegionBottomPatch[i] + << '\t' << patches[interRegionBottomPatch[i]].name() + << '\t' << patches[interRegionBottomPatch[i]].type() + << nl; + } + } Info<< "Added " << nCoupled << " inter-region patches." << nl << endl; @@ -1216,13 +1302,32 @@ int main(int argc, char *argv[]) if (oneD) { // Reuse single empty patch. - word patchName = "oneDEmptPatch"; - - zoneSidePatch[zoneI] = addPatch - ( - mesh, - patchName - ); + word patchType = dict.lookup("oneDPolyPatchType"); + word patchName; + if (patchType == "emptyPolyPatch") + { + patchName = "oneDEmptyPatch"; + zoneSidePatch[zoneI] = addPatch + ( + mesh, + patchName + ); + } + else if (patchType == "wedgePolyPatch") + { + patchName = "oneDWedgePatch"; + zoneSidePatch[zoneI] = addPatch + ( + mesh, + patchName + ); + } + else + { + FatalErrorIn(args.executable()) + << "Type " << patchType << " does not exist " + << exit(FatalError); + } Info<< zoneSidePatch[zoneI] << '\t' << patchName << nl; @@ -1335,12 +1440,16 @@ int main(int argc, char *argv[]) if (oneD) { - nonManifoldEdge[edgeI] = 1; + //nonManifoldEdge[edgeI] = 1; //To fill the space ePatches.setSize(eFaces.size()); forAll(eFaces, i) { ePatches[i] = zoneSidePatch[zoneID[eFaces[i]]]; } + if (eFaces.size() != 2) + { + nonManifoldEdge[edgeI] = 1; + } } else if (eFaces.size() == 2) { @@ -1754,48 +1863,91 @@ int main(int argc, char *argv[]) } } - // Add faces (using same points) to be in top patch - forAll(extrudeMeshFaces, zoneFaceI) + if (zoneShadowNames.size() > 0) //if there is a top faceZone specified { - label meshFaceI = extrudeMeshFaces[zoneFaceI]; - bool flip = zoneFlipMap[zoneFaceI]; - const face& f = mesh.faces()[meshFaceI]; - - if (!flip) + forAll(extrudeMeshFaces, zoneFaceI) { - if (mesh.isInternalFace(meshFaceI)) + label meshFaceI = extrudeMeshShadowFaces[zoneFaceI]; + label zoneI = zoneShadowID[zoneFaceI]; + bool flip = zoneShadowFlipMap[zoneFaceI]; + const face& f = mesh.faces()[meshFaceI]; + + if (!flip) + { + meshMod.modifyFace + ( + f, // modified face + meshFaceI, // face being modified + mesh.faceOwner()[meshFaceI],// owner + -1, // neighbour + false, // face flip + extrudeTopPatchID[zoneFaceI],// patch for face + zoneI, // zone for face + flip // face flip in zone + ); + } + else if (mesh.isInternalFace(meshFaceI)) + { + meshMod.modifyFace + ( + f.reverseFace(), // modified face + meshFaceI, // label modified face + mesh.faceNeighbour()[meshFaceI],// owner + -1, // neighbour + true, // face flip + extrudeTopPatchID[zoneFaceI], // patch for face + zoneI, // zone for face + !flip // face flip in zone + ); + } + } + + } + else + { + // Add faces (using same points) to be in top patch + forAll(extrudeMeshFaces, zoneFaceI) + { + label meshFaceI = extrudeMeshFaces[zoneFaceI]; + bool flip = zoneFlipMap[zoneFaceI]; + const face& f = mesh.faces()[meshFaceI]; + + if (!flip) + { + if (mesh.isInternalFace(meshFaceI)) + { + meshMod.addFace + ( + f.reverseFace(), // modified face + mesh.faceNeighbour()[meshFaceI],// owner + -1, // neighbour + -1, // master point + -1, // master edge + meshFaceI, // master face + true, // flip flux + extrudeTopPatchID[zoneFaceI], // patch for face + -1, // zone for face + false //face flip in zone + ); + } + } + else { meshMod.addFace ( - f.reverseFace(), // modified face - mesh.faceNeighbour()[meshFaceI],// owner + f, // face + mesh.faceOwner()[meshFaceI], // owner -1, // neighbour -1, // master point -1, // master edge meshFaceI, // master face - true, // flip flux + false, // flip flux extrudeTopPatchID[zoneFaceI], // patch for face -1, // zone for face - false // face flip in zone + false // zone flip ); } } - else - { - meshMod.addFace - ( - f, // face - mesh.faceOwner()[meshFaceI], // owner - -1, // neighbour - -1, // master point - -1, // master edge - meshFaceI, // master face - false, // flip flux - extrudeTopPatchID[zoneFaceI], // patch for face - -1, // zone for face - false // zone flip - ); - } } // Change the mesh. Change points directly (no inflation). diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict index f99b82edb7..b50a614713 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict @@ -144,6 +144,13 @@ castellatedMeshControls } } + // Optional specification of patch type (default is wall). No + // constraint types (cyclic, symmetry) etc. are allowed. + patchInfo + { + type patch; + } + //- Optional angle to detect small-large cell situation // perpendicular to the surface. Is the angle of face w.r.t. // the local surface normal. Use on flat(ish) surfaces only. diff --git a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options index 988d2a4edb..99eae02e71 100644 --- a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options +++ b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options @@ -43,10 +43,10 @@ EXE_LIBS = \ -lmeshTools \ -lmolecularMeasurements \ -lmolecule \ - -lmultiphaseInterFoam \ +/* -lmultiphaseInterFoam */ \ -lODE \ -lOpenFOAM \ - -lphaseModel \ +/* -lphaseModel */ \ -lpotential \ -lradiationModels \ -lrandomProcesses \ @@ -62,7 +62,6 @@ EXE_LIBS = \ -lsurfaceFilmModels \ -lsurfMesh \ -lsystemCall \ - -ltabulatedWallFunctions \ -lthermalPorousZone \ -lthermophysicalFunctions \ -ltopoChangerFvMesh \ diff --git a/applications/utilities/parallelProcessing/decomposePar/Make/files b/applications/utilities/parallelProcessing/decomposePar/Make/files index 076ecd41bf..125f6b81e7 100644 --- a/applications/utilities/parallelProcessing/decomposePar/Make/files +++ b/applications/utilities/parallelProcessing/decomposePar/Make/files @@ -2,6 +2,7 @@ decomposePar.C domainDecomposition.C domainDecompositionMesh.C domainDecompositionDistribute.C +dimFieldDecomposer.C fvFieldDecomposer.C pointFieldDecomposer.C lagrangianFieldDecomposer.C diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index 8c8b1dfc88..ea306917e5 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -81,6 +81,7 @@ Usage #include "pointFields.H" #include "readFields.H" +#include "dimFieldDecomposer.H" #include "fvFieldDecomposer.H" #include "pointFieldDecomposer.H" #include "lagrangianFieldDecomposer.H" @@ -354,6 +355,25 @@ int main(int argc, char *argv[]) readFields(mesh, objects, volTensorFields); + // Construct the dimensioned fields + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + PtrList > dimScalarFields; + readFields(mesh, objects, dimScalarFields); + + PtrList > dimVectorFields; + readFields(mesh, objects, dimVectorFields); + + PtrList > + dimSphericalTensorFields; + readFields(mesh, objects, dimSphericalTensorFields); + + PtrList > dimSymmTensorFields; + readFields(mesh, objects, dimSymmTensorFields); + + PtrList > dimTensorFields; + readFields(mesh, objects, dimTensorFields); + + // Construct the surface fields // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PtrList surfaceScalarFields; @@ -727,19 +747,6 @@ int main(int argc, char *argv[]) ); // FV fields - if - ( - volScalarFields.size() - || volVectorFields.size() - || volSphericalTensorFields.size() - || volSymmTensorFields.size() - || volTensorFields.size() - || surfaceScalarFields.size() - || surfaceVectorFields.size() - || surfaceSphericalTensorFields.size() - || surfaceSymmTensorFields.size() - || surfaceTensorFields.size() - ) { fvFieldDecomposer fieldDecomposer ( @@ -763,16 +770,25 @@ int main(int argc, char *argv[]) fieldDecomposer.decomposeFields(surfaceTensorFields); } + // Dimensioned fields + { + dimFieldDecomposer fieldDecomposer + ( + mesh, + procMesh, + faceProcAddressing, + cellProcAddressing + ); + + fieldDecomposer.decomposeFields(dimScalarFields); + fieldDecomposer.decomposeFields(dimVectorFields); + fieldDecomposer.decomposeFields(dimSphericalTensorFields); + fieldDecomposer.decomposeFields(dimSymmTensorFields); + fieldDecomposer.decomposeFields(dimTensorFields); + } + // Point fields - if - ( - pointScalarFields.size() - || pointVectorFields.size() - || pointSphericalTensorFields.size() - || pointSymmTensorFields.size() - || pointTensorFields.size() - ) { labelIOList pointProcAddressing ( @@ -822,21 +838,6 @@ int main(int argc, char *argv[]) ); // Lagrangian fields - if - ( - lagrangianLabelFields[cloudI].size() - || lagrangianLabelFieldFields[cloudI].size() - || lagrangianScalarFields[cloudI].size() - || lagrangianScalarFieldFields[cloudI].size() - || lagrangianVectorFields[cloudI].size() - || lagrangianVectorFieldFields[cloudI].size() - || lagrangianSphericalTensorFields[cloudI].size() - || lagrangianSphericalTensorFieldFields[cloudI].size() - || lagrangianSymmTensorFields[cloudI].size() - || lagrangianSymmTensorFieldFields[cloudI].size() - || lagrangianTensorFields[cloudI].size() - || lagrangianTensorFieldFields[cloudI].size() - ) { fieldDecomposer.decomposeFields ( diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposeParDict b/applications/utilities/parallelProcessing/decomposePar/decomposeParDict index 26283baa2e..94a3b75c1f 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposeParDict +++ b/applications/utilities/parallelProcessing/decomposePar/decomposeParDict @@ -37,6 +37,7 @@ method scotch; // method metis; // method manual; // method multiLevel; +// method structured; // does 2D decomposition of structured mesh multiLevelCoeffs { @@ -108,6 +109,15 @@ manualCoeffs } +structuredCoeffs +{ + // Patches to do 2D decomposition on. Structured mesh only; cells have + // to be in 'columns' on top of patches. + patches (bottomPatch); +} + + + //// Is the case distributed //distributed yes; //// Per slave (so nProcs-1 entries) the directory above the case. diff --git a/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposer.C b/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposer.C new file mode 100644 index 0000000000..8c61e0920c --- /dev/null +++ b/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposer.C @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 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 . + +\*---------------------------------------------------------------------------*/ + +#include "dimFieldDecomposer.H" + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dimFieldDecomposer::dimFieldDecomposer +( + const fvMesh& completeMesh, + const fvMesh& procMesh, + const labelList& faceAddressing, + const labelList& cellAddressing +) +: + completeMesh_(completeMesh), + procMesh_(procMesh), + faceAddressing_(faceAddressing), + cellAddressing_(cellAddressing) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dimFieldDecomposer::~dimFieldDecomposer() +{} + + +// ************************************************************************* // diff --git a/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposer.H b/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposer.H new file mode 100644 index 0000000000..ba88e85c8d --- /dev/null +++ b/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposer.H @@ -0,0 +1,130 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 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 . + +Class + Foam::dimFieldDecomposer + +Description + Dimensioned field decomposer. + +SourceFiles + dimFieldDecomposer.C + dimFieldDecomposerDecomposeFields.C + +\*---------------------------------------------------------------------------*/ + +#ifndef dimFieldDecomposer_H +#define dimFieldDecomposer_H + +#include "fvMesh.H" +#include "fvPatchFieldMapper.H" +#include "surfaceFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class IOobjectList; + +/*---------------------------------------------------------------------------*\ + Class fvFieldDecomposer Declaration +\*---------------------------------------------------------------------------*/ + +class dimFieldDecomposer +{ +private: + + // Private data + + //- Reference to complete mesh + const fvMesh& completeMesh_; + + //- Reference to processor mesh + const fvMesh& procMesh_; + + //- Reference to face addressing + const labelList& faceAddressing_; + + //- Reference to cell addressing + const labelList& cellAddressing_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + dimFieldDecomposer(const dimFieldDecomposer&); + + //- Disallow default bitwise assignment + void operator=(const dimFieldDecomposer&); + + +public: + + // Constructors + + //- Construct from components + dimFieldDecomposer + ( + const fvMesh& completeMesh, + const fvMesh& procMesh, + const labelList& faceAddressing, + const labelList& cellAddressing + ); + + + //- Destructor + ~dimFieldDecomposer(); + + + // Member Functions + + //- Decompose field + template + tmp > decomposeField + ( + const DimensionedField& field + ) const; + + + //- Decompose llist of fields + template + void decomposeFields(const PtrList& fields) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "dimFieldDecomposerDecomposeFields.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposerDecomposeFields.C b/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposerDecomposeFields.C new file mode 100644 index 0000000000..2ca8088103 --- /dev/null +++ b/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposerDecomposeFields.C @@ -0,0 +1,74 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 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 . + +\*---------------------------------------------------------------------------*/ + +#include "dimFieldDecomposer.H" + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Foam::tmp > +Foam::dimFieldDecomposer::decomposeField +( + const DimensionedField& field +) const +{ + // Create and map the internal field values + Field mappedField(field, cellAddressing_); + + // Create the field for the processor + return tmp > + ( + new DimensionedField + ( + IOobject + ( + field.name(), + procMesh_.time().timeName(), + procMesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + procMesh_, + field.dimensions(), + mappedField + ) + ); +} + + +template +void Foam::dimFieldDecomposer::decomposeFields +( + const PtrList& fields +) const +{ + forAll(fields, fieldI) + { + decomposeField(fields[fieldI])().write(); + } +} + + +// ************************************************************************* // diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C index 4882c118a0..36a6ad2eb4 100644 --- a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C +++ b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C @@ -860,6 +860,16 @@ bool Foam::domainDecomposition::writeDecomposition() scalar avgProcPatches = scalar(totProcPatches)/nProcs_; scalar avgProcFaces = scalar(totProcFaces)/nProcs_; + // In case of all faces on one processor. Just to avoid division by 0. + if (totProcPatches == 0) + { + avgProcPatches = 1; + } + if (totProcFaces == 0) + { + avgProcFaces = 1; + } + Info<< nl << "Number of processor faces = " << totProcFaces/2 << nl << "Max number of cells = " << maxProcCells diff --git a/applications/utilities/parallelProcessing/decomposePar/readFields.C b/applications/utilities/parallelProcessing/decomposePar/readFields.C index f72d0a6ac5..5de523e3c2 100644 --- a/applications/utilities/parallelProcessing/decomposePar/readFields.C +++ b/applications/utilities/parallelProcessing/decomposePar/readFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,7 +35,7 @@ void Foam::readFields PtrList& fields ) { - // Search list of objects for volScalarFields + // Search list of objects for fields of type GeomField IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName)); // Remove the cellDist field @@ -45,7 +45,7 @@ void Foam::readFields fieldObjects.erase(celDistIter); } - // Construct the vol scalar fields + // Construct the fields fields.setSize(fieldObjects.size()); label fieldI = 0; diff --git a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C index 8812e78e64..509bff8898 100644 --- a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C +++ b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C @@ -475,6 +475,16 @@ void printMeshData(const polyMesh& mesh) scalar avgProcPatches = scalar(totProcPatches)/Pstream::nProcs(); scalar avgProcFaces = scalar(totProcFaces)/Pstream::nProcs(); + // In case of all faces on one processor. Just to avoid division by 0. + if (totProcPatches == 0) + { + avgProcPatches = 1; + } + if (totProcFaces == 0) + { + avgProcFaces = 1; + } + Info<< nl << "Number of processor faces = " << totProcFaces/2 << nl << "Max number of cells = " << maxProcCells diff --git a/applications/utilities/surface/surfaceSubset/surfaceSubset.C b/applications/utilities/surface/surfaceSubset/surfaceSubset.C index fb41623074..0fb1feed70 100644 --- a/applications/utilities/surface/surfaceSubset/surfaceSubset.C +++ b/applications/utilities/surface/surfaceSubset/surfaceSubset.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -249,7 +249,11 @@ int main(int argc, char *argv[]) // search engine indexedOctree selectTree ( - treeDataTriSurface(selectSurf), + treeDataTriSurface + ( + selectSurf, + indexedOctree::perturbTol() + ), bb.extend(rndGen, 1E-4), // slightly randomize bb 8, // maxLevel 10, // leafsize diff --git a/bin/paraFoam b/bin/paraFoam index a57505f5f9..48eab6ebe0 100755 --- a/bin/paraFoam +++ b/bin/paraFoam @@ -229,7 +229,8 @@ else echo "created temporary '$caseFile'" } - paraview --data="$caseFile" "$@" + # For now filter out any ld.so errors. Caused by non-system compiler? + paraview --data="$caseFile" "$@" 2>&1 | fgrep -v 'Inconsistency detected by ld.so' fi diff --git a/bin/tools/MakefileDirs b/bin/tools/MakefileDirs index b67656b6e8..7dda83a399 100644 --- a/bin/tools/MakefileDirs +++ b/bin/tools/MakefileDirs @@ -36,7 +36,7 @@ application: $(FOAM_TARGETS) $(FOAM_TARGETS): - @(cd $@ && $(FOAM_APP)) + +@(cd $@ && $(FOAM_APP)) #------------------------------------------------------------------------------ diff --git a/bin/tools/RunFunctions b/bin/tools/RunFunctions index bfaf58c39c..909d902b8a 100644 --- a/bin/tools/RunFunctions +++ b/bin/tools/RunFunctions @@ -61,7 +61,14 @@ runParallel() nProcs=$1 shift echo "Running $APP_RUN in parallel on $PWD using $nProcs processes" - ( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 ) + + #if [ "$WM_SCHEDULER" ] + #then + # echo "$PWD: $WM_SCHEDULER -np $nProcs" 1>&2 + # $WM_SCHEDULER -np $nProcs "( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 )" + #else + ( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 ) + #fi fi } diff --git a/src/Allwmake b/src/Allwmake index b1bbcea809..aa17b418e3 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -60,6 +60,7 @@ wmake $makeType randomProcesses thermophysicalModels/Allwmake $* transportModels/Allwmake $* turbulenceModels/Allwmake $* +wmake $makeType combustionModels regionModels/Allwmake $* lagrangian/Allwmake $* postProcessing/Allwmake $* diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C index 6c6de9d7e3..e016a5397b 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C +++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C @@ -714,7 +714,7 @@ Foam::point Foam::indexedOctree::pushPoint ) { // Get local length scale. - const vector perturbVec = perturbTol_*(bb.span()); + const vector perturbVec = perturbTol_*bb.span(); point perturbedPt(pt); diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C index 52ccc834ff..ce054e9e9e 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C @@ -525,7 +525,6 @@ void Foam::globalMeshData::calcGlobalPointSlaves() const // Calculate connected points for master points. globalPoints globalData(mesh_, coupledPatch(), true, true); - globalPointNumberingPtr_.reset(new globalIndex(globalData.globalIndices())); globalPointSlavesPtr_.reset ( @@ -1564,6 +1563,42 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const } +void Foam::globalMeshData::calcGlobalCoPointSlaves() const +{ + if (debug) + { + Pout<< "globalMeshData::calcGlobalCoPointSlaves() :" + << " calculating coupled master to collocated" + << " slave point addressing." << endl; + } + + // Calculate connected points for master points. + globalPoints globalData(mesh_, coupledPatch(), true, false); + + globalCoPointSlavesPtr_.reset + ( + new labelListList + ( + globalData.pointPoints().xfer() + ) + ); + globalCoPointSlavesMapPtr_.reset + ( + new mapDistribute + ( + globalData.map().xfer() + ) + ); + + if (debug) + { + Pout<< "globalMeshData::calcGlobalCoPointSlaves() :" + << " finished calculating coupled master to collocated" + << " slave point addressing." << endl; + } +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // Construct from polyMesh @@ -1639,6 +1674,10 @@ void Foam::globalMeshData::clearOut() globalPointBoundaryCellsPtr_.clear(); globalPointTransformedBoundaryCellsPtr_.clear(); globalPointBoundaryCellsMapPtr_.clear(); + + // Other: collocated points + globalCoPointSlavesPtr_.clear(); + globalCoPointSlavesMapPtr_.clear(); } @@ -1971,7 +2010,10 @@ const Foam::globalIndex& Foam::globalMeshData::globalPointNumbering() const { if (!globalPointNumberingPtr_.valid()) { - calcGlobalPointSlaves(); + globalPointNumberingPtr_.reset + ( + new globalIndex(coupledPatch().nPoints()) + ); } return globalPointNumberingPtr_(); } @@ -2161,6 +2203,26 @@ const } +const Foam::labelListList& Foam::globalMeshData::globalCoPointSlaves() const +{ + if (!globalCoPointSlavesPtr_.valid()) + { + calcGlobalCoPointSlaves(); + } + return globalCoPointSlavesPtr_(); +} + + +const Foam::mapDistribute& Foam::globalMeshData::globalCoPointSlavesMap() const +{ + if (!globalCoPointSlavesMapPtr_.valid()) + { + calcGlobalCoPointSlaves(); + } + return globalCoPointSlavesMapPtr_(); +} + + Foam::autoPtr Foam::globalMeshData::mergePoints ( labelList& pointToGlobal, @@ -2168,33 +2230,70 @@ Foam::autoPtr Foam::globalMeshData::mergePoints ) const { const indirectPrimitivePatch& cpp = coupledPatch(); - const labelListList& pointSlaves = globalPointSlaves(); - const mapDistribute& pointSlavesMap = globalPointSlavesMap(); + const globalIndex& globalCoupledPoints = globalPointNumbering(); + // Use collocated only + const labelListList& pointSlaves = globalCoPointSlaves(); + const mapDistribute& pointSlavesMap = globalCoPointSlavesMap(); + + + // Points are either + // - master with slaves + // - slave with a master + // - other (since e.g. non-collocated cyclics not connected) + + labelList masterGlobalPoint(cpp.nPoints(), -1); + forAll(masterGlobalPoint, pointI) + { + const labelList& slavePoints = pointSlaves[pointI]; + if (slavePoints.size() > 0) + { + masterGlobalPoint[pointI] = globalCoupledPoints.toGlobal(pointI); + } + } + + // Sync by taking max + syncData + ( + masterGlobalPoint, + pointSlaves, + labelListList(cpp.nPoints()), // no transforms + pointSlavesMap, + maxEqOp