diff --git a/src/functionObjects/field/DMD/DMDModels/derived/STDMD/STDMD.C b/src/functionObjects/field/DMD/DMDModels/derived/STDMD/STDMD.C index ac180feb7ac0f29ed629b541825ac96ba2de3854..bbbdf4e4da8361c99ea70bef64db197e4fa22ad3 100644 --- a/src/functionObjects/field/DMD/DMDModels/derived/STDMD/STDMD.C +++ b/src/functionObjects/field/DMD/DMDModels/derived/STDMD/STDMD.C @@ -879,17 +879,15 @@ bool Foam::DMDModels::STDMD::initialise(const RMatrix& z) // algorithms at the final output computations (K:p. 43) { const label nSnap = z.m()/2; + timeName0_ = + mesh_.time().timeName(mesh_.time().startTime().value()); if (nSnap == 0) { empty_ = true; } - scalarField snapshot0(nSnap); - std::copy(z.cbegin(), z.cbegin() + nSnap, snapshot0.begin()); - timeName0_ = mesh_.time().timeName(); - - IOField<scalar> + IOField<scalar> snapshot0 ( IOobject ( @@ -897,10 +895,21 @@ bool Foam::DMDModels::STDMD::initialise(const RMatrix& z) timeName0_, mesh_, IOobject::NO_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ), - snapshot0 - ).write(); + nSnap + ); + + std::copy(z.cbegin(), z.cbegin() + nSnap, snapshot0.begin()); + + const IOstreamOption streamOpt + ( + mesh_.time().writeFormat(), + mesh_.time().writeCompression() + ); + + fileHandler().writeObject(snapshot0, streamOpt, true); } Q_ = z/norm; diff --git a/src/thermophysicalModels/solidSpecie/reaction/reactions/makeSolidReaction.H b/src/thermophysicalModels/solidSpecie/reaction/reactions/makeSolidReaction.H index d776a07cbaef2377e054c29cd63ac75a32b53f68..715da5018d018e1eb15565878bcedfe83112fd78 100644 --- a/src/thermophysicalModels/solidSpecie/reaction/reactions/makeSolidReaction.H +++ b/src/thermophysicalModels/solidSpecie/reaction/reactions/makeSolidReaction.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -56,11 +57,6 @@ namespace Foam typedef ReactionType<solidReaction, Thermo, ReactionRate> \ ReactionType##Thermo##ReactionRate; \ \ - defineTemplateRunTimeSelectionTable(Reaction##Thermo, dictionary); \ - \ - defineTemplateTypeNameAndDebug(solidReaction##Thermo, 0); \ - defineTemplateTypeNameAndDebug(Reaction##Thermo, 0); \ - \ template<> \ const word ReactionType##Thermo##ReactionRate::typeName \ ( \ diff --git a/src/thermophysicalModels/solidSpecie/reaction/reactions/makeSolidReactions.C b/src/thermophysicalModels/solidSpecie/reaction/reactions/makeSolidReactions.C index 96a9ab08ffb28f3f854bdeb8f800603545d97a71..6262ab4ffcf984cbfccbb03482a0a4a97a191756 100644 --- a/src/thermophysicalModels/solidSpecie/reaction/reactions/makeSolidReactions.C +++ b/src/thermophysicalModels/solidSpecie/reaction/reactions/makeSolidReactions.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,9 +27,27 @@ License \*---------------------------------------------------------------------------*/ #include "makeSolidReaction.H" + #include "solidArrheniusReactionRate.H" + #include "solidThermoPhysicsTypes.H" +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeSolidReactions(Thermo) \ + \ + typedef solidReaction<Thermo> solidReaction##Thermo; \ + \ + typedef Reaction<Thermo> Reaction##Thermo; \ + \ + defineTemplateRunTimeSelectionTable(Reaction##Thermo, dictionary); \ + \ + defineTemplateTypeNameAndDebug(solidReaction##Thermo, 0); \ + defineTemplateTypeNameAndDebug(Reaction##Thermo, 0); \ + \ + makeSolidIRReactions(Thermo, solidArrheniusReactionRate) + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -36,19 +55,11 @@ namespace Foam // * * * * * * * * * * * * * Make Solid reactions * * * * * * * * * * * * // -makeSolidIRReactions(hConstSolidThermoPhysics, solidArrheniusReactionRate) +makeSolidReactions(hConstSolidThermoPhysics) -makeSolidIRReactions -( - hPowerSolidThermoPhysics, - solidArrheniusReactionRate -) +makeSolidReactions(hPowerSolidThermoPhysics) -makeSolidIRReactions -( - hExpKappaConstSolidThermoPhysics, - solidArrheniusReactionRate -) +makeSolidReactions(hExpKappaConstSolidThermoPhysics) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperEmptying/system/blockMeshDict b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperEmptying/system/blockMeshDict index d4807868420edbe2d753d30a9b86a7be75b9f7ee..e375b78ef3abd77a71b7c91d428ddf494a1c5919 100644 --- a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperEmptying/system/blockMeshDict +++ b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperEmptying/system/blockMeshDict @@ -14,26 +14,38 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -scale 0.001; +scale 0.001; + +depth 6.2; // depth in the empty direction +width 300; // width of the wide part of the hopper +gap 30; // width of the gap +totalHeight 500; // height of the hopper including the angled part +bottomAngle 30; // angle of the bottom with respect to the ground + +minX #eval{ 0.5*$width - 0.5*$gap }; +maxX #eval{ 0.5*$width + 0.5*$gap }; + +// height of the angled part based on the bottom angle +htilted #eval{ $minX*tan(degToRad($bottomAngle)) }; vertices ( - (0 77.9423 6.2) - (135 0 6.2) - (0 -77.9423 6.2) - (300 -77.9423 6.2) - (165 0 6.2) - (300 77.9423 6.2) - (300 500 6.2) - (0 500 6.2) - (0 77.9423 0) - (135 0 0) - (0 -77.9423 0) - (300 -77.9423 0) - (165 0 0) - (300 77.9423 0) - (300 500 0) - (0 500 0) + (0 $htilted $depth) + ($minX 0 $depth) + (0 -$htilted $depth) + ($width -$htilted $depth) + ($maxX 0 $depth) + ($width $htilted $depth) + ($width $totalHeight $depth) + (0 $totalHeight $depth) + (0 $htilted 0) + ($minX 0 0) + (0 -$htilted 0) + ($width -$htilted 0) + ($maxX 0 0) + ($width $htilted 0) + ($width $totalHeight 0) + (0 $totalHeight 0) ); blocks @@ -45,7 +57,6 @@ blocks boundary ( - walls { type wall; diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperInitialState/system/blockMeshDict b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperInitialState/system/blockMeshDict index bd70069f9123a49578150a88f200a1076a2d1c02..4e1ee000d95e4b57f31568a5da09ff37f5cd347f 100644 --- a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperInitialState/system/blockMeshDict +++ b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperInitialState/system/blockMeshDict @@ -14,22 +14,34 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -scale 0.001; +scale 0.001; + +depth 6.2; // depth in the empty direction +width 300; // width of the wide part of the hopper +gap 30; // width of the gap +totalHeight 500; // height of the hopper including the angled part +bottomAngle 30; // angle of the bottom with respect to the ground + +minX #eval{ 0.5*$width - 0.5*$gap }; +maxX #eval{ 0.5*$width + 0.5*$gap }; + +// height of the angled part based on the bottom angle +htilted #eval{ $minX*tan(degToRad($bottomAngle)) }; vertices ( - (0 77.9423 6.2) - (135 0 6.2) - (165 0 6.2) - (300 77.9423 6.2) - (300 500 6.2) - (0 500 6.2) - (0 77.9423 0) - (135 0 0) - (165 0 0) - (300 77.9423 0) - (300 500 0) - (0 500 0) + (0 $htilted $depth) + ($minX 0 $depth) + ($maxX 0 $depth) + ($width $htilted $depth) + ($width $totalHeight $depth) + (0 $totalHeight $depth) + (0 $htilted 0) + ($minX 0 0) + ($maxX 0 0) + ($width $htilted 0) + ($width $totalHeight 0) + (0 $totalHeight 0) ); blocks