diff --git a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C index 0c1516c53ed3524ce05ca1b815c93435367e8b98..53d5f233abbf1b13350258ca26d318331b54c001 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2017 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -87,7 +87,10 @@ Foam::AveragingMethod<Type>::New const fvMesh& mesh ) { - const word modelType(dict.get<word>(typeName)); + const word modelType + ( + dict.template getOrDefault<word>(typeName, "basic") + ); //Info<< "Selecting averaging method " << modelType << endl; diff --git a/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C b/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C index eb1e5bea6b45cbbb0b77fb001687d39c2818d639..8c09c223251527e276e24e8b189d2e059a3b9f1a 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -83,7 +83,10 @@ Foam::DampingModel<CloudType>::New CloudType& owner ) { - const word modelType(dict.get<word>(typeName)); + const word modelType + ( + dict.template getOrDefault<word>(typeName, "none") + ); Info<< "Selecting damping model " << modelType << endl; diff --git a/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.H b/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.H index 9bf1ed3d1e376337b33b7cc938f5b1cf81493f34..c943d7110f4066a6032c888d577c6f1a10e217cb 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.H +++ b/src/lagrangian/intermediate/submodels/MPPIC/DampingModels/DampingModel/DampingModel.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -142,6 +143,39 @@ public: #define makeDampingModel(CloudType) \ \ + typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + Foam::DampingModel<kinematicCloudType>, \ + 0 \ + ); \ + \ + namespace Foam \ + { \ + defineTemplateRunTimeSelectionTable \ + ( \ + DampingModel<kinematicCloudType>, \ + dictionary \ + ); \ + } + + +#define makeDampingModelType(SS, CloudType) \ + \ + typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \ + defineNamedTemplateTypeNameAndDebug \ + (Foam::DampingModels::SS<kinematicCloudType>, 0); \ + \ + Foam::DampingModel<kinematicCloudType>:: \ + adddictionaryConstructorToTable \ + <Foam::DampingModels::SS<kinematicCloudType>> \ + add##SS##CloudType##kinematicCloudType##ConstructorToTable_; + + +// These are used to defined models in MPPIC cloud specifically + +#define makeDampingModelMPPIC(CloudType) \ + \ typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \ defineNamedTemplateTypeNameAndDebug \ ( \ @@ -159,7 +193,7 @@ public: } -#define makeDampingModelType(SS, CloudType) \ +#define makeDampingModelTypeMPPIC(SS, CloudType) \ \ typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \ defineNamedTemplateTypeNameAndDebug \ diff --git a/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C b/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C index a1d70f8556303a633ea79b8ab2cf19cd63a2c137..1178e63947e34e673838e79c77b0e0ede33702ab 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -86,7 +86,10 @@ Foam::IsotropyModel<CloudType>::New CloudType& owner ) { - const word modelType(dict.get<word>(typeName)); + const word modelType + ( + dict.template getOrDefault<word>(typeName, "none") + ); Info<< "Selecting isotropy model " << modelType << endl; diff --git a/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.H b/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.H index c7ec30ca15a3a2971868ad21e3ab312c0c8c75ed..023f6e28c03f271f3f2b393afd4a093825b85dfc 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.H +++ b/src/lagrangian/intermediate/submodels/MPPIC/IsotropyModels/IsotropyModel/IsotropyModel.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -136,10 +137,10 @@ public: #define makeIsotropyModel(CloudType) \ \ - typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \ + typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \ defineNamedTemplateTypeNameAndDebug \ ( \ - Foam::IsotropyModel<MPPICCloudType>, \ + Foam::IsotropyModel<kinematicCloudType>, \ 0 \ ); \ \ @@ -147,7 +148,7 @@ public: { \ defineTemplateRunTimeSelectionTable \ ( \ - IsotropyModel<MPPICCloudType>, \ + IsotropyModel<kinematicCloudType>, \ dictionary \ ); \ } @@ -155,6 +156,36 @@ public: #define makeIsotropyModelType(SS, CloudType) \ \ + typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \ + defineNamedTemplateTypeNameAndDebug \ + (Foam::IsotropyModels::SS<kinematicCloudType>, 0); \ + \ + Foam::IsotropyModel<kinematicCloudType>:: \ + adddictionaryConstructorToTable \ + <Foam::IsotropyModels::SS<kinematicCloudType>> \ + add##SS##CloudType##kinematicCloudType##ConstructorToTable_; + + +// These are used to defined models in MPPIC cloud specifically + +#define makeIsotropyModelMPPIC(CloudType) \ + \ + typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \ + defineNamedTemplateTypeNameAndDebug \ + (Foam::IsotropyModel<MPPICCloudType>, 0); \ + \ + namespace Foam \ + { \ + defineTemplateRunTimeSelectionTable \ + ( \ + IsotropyModel<MPPICCloudType>, \ + dictionary \ + ); \ + } + + +#define makeIsotropyModelTypeMPPIC(SS, CloudType) \ + \ typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \ defineNamedTemplateTypeNameAndDebug \ (Foam::IsotropyModels::SS<MPPICCloudType>, 0); \ @@ -164,7 +195,6 @@ public: <Foam::IsotropyModels::SS<MPPICCloudType>> \ add##SS##CloudType##MPPICCloudType##ConstructorToTable_; - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository diff --git a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/Explicit/Explicit.C b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/Explicit/Explicit.C index 3689a4ff38c88934804d059b4fab6172f10e0874..49ea02277de74ff67e7649bce4d752de5f8755ed 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/Explicit/Explicit.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/Explicit/Explicit.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2017 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -150,8 +151,10 @@ Foam::vector Foam::PackingModels::Explicit<CloudType>::velocityCorrection // interpolated quantities const scalar alpha = this->volumeAverage_->interpolate(p.coordinates(), tetIs); + const vector alphaGrad = this->volumeAverage_->interpolateGrad(p.coordinates(), tetIs); + const vector uMean = this->uAverage_->interpolate(p.coordinates(), tetIs); @@ -175,7 +178,7 @@ Foam::vector Foam::PackingModels::Explicit<CloudType>::velocityCorrection // correction velocity if ((uRelative & alphaGrad) > 0) { - dU = - deltaT*tauGrad/(p.rho()*alpha/* + deltaT*F.Sp()*/); + dU = - deltaT*tauGrad/(p.rho()*(alpha + SMALL)/* + deltaT*F.Sp()*/); } // apply the velocity limiters diff --git a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C index 017008f26b491b25e6678d214372a8597b18e173..d6df6f22f73638d0efd0e3fd909b8c441846f029 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -85,8 +85,10 @@ Foam::PackingModel<CloudType>::New CloudType& owner ) { - const word modelType(dict.get<word>(typeName)); - + const word modelType + ( + dict.template getOrDefault<word>(typeName, "none") + ); Info<< "Selecting packing model " << modelType << endl; auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); diff --git a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.H b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.H index 4b22670d650e2d7ac44604049fe466cd81b5fc1c..9d57353e217db6427813ce3c61456fd71d78ae84 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.H +++ b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/PackingModel/PackingModel.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -147,6 +148,39 @@ public: #define makePackingModel(CloudType) \ \ + typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + Foam::PackingModel<kinematicCloudType>, \ + 0 \ + ); \ + \ + namespace Foam \ + { \ + defineTemplateRunTimeSelectionTable \ + ( \ + PackingModel<kinematicCloudType>, \ + dictionary \ + ); \ + } + + +#define makePackingModelType(SS, CloudType) \ + \ + typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \ + defineNamedTemplateTypeNameAndDebug \ + (Foam::PackingModels::SS<kinematicCloudType>, 0); \ + \ + Foam::PackingModel<kinematicCloudType>:: \ + adddictionaryConstructorToTable \ + <Foam::PackingModels::SS<kinematicCloudType>> \ + add##SS##CloudType##kinematicCloudType##ConstructorToTable_; + + +// These are used to defined models in MPPIC cloud specifically + +#define makePackingModelMPPIC(CloudType) \ + \ typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \ defineNamedTemplateTypeNameAndDebug \ ( \ @@ -164,7 +198,7 @@ public: } -#define makePackingModelType(SS, CloudType) \ +#define makePackingModelTypeMPPIC(SS, CloudType) \ \ typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \ defineNamedTemplateTypeNameAndDebug \ @@ -175,7 +209,6 @@ public: <Foam::PackingModels::SS<MPPICCloudType>> \ add##SS##CloudType##MPPICCloudType##ConstructorToTable_; - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository