mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Updates to MPPIC sub-models. Instantiation for kinematic clouds
This commit is contained in:
committed by
Andrew Heather
parent
9207140e37
commit
5bc846553c
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2013-2017 OpenFOAM Foundation
|
Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -87,7 +87,10 @@ Foam::AveragingMethod<Type>::New
|
|||||||
const fvMesh& mesh
|
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;
|
//Info<< "Selecting averaging method " << modelType << endl;
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2013-2016 OpenFOAM Foundation
|
Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -83,7 +83,10 @@ Foam::DampingModel<CloudType>::New
|
|||||||
CloudType& owner
|
CloudType& owner
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word modelType(dict.get<word>(typeName));
|
const word modelType
|
||||||
|
(
|
||||||
|
dict.template getOrDefault<word>(typeName, "none")
|
||||||
|
);
|
||||||
|
|
||||||
Info<< "Selecting damping model " << modelType << endl;
|
Info<< "Selecting damping model " << modelType << endl;
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2013-2016 OpenFOAM Foundation
|
Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -142,6 +143,39 @@ public:
|
|||||||
|
|
||||||
#define makeDampingModel(CloudType) \
|
#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; \
|
typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
|
||||||
defineNamedTemplateTypeNameAndDebug \
|
defineNamedTemplateTypeNameAndDebug \
|
||||||
( \
|
( \
|
||||||
@ -159,7 +193,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define makeDampingModelType(SS, CloudType) \
|
#define makeDampingModelTypeMPPIC(SS, CloudType) \
|
||||||
\
|
\
|
||||||
typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
|
typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
|
||||||
defineNamedTemplateTypeNameAndDebug \
|
defineNamedTemplateTypeNameAndDebug \
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2013-2016 OpenFOAM Foundation
|
Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -86,7 +86,10 @@ Foam::IsotropyModel<CloudType>::New
|
|||||||
CloudType& owner
|
CloudType& owner
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word modelType(dict.get<word>(typeName));
|
const word modelType
|
||||||
|
(
|
||||||
|
dict.template getOrDefault<word>(typeName, "none")
|
||||||
|
);
|
||||||
|
|
||||||
Info<< "Selecting isotropy model " << modelType << endl;
|
Info<< "Selecting isotropy model " << modelType << endl;
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2013-2016 OpenFOAM Foundation
|
Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -136,14 +137,44 @@ public:
|
|||||||
|
|
||||||
#define makeIsotropyModel(CloudType) \
|
#define makeIsotropyModel(CloudType) \
|
||||||
\
|
\
|
||||||
typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
|
typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
|
||||||
defineNamedTemplateTypeNameAndDebug \
|
defineNamedTemplateTypeNameAndDebug \
|
||||||
( \
|
( \
|
||||||
Foam::IsotropyModel<MPPICCloudType>, \
|
Foam::IsotropyModel<kinematicCloudType>, \
|
||||||
0 \
|
0 \
|
||||||
); \
|
); \
|
||||||
\
|
\
|
||||||
namespace Foam \
|
namespace Foam \
|
||||||
|
{ \
|
||||||
|
defineTemplateRunTimeSelectionTable \
|
||||||
|
( \
|
||||||
|
IsotropyModel<kinematicCloudType>, \
|
||||||
|
dictionary \
|
||||||
|
); \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#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 \
|
defineTemplateRunTimeSelectionTable \
|
||||||
( \
|
( \
|
||||||
@ -153,7 +184,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define makeIsotropyModelType(SS, CloudType) \
|
#define makeIsotropyModelTypeMPPIC(SS, CloudType) \
|
||||||
\
|
\
|
||||||
typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
|
typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
|
||||||
defineNamedTemplateTypeNameAndDebug \
|
defineNamedTemplateTypeNameAndDebug \
|
||||||
@ -164,7 +195,6 @@ public:
|
|||||||
<Foam::IsotropyModels::SS<MPPICCloudType>> \
|
<Foam::IsotropyModels::SS<MPPICCloudType>> \
|
||||||
add##SS##CloudType##MPPICCloudType##ConstructorToTable_;
|
add##SS##CloudType##MPPICCloudType##ConstructorToTable_;
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#ifdef NoRepository
|
#ifdef NoRepository
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2013-2017 OpenFOAM Foundation
|
Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -150,8 +151,10 @@ Foam::vector Foam::PackingModels::Explicit<CloudType>::velocityCorrection
|
|||||||
// interpolated quantities
|
// interpolated quantities
|
||||||
const scalar alpha =
|
const scalar alpha =
|
||||||
this->volumeAverage_->interpolate(p.coordinates(), tetIs);
|
this->volumeAverage_->interpolate(p.coordinates(), tetIs);
|
||||||
|
|
||||||
const vector alphaGrad =
|
const vector alphaGrad =
|
||||||
this->volumeAverage_->interpolateGrad(p.coordinates(), tetIs);
|
this->volumeAverage_->interpolateGrad(p.coordinates(), tetIs);
|
||||||
|
|
||||||
const vector uMean =
|
const vector uMean =
|
||||||
this->uAverage_->interpolate(p.coordinates(), tetIs);
|
this->uAverage_->interpolate(p.coordinates(), tetIs);
|
||||||
|
|
||||||
@ -175,7 +178,7 @@ Foam::vector Foam::PackingModels::Explicit<CloudType>::velocityCorrection
|
|||||||
// correction velocity
|
// correction velocity
|
||||||
if ((uRelative & alphaGrad) > 0)
|
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
|
// apply the velocity limiters
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2013-2016 OpenFOAM Foundation
|
Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -85,8 +85,10 @@ Foam::PackingModel<CloudType>::New
|
|||||||
CloudType& owner
|
CloudType& owner
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word modelType(dict.get<word>(typeName));
|
const word modelType
|
||||||
|
(
|
||||||
|
dict.template getOrDefault<word>(typeName, "none")
|
||||||
|
);
|
||||||
Info<< "Selecting packing model " << modelType << endl;
|
Info<< "Selecting packing model " << modelType << endl;
|
||||||
|
|
||||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2013-2016 OpenFOAM Foundation
|
Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -147,6 +148,39 @@ public:
|
|||||||
|
|
||||||
#define makePackingModel(CloudType) \
|
#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; \
|
typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
|
||||||
defineNamedTemplateTypeNameAndDebug \
|
defineNamedTemplateTypeNameAndDebug \
|
||||||
( \
|
( \
|
||||||
@ -164,7 +198,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define makePackingModelType(SS, CloudType) \
|
#define makePackingModelTypeMPPIC(SS, CloudType) \
|
||||||
\
|
\
|
||||||
typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
|
typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
|
||||||
defineNamedTemplateTypeNameAndDebug \
|
defineNamedTemplateTypeNameAndDebug \
|
||||||
@ -175,7 +209,6 @@ public:
|
|||||||
<Foam::PackingModels::SS<MPPICCloudType>> \
|
<Foam::PackingModels::SS<MPPICCloudType>> \
|
||||||
add##SS##CloudType##MPPICCloudType##ConstructorToTable_;
|
add##SS##CloudType##MPPICCloudType##ConstructorToTable_;
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#ifdef NoRepository
|
#ifdef NoRepository
|
||||||
|
|||||||
Reference in New Issue
Block a user