mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
reactingEulerFoam: Registered blended models
Blended models are now registered and can be looked up in the same way
as regular interfacial models via the phaseSystem::lookupSubModel
method. For example, to access the blended drag model, the following
code could be used:
const BlendedInterfacialModel<dragModel>& drag =
fluid.lookupSubModel<BlendedInterfacialModel<dragModel>>
(
phasePair(gas, liquid)
);
Here, "fluid" is the phase system, and "gas" and "liquid" are the phase
models between which the blended drag model applies.
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,12 +25,14 @@ License
|
|||||||
|
|
||||||
#include "massTransferModel.H"
|
#include "massTransferModel.H"
|
||||||
#include "phasePair.H"
|
#include "phasePair.H"
|
||||||
|
#include "BlendedInterfacialModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(massTransferModel, 0);
|
defineTypeNameAndDebug(massTransferModel, 0);
|
||||||
|
defineBlendedInterfacialModelTypeNameAndDebug(massTransferModel, 0);
|
||||||
defineRunTimeSelectionTable(massTransferModel, dictionary);
|
defineRunTimeSelectionTable(massTransferModel, dictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -27,12 +27,14 @@ License
|
|||||||
#include "phasePair.H"
|
#include "phasePair.H"
|
||||||
#include "swarmCorrection.H"
|
#include "swarmCorrection.H"
|
||||||
#include "surfaceInterpolate.H"
|
#include "surfaceInterpolate.H"
|
||||||
|
#include "BlendedInterfacialModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(dragModel, 0);
|
defineTypeNameAndDebug(dragModel, 0);
|
||||||
|
defineBlendedInterfacialModelTypeNameAndDebug(dragModel, 0);
|
||||||
defineRunTimeSelectionTable(dragModel, dictionary);
|
defineRunTimeSelectionTable(dragModel, dictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,12 +25,14 @@ License
|
|||||||
|
|
||||||
#include "heatTransferModel.H"
|
#include "heatTransferModel.H"
|
||||||
#include "phasePair.H"
|
#include "phasePair.H"
|
||||||
|
#include "BlendedInterfacialModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(heatTransferModel, 0);
|
defineTypeNameAndDebug(heatTransferModel, 0);
|
||||||
|
defineBlendedInterfacialModelTypeNameAndDebug(heatTransferModel, 0);
|
||||||
defineRunTimeSelectionTable(heatTransferModel, dictionary);
|
defineRunTimeSelectionTable(heatTransferModel, dictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -28,12 +28,14 @@ License
|
|||||||
#include "fvcCurl.H"
|
#include "fvcCurl.H"
|
||||||
#include "fvcFlux.H"
|
#include "fvcFlux.H"
|
||||||
#include "surfaceInterpolate.H"
|
#include "surfaceInterpolate.H"
|
||||||
|
#include "BlendedInterfacialModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(liftModel, 0);
|
defineTypeNameAndDebug(liftModel, 0);
|
||||||
|
defineBlendedInterfacialModelTypeNameAndDebug(liftModel, 0);
|
||||||
defineRunTimeSelectionTable(liftModel, dictionary);
|
defineRunTimeSelectionTable(liftModel, dictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,12 +29,14 @@ License
|
|||||||
#include "surfaceInterpolate.H"
|
#include "surfaceInterpolate.H"
|
||||||
#include "fvcSnGrad.H"
|
#include "fvcSnGrad.H"
|
||||||
#include "phaseCompressibleTurbulenceModel.H"
|
#include "phaseCompressibleTurbulenceModel.H"
|
||||||
|
#include "BlendedInterfacialModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(turbulentDispersionModel, 0);
|
defineTypeNameAndDebug(turbulentDispersionModel, 0);
|
||||||
|
defineBlendedInterfacialModelTypeNameAndDebug(turbulentDispersionModel, 0);
|
||||||
defineRunTimeSelectionTable(turbulentDispersionModel, dictionary);
|
defineRunTimeSelectionTable(turbulentDispersionModel, dictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -26,12 +26,14 @@ License
|
|||||||
#include "virtualMassModel.H"
|
#include "virtualMassModel.H"
|
||||||
#include "phasePair.H"
|
#include "phasePair.H"
|
||||||
#include "surfaceInterpolate.H"
|
#include "surfaceInterpolate.H"
|
||||||
|
#include "BlendedInterfacialModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(virtualMassModel, 0);
|
defineTypeNameAndDebug(virtualMassModel, 0);
|
||||||
|
defineBlendedInterfacialModelTypeNameAndDebug(virtualMassModel, 0);
|
||||||
defineRunTimeSelectionTable(virtualMassModel, dictionary);
|
defineRunTimeSelectionTable(virtualMassModel, dictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -28,12 +28,14 @@ License
|
|||||||
#include "fvcFlux.H"
|
#include "fvcFlux.H"
|
||||||
#include "surfaceInterpolate.H"
|
#include "surfaceInterpolate.H"
|
||||||
#include "wallFvPatch.H"
|
#include "wallFvPatch.H"
|
||||||
|
#include "BlendedInterfacialModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(wallLubricationModel, 0);
|
defineTypeNameAndDebug(wallLubricationModel, 0);
|
||||||
|
defineBlendedInterfacialModelTypeNameAndDebug(wallLubricationModel, 0);
|
||||||
defineRunTimeSelectionTable(wallLubricationModel, dictionary);
|
defineRunTimeSelectionTable(wallLubricationModel, dictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -199,6 +199,15 @@ Foam::BlendedInterfacialModel<ModelType>::BlendedInterfacialModel
|
|||||||
const bool correctFixedFluxBCs
|
const bool correctFixedFluxBCs
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
|
regIOobject
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
IOobject::groupName(typeName, phasePair(phase1, phase2).name()),
|
||||||
|
phase1.mesh().time().timeName(),
|
||||||
|
phase1.mesh()
|
||||||
|
)
|
||||||
|
),
|
||||||
phase1_(phase1),
|
phase1_(phase1),
|
||||||
phase2_(phase2),
|
phase2_(phase2),
|
||||||
blending_(blending),
|
blending_(blending),
|
||||||
@ -220,6 +229,15 @@ Foam::BlendedInterfacialModel<ModelType>::BlendedInterfacialModel
|
|||||||
const bool correctFixedFluxBCs
|
const bool correctFixedFluxBCs
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
|
regIOobject
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
IOobject::groupName(typeName, pair.name()),
|
||||||
|
pair.phase1().mesh().time().timeName(),
|
||||||
|
pair.phase1().mesh()
|
||||||
|
)
|
||||||
|
),
|
||||||
phase1_(pair.phase1()),
|
phase1_(pair.phase1()),
|
||||||
phase2_(pair.phase2()),
|
phase2_(pair.phase2()),
|
||||||
blending_(blending),
|
blending_(blending),
|
||||||
@ -348,4 +366,11 @@ Foam::BlendedInterfacialModel<ModelType>::D() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ModelType>
|
||||||
|
bool Foam::BlendedInterfacialModel<ModelType>::writeData(Ostream& os) const
|
||||||
|
{
|
||||||
|
return os.good();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -65,6 +65,8 @@ class blendedInterfacialModel
|
|||||||
|
|
||||||
template<class ModelType>
|
template<class ModelType>
|
||||||
class BlendedInterfacialModel
|
class BlendedInterfacialModel
|
||||||
|
:
|
||||||
|
public regIOobject
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
@ -123,6 +125,10 @@ class BlendedInterfacialModel
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("BlendedInterfacialModel");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from two phases, blending method and three models
|
//- Construct from two phases, blending method and three models
|
||||||
@ -183,9 +189,26 @@ public:
|
|||||||
|
|
||||||
//- Return the blended diffusivity
|
//- Return the blended diffusivity
|
||||||
tmp<volScalarField> D() const;
|
tmp<volScalarField> D() const;
|
||||||
|
|
||||||
|
//- Dummy write for regIOobject
|
||||||
|
bool writeData(Ostream& os) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#define defineBlendedInterfacialModelTypeNameAndDebug(ModelType, DebugSwitch) \
|
||||||
|
\
|
||||||
|
defineTemplateTypeNameAndDebugWithName \
|
||||||
|
( \
|
||||||
|
BlendedInterfacialModel<ModelType>, \
|
||||||
|
( \
|
||||||
|
word(BlendedInterfacialModel<ModelType>::typeName_()) + "<" \
|
||||||
|
+ ModelType::typeName_() + ">" \
|
||||||
|
).c_str(), \
|
||||||
|
DebugSwitch \
|
||||||
|
);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|||||||
@ -30,6 +30,9 @@ License
|
|||||||
#include "fvcDdt.H"
|
#include "fvcDdt.H"
|
||||||
#include "localEulerDdtScheme.H"
|
#include "localEulerDdtScheme.H"
|
||||||
|
|
||||||
|
#include "dragModel.H"
|
||||||
|
#include "BlendedInterfacialModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
|
|||||||
@ -367,6 +367,11 @@ public:
|
|||||||
const phaseModel& continuous
|
const phaseModel& continuous
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Return a blended sub model between a phase pair
|
||||||
|
template<class modelType>
|
||||||
|
const BlendedInterfacialModel<modelType>&
|
||||||
|
lookupBlendedSubModel(const phasePair& key) const;
|
||||||
|
|
||||||
|
|
||||||
// Field construction
|
// Field construction
|
||||||
|
|
||||||
|
|||||||
@ -377,4 +377,16 @@ const modelType& Foam::phaseSystem::lookupSubModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class modelType>
|
||||||
|
const Foam::BlendedInterfacialModel<modelType>&
|
||||||
|
Foam::phaseSystem::lookupBlendedSubModel(const phasePair& key) const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
mesh().lookupObject<BlendedInterfacialModel<modelType>>
|
||||||
|
(
|
||||||
|
IOobject::groupName(modelType::typeName, key.name())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
Reference in New Issue
Block a user