Modular solvers: Reorganised directory structure of applications and tutorials

The new flexible and extensible modular solvers structure already provides most
of the simulation functionality needed for single phase, multiphase,
multicomponent etc. fluid flow problems as well as a very effective method of
combining these with solid heat transfer, solid stress, surface film to solve
complex multi-region, multi-physics problems and are now the primary mechanism
for the further development of OpenFOAM simulation capability in future.  To
emphasis this for both users and developers the applications/solvers directory
has been separated into applications/modules containing all the solver modules:

├── modules
│   ├── compressibleMultiphaseVoF
│   ├── compressibleVoF
│   ├── film
│   ├── fluid
│   ├── fluidSolver
│   ├── functions
│   ├── incompressibleDenseParticleFluid
│   ├── incompressibleDriftFlux
│   ├── incompressibleFluid
│   ├── incompressibleMultiphaseVoF
│   ├── incompressibleVoF
│   ├── isothermalFilm
│   ├── isothermalFluid
│   ├── movingMesh
│   ├── multicomponentFluid
│   ├── multiphaseEuler
│   ├── multiphaseVoFSolver
│   ├── shockFluid
│   ├── solid
│   ├── solidDisplacement
│   ├── twoPhaseSolver
│   ├── twoPhaseVoFSolver
│   ├── VoFSolver
│   └── XiFluid

applications/solvers containing the foamRun and foamMultiRun solver applications
which instantiate and execute the chosen solver modules and also standalone
solver applications for special initialisation and test activities:

├── solvers
│   ├── boundaryFoam
│   ├── chemFoam
│   ├── foamMultiRun
│   ├── foamRun
│   └── potentialFoam

and applications/legacy containing legacy solver applications which are not
currently being actively developed but the functionality of which will be merged
into the solver modules or form the basis of new solver modules as the need
arises:

├── legacy
│   ├── basic
│   │   ├── financialFoam
│   │   └── laplacianFoam
│   ├── combustion
│   │   └── PDRFoam
│   ├── compressible
│   │   └── rhoPorousSimpleFoam
│   ├── electromagnetics
│   │   ├── electrostaticFoam
│   │   ├── magneticFoam
│   │   └── mhdFoam
│   ├── incompressible
│   │   ├── adjointShapeOptimisationFoam
│   │   ├── dnsFoam
│   │   ├── icoFoam
│   │   ├── porousSimpleFoam
│   │   └── shallowWaterFoam
│   └── lagrangian
│       ├── dsmcFoam
│       ├── mdEquilibrationFoam
│       └── mdFoam

Correspondingly the tutorials directory structure has been reorganised with the
modular solver directories at the top level with names that make it easier for
users to find example cases relating to their particular requirements and a
legacy sub-directory containing cases corresponding to the legacy solver
applications listed above:

├── compressibleMultiphaseVoF
│   └── damBreak4phaseLaminar
├── compressibleVoF
│   ├── ballValve
│   ├── climbingRod
│   ├── damBreak
│   ├── depthCharge2D
│   ├── depthCharge3D
│   ├── sloshingTank2D
│   └── throttle
├── film
│   └── rivuletPanel
├── fluid
│   ├── aerofoilNACA0012
│   ├── aerofoilNACA0012Steady
│   ├── angledDuct
│   ├── angledDuctExplicitFixedCoeff
│   ├── angledDuctLTS
│   ├── annularThermalMixer
│   ├── BernardCells
│   ├── blockedChannel
│   ├── buoyantCavity
│   ├── cavity
│   ├── decompressionTank
│   ├── externalCoupledCavity
│   ├── forwardStep
│   ├── helmholtzResonance
│   ├── hotRadiationRoom
│   ├── hotRadiationRoomFvDOM
│   ├── hotRoom
│   ├── hotRoomBoussinesq
│   ├── hotRoomBoussinesqSteady
│   ├── hotRoomComfort
│   ├── iglooWithFridges
│   ├── mixerVessel2DMRF
│   ├── nacaAirfoil
│   ├── pitzDaily
│   ├── prism
│   ├── shockTube
│   ├── squareBend
│   ├── squareBendLiq
│   └── squareBendLiqSteady
├── incompressibleDenseParticleFluid
│   ├── column
│   ├── cyclone
│   ├── Goldschmidt
│   ├── GoldschmidtMPPIC
│   └── injectionChannel
├── incompressibleDriftFlux
│   ├── dahl
│   ├── mixerVessel2DMRF
│   └── tank3D
├── incompressibleFluid
│   ├── airFoil2D
│   ├── ballValve
│   ├── blockedChannel
│   ├── cavity
│   ├── cavityCoupledU
│   ├── channel395
│   ├── drivaerFastback
│   ├── ductSecondaryFlow
│   ├── elipsekkLOmega
│   ├── flowWithOpenBoundary
│   ├── hopperParticles
│   ├── impeller
│   ├── mixerSRF
│   ├── mixerVessel2D
│   ├── mixerVessel2DMRF
│   ├── mixerVesselHorizontal2DParticles
│   ├── motorBike
│   ├── motorBikeSteady
│   ├── movingCone
│   ├── offsetCylinder
│   ├── oscillatingInlet
│   ├── pipeCyclic
│   ├── pitzDaily
│   ├── pitzDailyLES
│   ├── pitzDailyLESDevelopedInlet
│   ├── pitzDailyLTS
│   ├── pitzDailyPulse
│   ├── pitzDailyScalarTransport
│   ├── pitzDailySteady
│   ├── pitzDailySteadyExperimentalInlet
│   ├── pitzDailySteadyMappedToPart
│   ├── pitzDailySteadyMappedToRefined
│   ├── planarContraction
│   ├── planarCouette
│   ├── planarPoiseuille
│   ├── porousBlockage
│   ├── propeller
│   ├── roomResidenceTime
│   ├── rotor2DRotating
│   ├── rotor2DSRF
│   ├── rotorDisk
│   ├── T3A
│   ├── TJunction
│   ├── TJunctionFan
│   ├── turbineSiting
│   ├── waveSubSurface
│   ├── windAroundBuildings
│   └── wingMotion
├── incompressibleMultiphaseVoF
│   ├── damBreak4phase
│   ├── damBreak4phaseFineLaminar
│   ├── damBreak4phaseLaminar
│   └── mixerVessel2DMRF
├── incompressibleVoF
│   ├── angledDuct
│   ├── capillaryRise
│   ├── cavitatingBullet
│   ├── climbingRod
│   ├── containerDischarge2D
│   ├── damBreak
│   ├── damBreakLaminar
│   ├── damBreakPorousBaffle
│   ├── damBreakWithObstacle
│   ├── DTCHull
│   ├── DTCHullMoving
│   ├── DTCHullWave
│   ├── floatingObject
│   ├── floatingObjectWaves
│   ├── forcedUpstreamWave
│   ├── mixerVessel
│   ├── mixerVessel2DMRF
│   ├── mixerVesselHorizontal2D
│   ├── nozzleFlow2D
│   ├── planingHullW3
│   ├── propeller
│   ├── sloshingCylinder
│   ├── sloshingTank2D
│   ├── sloshingTank2D3DoF
│   ├── sloshingTank3D
│   ├── sloshingTank3D3DoF
│   ├── sloshingTank3D6DoF
│   ├── testTubeMixer
│   ├── waterChannel
│   ├── wave
│   ├── wave3D
│   └── weirOverflow
├── isothermalFilm
│   └── rivuletPanel
├── isothermalFluid
│   ├── potentialFreeSurfaceMovingOscillatingBox
│   └── potentialFreeSurfaceOscillatingBox
├── legacy
│   ├── basic
│   │   ├── financialFoam
│   │   │   └── europeanCall
│   │   └── laplacianFoam
│   │       └── flange
│   ├── combustion
│   │   └── PDRFoam
│   │       └── flamePropagationWithObstacles
│   ├── compressible
│   │   └── rhoPorousSimpleFoam
│   │       ├── angledDuctExplicit
│   │       └── angledDuctImplicit
│   ├── electromagnetics
│   │   ├── electrostaticFoam
│   │   │   └── chargedWire
│   │   └── mhdFoam
│   │       └── hartmann
│   ├── incompressible
│   │   ├── adjointShapeOptimisationFoam
│   │   │   └── pitzDaily
│   │   ├── dnsFoam
│   │   │   └── boxTurb16
│   │   ├── icoFoam
│   │   │   ├── cavity
│   │   │   └── elbow
│   │   ├── porousSimpleFoam
│   │   │   ├── angledDuctExplicit
│   │   │   └── angledDuctImplicit
│   │   └── shallowWaterFoam
│   │       └── squareBump
│   ├── lagrangian
│   │   ├── dsmcFoam
│   │   │   ├── freeSpacePeriodic
│   │   │   ├── freeSpaceStream
│   │   │   ├── supersonicCorner
│   │   │   └── wedge15Ma5
│   │   ├── mdEquilibrationFoam
│   │   │   ├── periodicCubeArgon
│   │   │   └── periodicCubeWater
│   │   └── mdFoam
│   │       └── nanoNozzle
├── mesh
│   ├── blockMesh
│   │   ├── pipe
│   │   ├── sphere
│   │   ├── sphere7
│   │   └── sphere7ProjectedEdges
│   ├── refineMesh
│   │   └── refineFieldDirs
│   └── snappyHexMesh
│       ├── flange
│       └── pipe
├── movingMesh
│   └── SnakeRiverCanyon
├── multicomponentFluid
│   ├── aachenBomb
│   ├── counterFlowFlame2D
│   ├── counterFlowFlame2D_GRI
│   ├── counterFlowFlame2D_GRI_TDAC
│   ├── counterFlowFlame2DLTS
│   ├── counterFlowFlame2DLTS_GRI_TDAC
│   ├── DLR_A_LTS
│   ├── filter
│   ├── lockExchange
│   ├── membrane
│   ├── nc7h16
│   ├── parcelInBox
│   ├── SandiaD_LTS
│   ├── simplifiedSiwek
│   ├── smallPoolFire2D
│   ├── smallPoolFire3D
│   ├── verticalChannel
│   ├── verticalChannelLTS
│   └── verticalChannelSteady
├── multiphaseEuler
│   ├── bed
│   ├── bubbleColumn
│   ├── bubbleColumnEvaporating
│   ├── bubbleColumnEvaporatingDissolving
│   ├── bubbleColumnEvaporatingReacting
│   ├── bubbleColumnIATE
│   ├── bubbleColumnLaminar
│   ├── bubbleColumnLES
│   ├── bubblePipe
│   ├── damBreak4phase
│   ├── fluidisedBed
│   ├── fluidisedBedLaminar
│   ├── Grossetete
│   ├── hydrofoil
│   ├── injection
│   ├── LBend
│   ├── mixerVessel2D
│   ├── mixerVessel2DMRF
│   ├── pipeBend
│   ├── steamInjection
│   ├── titaniaSynthesis
│   ├── titaniaSynthesisSurface
│   ├── wallBoilingIATE
│   ├── wallBoilingPolydisperse
│   └── wallBoilingPolydisperseTwoGroups
├── multiRegion
│   ├── CHT
│   │   ├── circuitBoardCooling
│   │   ├── coolingCylinder2D
│   │   ├── coolingSphere
│   │   ├── heatedDuct
│   │   ├── heatExchanger
│   │   ├── multiphaseCoolingCylinder2D
│   │   ├── reverseBurner
│   │   ├── shellAndTubeHeatExchanger
│   │   ├── VoFcoolingCylinder2D
│   │   └── wallBoiling
│   └── film
│       ├── cylinder
│       ├── cylinderDripping
│       ├── cylinderVoF
│       ├── hotBoxes
│       ├── rivuletBox
│       ├── rivuletPanel
│       ├── splashPanel
│       └── VoFToFilm
├── potentialFoam
│   ├── cylinder
│   └── pitzDaily
├── resources
│   ├── blockMesh
│   ├── geometry
│   └── thermoData
├── shockFluid
│   ├── biconic25-55Run35
│   ├── forwardStep
│   ├── LadenburgJet60psi
│   ├── movingCone
│   ├── obliqueShock
│   ├── shockTube
│   └── wedge15Ma5
├── solidDisplacement
│   ├── beamEndLoad
│   └── plateHole
└── XiFluid
    ├── kivaTest
    └── moriyoshiHomogeneous
This commit is contained in:
Henry Weller
2023-05-25 18:14:41 +01:00
parent 20c181c5c0
commit e744fdb5f1
6180 changed files with 490 additions and 763 deletions

View File

@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "dispersedDisplacedPhaseInterface.H"
#include "dispersedPhaseInterface.H"
#include "displacedPhaseInterface.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebugWithName
(
dispersedDisplacedPhaseInterface,
separatorsToTypeName
({
dispersedPhaseInterface::separator(),
displacedPhaseInterface::separator()
}).c_str(),
0
);
addToRunTimeSelectionTable
(
phaseInterface,
dispersedDisplacedPhaseInterface,
word
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dispersedDisplacedPhaseInterface::dispersedDisplacedPhaseInterface
(
const phaseModel& dispersed,
const phaseModel& continuous,
const phaseModel& displacing
)
:
phaseInterface(dispersed, continuous),
dispersedPhaseInterface(dispersed, continuous),
displacedPhaseInterface(dispersed, continuous, displacing)
{}
Foam::dispersedDisplacedPhaseInterface::dispersedDisplacedPhaseInterface
(
const phaseSystem& fluid,
const word& name
)
:
phaseInterface(fluid, name),
dispersedPhaseInterface(fluid, name),
displacedPhaseInterface(fluid, name)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dispersedDisplacedPhaseInterface::~dispersedDisplacedPhaseInterface()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::word Foam::dispersedDisplacedPhaseInterface::name() const
{
return
dispersedPhaseInterface::name()
+ '_'
+ displacedPhaseInterface::separator()
+ '_'
+ displacing().name();
}
// ************************************************************************* //

View File

@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
Class
Foam::dispersedDisplacedPhaseInterface
Description
Class to represent a interface between phases where one phase is considered
dispersed within the other, and the interface has been displaced to some
extent by a third phase.
SourceFiles
dispersedDisplacedPhaseInterface.C
\*---------------------------------------------------------------------------*/
#ifndef dispersedDisplacedPhaseInterface_H
#define dispersedDisplacedPhaseInterface_H
#include "dispersedPhaseInterface.H"
#include "displacedPhaseInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class dispersedDisplacedPhaseInterface Declaration
\*---------------------------------------------------------------------------*/
class dispersedDisplacedPhaseInterface
:
public dispersedPhaseInterface,
public displacedPhaseInterface
{
public:
//- Runtime type information
TypeName("dispersedDisplacedPhaseInterface");
// Constructors
//- Construct from phases
dispersedDisplacedPhaseInterface
(
const phaseModel& dispersed,
const phaseModel& continuous,
const phaseModel& displacing
);
//- Construct from fluid and name
dispersedDisplacedPhaseInterface
(
const phaseSystem& fluid,
const word& name
);
//- Destructor
virtual ~dispersedDisplacedPhaseInterface();
// Member Functions
//- Name
virtual word name() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,112 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "dispersedDisplacedSidedPhaseInterface.H"
#include "dispersedDisplacedPhaseInterface.H"
#include "displacedSidedPhaseInterface.H"
#include "dispersedSidedPhaseInterface.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebugWithName
(
dispersedDisplacedSidedPhaseInterface,
separatorsToTypeName
({
dispersedPhaseInterface::separator(),
displacedPhaseInterface::separator(),
sidedPhaseInterface::separator()
}).c_str(),
0
);
addToRunTimeSelectionTable
(
phaseInterface,
dispersedDisplacedSidedPhaseInterface,
word
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dispersedDisplacedSidedPhaseInterface::
dispersedDisplacedSidedPhaseInterface
(
const phaseModel& dispersed,
const phaseModel& continuous,
const phaseModel& displacing,
const phaseModel& phase
)
:
phaseInterface(dispersed, continuous),
dispersedPhaseInterface(dispersed, continuous),
displacedPhaseInterface(dispersed, continuous, displacing),
sidedPhaseInterface(phase, phaseInterface::otherPhase(phase))
{}
Foam::dispersedDisplacedSidedPhaseInterface::
dispersedDisplacedSidedPhaseInterface
(
const phaseSystem& fluid,
const word& name
)
:
phaseInterface(fluid, name),
dispersedPhaseInterface(fluid, name),
displacedPhaseInterface(fluid, name),
sidedPhaseInterface(fluid, name)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dispersedDisplacedSidedPhaseInterface::
~dispersedDisplacedSidedPhaseInterface()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::word Foam::dispersedDisplacedSidedPhaseInterface::name() const
{
return
dispersedPhaseInterface::name()
+ '_'
+ displacedPhaseInterface::separator()
+ '_'
+ displacing().name()
+ '_'
+ sidedPhaseInterface::separator()
+ '_'
+ phase().name();
}
// ************************************************************************* //

View File

@ -0,0 +1,103 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
Class
Foam::dispersedDisplacedSidedPhaseInterface
Description
Class to represent a certain side of an interface between phases, where one
phase is considered dispersed within the other, and the interface has been
displaced to some extent by a third phase.
SourceFiles
dispersedDisplacedSidedPhaseInterface.C
\*---------------------------------------------------------------------------*/
#ifndef dispersedDisplacedSidedPhaseInterface_H
#define dispersedDisplacedSidedPhaseInterface_H
#include "dispersedPhaseInterface.H"
#include "displacedPhaseInterface.H"
#include "sidedPhaseInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class dispersedDisplacedSidedPhaseInterface Declaration
\*---------------------------------------------------------------------------*/
class dispersedDisplacedSidedPhaseInterface
:
public dispersedPhaseInterface,
public displacedPhaseInterface,
public sidedPhaseInterface
{
public:
//- Runtime type information
TypeName("dispersedDisplacedSidedPhaseInterface");
// Constructors
//- Construct from phases
dispersedDisplacedSidedPhaseInterface
(
const phaseModel& dispersed,
const phaseModel& continuous,
const phaseModel& displacing,
const phaseModel& phase
);
//- Construct from fluid and name
dispersedDisplacedSidedPhaseInterface
(
const phaseSystem& fluid,
const word& name
);
//- Destructor
virtual ~dispersedDisplacedSidedPhaseInterface();
// Member Functions
//- Name
virtual word name() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,167 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "dispersedPhaseInterface.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
bool dispersedPhaseInterfaceAddedHeadSeparator =
phaseInterface::addHeadSeparator(dispersedPhaseInterface::separator());
bool dispersedPhaseInterfaceAddedOldSeparatorToSeparator =
phaseInterface::addOldSeparatorToSeparator
(
"in",
dispersedPhaseInterface::separator()
);
}
namespace Foam
{
defineTypeNameAndDebugWithName
(
dispersedPhaseInterface,
separatorsToTypeName({separator()}).c_str(),
0
);
addToRunTimeSelectionTable(phaseInterface, dispersedPhaseInterface, word);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dispersedPhaseInterface::dispersedPhaseInterface
(
const phaseModel& dispersed,
const phaseModel& continuous
)
:
phaseInterface(dispersed, continuous),
dispersed_(dispersed)
{}
Foam::dispersedPhaseInterface::dispersedPhaseInterface
(
const phaseSystem& fluid,
const word& name
)
:
phaseInterface(fluid, name),
dispersed_(identifyPhases(fluid, name, {separator()}).first())
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dispersedPhaseInterface::~dispersedPhaseInterface()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::word Foam::dispersedPhaseInterface::name() const
{
return dispersed().name() + '_' + separator() + '_' + continuous().name();
}
const Foam::phaseModel& Foam::dispersedPhaseInterface::dispersed() const
{
return dispersed_;
}
const Foam::phaseModel& Foam::dispersedPhaseInterface::continuous() const
{
return otherPhase(dispersed_);
}
Foam::tmp<Foam::volVectorField> Foam::dispersedPhaseInterface::Ur() const
{
return dispersed().U() - continuous().U();
}
Foam::tmp<Foam::volScalarField> Foam::dispersedPhaseInterface::Re() const
{
return magUr()*dispersed().d()/continuous().thermo().nu();
}
Foam::tmp<Foam::volScalarField> Foam::dispersedPhaseInterface::Pr() const
{
return
continuous().thermo().nu()
*continuous().thermo().Cp()
*continuous().rho()
/continuous().thermo().kappa();
}
Foam::tmp<Foam::volScalarField> Foam::dispersedPhaseInterface::Eo() const
{
return Eo(dispersed().d());
}
Foam::tmp<Foam::volScalarField> Foam::dispersedPhaseInterface::Eo
(
const volScalarField& d
) const
{
return
mag(dispersed().rho() - continuous().rho())
*mag(g())
*sqr(d)
/sigma();
}
Foam::tmp<Foam::volScalarField> Foam::dispersedPhaseInterface::Mo() const
{
return
mag(g())
*continuous().thermo().nu()
*pow3
(
continuous().thermo().nu()
*continuous().rho()
/sigma()
);
}
Foam::tmp<Foam::volScalarField> Foam::dispersedPhaseInterface::Ta() const
{
return Re()*pow(Mo(), 0.23);
}
// ************************************************************************* //

View File

@ -0,0 +1,146 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
Class
Foam::dispersedPhaseInterface
Description
Class to represent a interface between phases where one phase is considered
dispersed within the other.
SourceFiles
dispersedPhaseInterface.C
\*---------------------------------------------------------------------------*/
#ifndef dispersedPhaseInterface_H
#define dispersedPhaseInterface_H
#include "phaseInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class dispersedPhaseInterface Declaration
\*---------------------------------------------------------------------------*/
class dispersedPhaseInterface
:
virtual public phaseInterface
{
private:
// Private Data
//- Dispersed phase
const phaseModel& dispersed_;
public:
//- Runtime type information
TypeName("dispersedPhaseInterface");
// Constructors
//- Construct from phases
dispersedPhaseInterface
(
const phaseModel& dispersed,
const phaseModel& continuous
);
//- Construct from fluid and name
dispersedPhaseInterface
(
const phaseSystem& fluid,
const word& name
);
//- Destructor
virtual ~dispersedPhaseInterface();
// Static Member Functions
//- Return the separator that delimits this interface's name
static word separator()
{
return "dispersedIn";
}
// Member Functions
//- Name
virtual word name() const;
// Access
//- Dispersed phase
const phaseModel& dispersed() const;
//- Continuous phase
const phaseModel& continuous() const;
// Properties
//- Relative velocity
tmp<volVectorField> Ur() const;
//- Reynolds number
tmp<volScalarField> Re() const;
//- Prandtl number
tmp<volScalarField> Pr() const;
//- Eotvos number
tmp<volScalarField> Eo() const;
//- Eotvos number for given diameter
tmp<volScalarField> Eo(const volScalarField& d) const;
//- Morton Number
tmp<volScalarField> Mo() const;
//- Takahashi Number
tmp<volScalarField> Ta() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,98 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "dispersedSidedPhaseInterface.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebugWithName
(
dispersedSidedPhaseInterface,
separatorsToTypeName
({
dispersedPhaseInterface::separator(),
sidedPhaseInterface::separator()
}).c_str(),
0
);
addToRunTimeSelectionTable
(
phaseInterface,
dispersedSidedPhaseInterface,
word
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dispersedSidedPhaseInterface::dispersedSidedPhaseInterface
(
const phaseModel& dispersed,
const phaseModel& continuous,
const phaseModel& phase
)
:
phaseInterface(dispersed, continuous),
dispersedPhaseInterface(dispersed, continuous),
sidedPhaseInterface(phase, phaseInterface::otherPhase(phase))
{}
Foam::dispersedSidedPhaseInterface::dispersedSidedPhaseInterface
(
const phaseSystem& fluid,
const word& name
)
:
phaseInterface(fluid, name),
dispersedPhaseInterface(fluid, name),
sidedPhaseInterface(fluid, name)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dispersedSidedPhaseInterface::~dispersedSidedPhaseInterface()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::word Foam::dispersedSidedPhaseInterface::name() const
{
return
dispersedPhaseInterface::name()
+ '_'
+ sidedPhaseInterface::separator()
+ '_'
+ phase().name();
}
// ************************************************************************* //

View File

@ -0,0 +1,99 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
Class
Foam::dispersedSidedPhaseInterface
Description
Class to represent a certain side of an interface between phases where one
phase is considered dispersed within the other.
SourceFiles
dispersedSidedPhaseInterface.C
\*---------------------------------------------------------------------------*/
#ifndef dispersedSidedPhaseInterface_H
#define dispersedSidedPhaseInterface_H
#include "dispersedPhaseInterface.H"
#include "sidedPhaseInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class dispersedSidedPhaseInterface Declaration
\*---------------------------------------------------------------------------*/
class dispersedSidedPhaseInterface
:
public dispersedPhaseInterface,
public sidedPhaseInterface
{
public:
//- Runtime type information
TypeName("dispersedSidedPhaseInterface");
// Constructors
//- Construct from phases
dispersedSidedPhaseInterface
(
const phaseModel& dispersed,
const phaseModel& continuous,
const phaseModel& phase
);
//- Construct from fluid and name
dispersedSidedPhaseInterface
(
const phaseSystem& fluid,
const word& name
);
//- Destructor
virtual ~dispersedSidedPhaseInterface();
// Member Functions
//- Name
virtual word name() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,104 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "displacedPhaseInterface.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebugWithName
(
displacedPhaseInterface,
separatorsToTypeName
({
phaseInterface::separator(),
separator()
}).c_str(),
0
);
addToRunTimeSelectionTable(phaseInterface, displacedPhaseInterface, word);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::displacedPhaseInterface::displacedPhaseInterface
(
const phaseModel& phase1,
const phaseModel& phase2,
const phaseModel& displacing
)
:
phaseInterface(phase1, phase2),
displacing_(displacing)
{}
Foam::displacedPhaseInterface::displacedPhaseInterface
(
const phaseSystem& fluid,
const word& name
)
:
phaseInterface(fluid, name),
displacing_(identifyPhases(fluid, name, {separator()}).second())
{
if (contains(displacing_))
{
FatalErrorInFunction
<< "Interface " << name << " is not valid. An interface cannot "
<< "be displaced by one of its own phases." << exit(FatalError);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::displacedPhaseInterface::~displacedPhaseInterface()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::word Foam::displacedPhaseInterface::name() const
{
return
phaseInterface::name()
+ '_'
+ separator()
+ '_'
+ displacing().name();
}
const Foam::phaseModel& Foam::displacedPhaseInterface::displacing() const
{
return displacing_;
}
// ************************************************************************* //

View File

@ -0,0 +1,120 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
Class
Foam::displacedPhaseInterface
Description
Class to represent an interface between phases which has been displaced to
some extent by a third phase.
SourceFiles
displacedPhaseInterface.C
\*---------------------------------------------------------------------------*/
#ifndef displacedPhaseInterface_H
#define displacedPhaseInterface_H
#include "phaseInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class displacedPhaseInterface Declaration
\*---------------------------------------------------------------------------*/
class displacedPhaseInterface
:
virtual public phaseInterface
{
private:
// Private Data
//- Displacing phase
const phaseModel& displacing_;
public:
//- Runtime type information
TypeName("displacedPhaseInterface");
// Constructors
//- Construct from phases
displacedPhaseInterface
(
const phaseModel& phase1,
const phaseModel& phase2,
const phaseModel& displacing
);
//- Construct from fluid and name
displacedPhaseInterface
(
const phaseSystem& fluid,
const word& name
);
//- Destructor
virtual ~displacedPhaseInterface();
// Static Member Functions
//- Return the separator that delimits this interface's name
static word separator()
{
return "displacedBy";
}
// Member Functions
//- Name
virtual word name() const;
// Access
//- Displacing phase
const phaseModel& displacing() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,98 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "displacedSidedPhaseInterface.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebugWithName
(
displacedSidedPhaseInterface,
separatorsToTypeName
({
displacedPhaseInterface::separator(),
sidedPhaseInterface::separator()
}).c_str(),
0
);
addToRunTimeSelectionTable
(
phaseInterface,
displacedSidedPhaseInterface,
word
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::displacedSidedPhaseInterface::displacedSidedPhaseInterface
(
const phaseModel& phase,
const phaseModel& otherPhase,
const phaseModel& displacing
)
:
phaseInterface(phase, otherPhase),
displacedPhaseInterface(phase, otherPhase, displacing),
sidedPhaseInterface(phase, otherPhase)
{}
Foam::displacedSidedPhaseInterface::displacedSidedPhaseInterface
(
const phaseSystem& fluid,
const word& name
)
:
phaseInterface(fluid, name),
displacedPhaseInterface(fluid, name),
sidedPhaseInterface(fluid, name)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::displacedSidedPhaseInterface::~displacedSidedPhaseInterface()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::word Foam::displacedSidedPhaseInterface::name() const
{
return
displacedPhaseInterface::name()
+ '_'
+ sidedPhaseInterface::separator()
+ '_'
+ phase().name();
}
// ************************************************************************* //

View File

@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
Class
Foam::displacedSidedPhaseInterface
Description
Class to represent a certain side of an interface between phases, where the
interface has been displaced to some extent by a third phase.
SourceFiles
displacedSidedPhaseInterface.C
\*---------------------------------------------------------------------------*/
#ifndef displacedSidedPhaseInterface_H
#define displacedSidedPhaseInterface_H
#include "segregatedPhaseInterface.H"
#include "displacedPhaseInterface.H"
#include "sidedPhaseInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class displacedSidedPhaseInterface Declaration
\*---------------------------------------------------------------------------*/
class displacedSidedPhaseInterface
:
public displacedPhaseInterface,
public sidedPhaseInterface
{
public:
//- Runtime type information
TypeName("displacedSidedPhaseInterface");
// Constructors
//- Construct from phases
displacedSidedPhaseInterface
(
const phaseModel& phase,
const phaseModel& otherPhase,
const phaseModel& displacing
);
//- Construct from fluid and name
displacedSidedPhaseInterface
(
const phaseSystem& fluid,
const word& name
);
//- Destructor
virtual ~displacedSidedPhaseInterface();
// Member Functions
//- Name
virtual word name() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,521 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "phaseInterface.H"
#include "phaseSystem.H"
#include "interfaceSurfaceTensionModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
wordList phaseInterface::headSeparators_ = Foam::wordList();
bool phaseInterfaceAddedHeadSeparator =
phaseInterface::addHeadSeparator(Foam::word::null);
HashTable<word> phaseInterface::oldSeparatorToSeparator_ =
Foam::HashTable<word>();
}
namespace Foam
{
defineTypeNameAndDebugWithName
(
phaseInterface,
separatorsToTypeName(wordList(1, word::null)).c_str(),
0
);
defineRunTimeSelectionTable(phaseInterface, word);
addToRunTimeSelectionTable(phaseInterface, phaseInterface, word);
}
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
const Foam::phaseModel& Foam::phaseInterface::getPhase1
(
const phaseModel& phase1,
const phaseModel& phase2
)
{
return phase1.index() < phase2.index() ? phase1 : phase2;
}
const Foam::phaseModel& Foam::phaseInterface::getPhase2
(
const phaseModel& phase1,
const phaseModel& phase2
)
{
return phase1.index() < phase2.index() ? phase2 : phase1;
}
bool Foam::phaseInterface::addHeadSeparator(const word& separator)
{
if (findIndex(headSeparators_, separator) == -1)
{
headSeparators_.append(separator);
return true;
}
else
{
return false;
}
}
bool Foam::phaseInterface::addOldSeparatorToSeparator
(
const word& oldSeparator,
const word& separator
)
{
return oldSeparatorToSeparator_.insert(oldSeparator, separator);
}
Foam::wordList Foam::phaseInterface::nameToNameParts
(
const phaseSystem& fluid,
const word& name
)
{
auto error = [&]()
{
FatalErrorInFunction
<< "Could not parse interface name \""
<< name << "\"" << exit(FatalError);
};
wordList nameParts;
word::size_type i = 0;
while (true)
{
// Match potentially multiple phases
label nPhaseNameParts = 0;
while (true)
{
// Match the longest possible phase name
word phaseNamePart;
forAll(fluid.phases(), phasei)
{
const word& phaseName =
fluid.phases()[phasei].name();
if
(
phaseNamePart.size() < phaseName.size()
&& name.size() - i >= phaseName.size()
&& name(i, phaseName.size()) == phaseName
)
{
nPhaseNameParts ++;
phaseNamePart = phaseName;
}
}
if (phaseNamePart == word::null) break;
// Add the phase name part
nameParts.append(phaseNamePart);
i += phaseNamePart.size();
// Break if at the end
if (i == name.size()) break;
// Add an empty separator
nameParts.append(word::null);
// Pass the underscore
if (name[i] != '_') error();
i += 1;
}
// Error if we haven't matched any phases
if (nPhaseNameParts == 0) error();
// Break if at the end
if (i == name.size()) break;
// Match and add a non-empty separator
const word::size_type j = name.find_first_of('_', i);
if (j == word::npos) error();
nameParts.last() = name(i, j - i);
i = j;
// Pass the underscore
if (name[i] != '_') error();
i += 1;
}
return nameParts;
}
Foam::wordList Foam::phaseInterface::nameToSeparators
(
const phaseSystem& fluid,
const word& name
)
{
const wordList nameParts = nameToNameParts(fluid, name);
wordList separators(nameParts.size()/2);
forAll(separators, separatori)
{
separators[separatori] = nameParts[2*separatori + 1];
}
return separators;
}
Foam::word Foam::phaseInterface::separatorsToTypeName
(
const wordList& separatorsUnsorted
)
{
// Take a copy of the separators
wordList separators(separatorsUnsorted);
// Sort all but the first
SubList<word> tailSeparators(separators, separators.size() - 1, 1);
Foam::sort(tailSeparators);
// Stitch back together using a placeholder phase name
static const word phaseName = "<phase>";
word typeName = phaseName;
forAll(separators, separatori)
{
typeName.append
(
'_'
+ separators[separatori]
+ (separators[separatori].empty() ? "" : "_")
+ phaseName
);
}
return typeName;
}
Foam::word Foam::phaseInterface::nameToTypeName
(
const phaseSystem& fluid,
const word& name
)
{
return separatorsToTypeName(nameToSeparators(fluid, name));
}
Foam::word Foam::phaseInterface::namePartsToName
(
const phaseSystem& fluid,
const wordList& nameParts
)
{
word name;
forAll(nameParts, i)
{
if (nameParts[i] != word::null)
{
name.append(nameParts[i] + "_");
}
}
return name(name.size() - 1);
}
Foam::word Foam::phaseInterface::oldNamePartsToName
(
const phaseSystem& fluid,
const wordList& oldNameParts
)
{
word name;
forAll(oldNameParts, i)
{
// Phase name part
if (fluid.phases().found(oldNameParts[i]))
{
name.append(oldNameParts[i] + "_");
}
// Separator
else
{
const word& oldSeparator = oldNameParts[i];
const word& separator = oldSeparatorToSeparator_[oldSeparator];
if (separator != word::null)
{
name.append(separator + "_");
}
}
}
return name(name.size() - 1);
}
Foam::Tuple2<const Foam::phaseModel&, const Foam::phaseModel&>
Foam::phaseInterface::identifyPhases
(
const phaseSystem& fluid,
const word& name,
const wordList& separators
)
{
const wordList nameParts = nameToNameParts(fluid, name);
label nameParti = -1;
bool multiple = false;
for (label namePartj = 1; namePartj < nameParts.size() - 1; namePartj += 2)
{
forAll(separators, separatori)
{
if (nameParts[namePartj] == separators[separatori])
{
multiple = multiple || nameParti != -1;
nameParti = namePartj;
}
}
}
if (nameParti == -1)
{
FatalErrorInFunction
<< "No matches identified in \"" << name
<< "\" for separators " << separators << exit(FatalError);
}
if (multiple)
{
FatalErrorInFunction
<< "Multiple matches identified in \"" << name
<< "\" for separators " << separators << exit(FatalError);
}
return
Tuple2<const phaseModel&, const phaseModel&>
(
fluid.phases()[nameParts[nameParti - 1]],
fluid.phases()[nameParts[nameParti + 1]]
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::phaseInterface::phaseInterface
(
const phaseModel& phase1,
const phaseModel& phase2
)
:
phase1_(getPhase1(phase1, phase2)),
phase2_(getPhase2(phase1, phase2)),
g_(phase1.mesh().lookupObject<uniformDimensionedVectorField>("g"))
{}
Foam::phaseInterface::phaseInterface
(
const Tuple2<const phaseModel&, const phaseModel&>& phases
)
:
phaseInterface(phases.first(), phases.second())
{}
Foam::phaseInterface::phaseInterface
(
const phaseSystem& fluid,
const word& name
)
:
phaseInterface(identifyPhases(fluid, name, headSeparators_))
{}
Foam::phaseInterface::phaseInterface
(
const phaseSystem& fluid,
const phaseInterfaceKey& key
)
:
phaseInterface(fluid.phases()[key.first()], fluid.phases()[key.second()])
{}
Foam::autoPtr<Foam::phaseInterface> Foam::phaseInterface::clone() const
{
return New(fluid(), name());
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::phaseInterface::~phaseInterface()
{}
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::phaseInterface> Foam::phaseInterface::New
(
const phaseSystem& fluid,
const word& name
)
{
wordConstructorTable::iterator cstrIter =
wordConstructorTablePtr_->find(nameToTypeName(fluid, name));
if (cstrIter == wordConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown phaseInterface type "
<< name << endl << endl
<< "Valid phaseInterface types are : " << endl
<< wordConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(fluid, name);
}
Foam::autoPtr<Foam::phaseInterface> Foam::phaseInterface::New
(
const phaseInterface& interface1,
const phaseInterface& interface2
)
{
const phaseSystem& fluid = interface1.fluid();
auto error = [&]()
{
FatalErrorInFunction
<< "Could not combine interfaces " << interface1.name()
<< " and " << interface2.name() << exit(FatalError);
};
// Split the names into parts
const wordList nameParts1 = nameToNameParts(fluid, interface1.name());
const wordList nameParts2 = nameToNameParts(fluid, interface2.name());
// Check the heads are consistent
const Pair<word> headNames1(nameParts1[0], nameParts1[2]);
const Pair<word> headNames2(nameParts2[0], nameParts2[2]);
const word& headSeparator1 = nameParts1[1];
const word& headSeparator2 = nameParts2[1];
const label headNamesCompare = Pair<word>::compare(headNames1, headNames2);
const bool haveBothHeadSeparators =
headSeparator1 != word::null && headSeparator2 != word::null;
if
(
(headNamesCompare == 0)
|| (haveBothHeadSeparators && headSeparator1 != headSeparator2)
|| (haveBothHeadSeparators && headNamesCompare != 1)
)
{
error();
}
// Add the head to the list
wordList nameParts
(
SubList<word>
(
headSeparator1 != word::null ? nameParts1 : nameParts2,
3
)
);
// Add the tail from interface 1
for (label i1 = 3; i1 < nameParts1.size(); i1 += 2)
{
nameParts.append(nameParts1[i1]);
nameParts.append(nameParts1[i1 + 1]);
}
// Add the tail from interface 2, filtering out duplicates
for (label i2 = 3; i2 < nameParts2.size(); i2 += 2)
{
bool append2 = true;
for (label i1 = 3; i1 < nameParts1.size(); i1 += 2)
{
if (nameParts1[i1] == nameParts2[i2])
{
if (nameParts1[i1 + 1] != nameParts2[i2 + 1]) error();
append2 = false;
}
}
if (append2)
{
nameParts.append(nameParts2[i2]);
nameParts.append(nameParts2[i2 + 1]);
}
}
// Select the new combined interface
return New(fluid, namePartsToName(fluid, nameParts));
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::word Foam::phaseInterface::name() const
{
return phase1().name() + "_" + phase2().name();
}
Foam::tmp<Foam::volScalarField> Foam::phaseInterface::rho() const
{
return phase1()*phase1().rho() + phase2()*phase2().rho();
}
Foam::tmp<Foam::volScalarField> Foam::phaseInterface::magUr() const
{
return mag(phase1().U() - phase2().U());
}
Foam::tmp<Foam::volScalarField> Foam::phaseInterface::sigma() const
{
return fluid().sigma(*this);
}
// ************************************************************************* //

View File

@ -0,0 +1,426 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
Class
Foam::phaseInterface
Description
Class to represent an interface between phases. Derivations can further
specify the configuration of that interface; e.g., representing dispersal,
displacement or sidedness.
SourceFiles
phaseInterface.C
phaseInterfaceI.H
\*---------------------------------------------------------------------------*/
#ifndef phaseInterface_H
#define phaseInterface_H
#include "phaseModel.H"
#include "compressibleTwoPhases.H"
#include "uniformDimensionedFields.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phaseInterfaceKey;
/*---------------------------------------------------------------------------*\
Class phaseInterface Declaration
\*---------------------------------------------------------------------------*/
class phaseInterface
:
public compressibleTwoPhases
{
private:
// Private Static Data
//- List of head separators. This is the first separator in an
// interface name, and it delimits the names of phases on either side
// of the interface. Other separators are modifiers (e.g.,
// displacedBy, inThe, ...).
static wordList headSeparators_;
//- Map from old-format separators to separators
static HashTable<word> oldSeparatorToSeparator_;
public:
// Public Static Functions
//- Get a reference to phase1 after sorting the phases by index
static const phaseModel& getPhase1
(
const phaseModel& phase1,
const phaseModel& phase2
);
//- Get a reference to phase2 after sorting the phases by index
static const phaseModel& getPhase2
(
const phaseModel& phase1,
const phaseModel& phase2
);
//- Add a head separator to the list
static bool addHeadSeparator(const word& separator);
//- Add a old separator to separator to the table
static bool addOldSeparatorToSeparator
(
const word& oldSeparator,
const word& separator
);
//- Split an interface name and return all its parts
static wordList nameToNameParts
(
const phaseSystem& fluid,
const word& name
);
//- Split an interface name and return its separators
static wordList nameToSeparators
(
const phaseSystem& fluid,
const word& name
);
//- Convert a list of separators into a type name
static word separatorsToTypeName
(
const wordList& separators
);
//- Convert an interface name into a type name. Essentially just
// replaces valid phase names with a "<phase>" placeholder.
static word nameToTypeName
(
const phaseSystem& fluid,
const word& name
);
//- Convert interface name parts to an interface name
static word namePartsToName
(
const phaseSystem& fluid,
const wordList& nameParts
);
//- Convert old-format interface name parts to an interface name. Used
// in phaseSystem to provide backwards compatible input.
static word oldNamePartsToName
(
const phaseSystem& fluid,
const wordList& oldNameParts
);
//- Return references to the phases associated with a given name, and a
// list of valid separators
static Tuple2<const phaseModel&, const phaseModel&> identifyPhases
(
const phaseSystem& fluid,
const word& name,
const wordList& separators
);
private:
// Private Data
//- Phase 1
const phaseModel& phase1_;
//- Phase 2
const phaseModel& phase2_;
//- Gravitational acceleration
const uniformDimensionedVectorField& g_;
public:
//- Runtime type information
TypeName("phaseInterface");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
phaseInterface,
word,
(
const phaseSystem& fluid,
const word& name
),
(fluid, name)
);
// Constructors
//- Construct from phases
phaseInterface
(
const phaseModel& phase1,
const phaseModel& phase2
);
//- Construct from phases
phaseInterface
(
const Tuple2<const phaseModel&, const phaseModel&>& phases
);
//- Construct from fluid and name
phaseInterface
(
const phaseSystem& fluid,
const word& name
);
//- Construct from fluid and key
phaseInterface
(
const phaseSystem& fluid,
const phaseInterfaceKey& name
);
//- Clone function
virtual autoPtr<phaseInterface> clone() const;
//- Destructor
virtual ~phaseInterface();
// Selectors
//- Select given fluid and name
static autoPtr<phaseInterface> New
(
const phaseSystem& fluid,
const word& name
);
//- Select by combining two interfaces
static autoPtr<phaseInterface> New
(
const phaseInterface& interface1,
const phaseInterface& interface2
);
//- Class used for construction of PtrLists of phaseInterfaces
class iNew
{
const phaseSystem& fluid_;
public:
iNew(const phaseSystem& fluid)
:
fluid_(fluid)
{}
autoPtr<phaseInterface> operator()(Istream& is) const
{
return phaseInterface::New(fluid_, word(is));
}
};
// Static Member Functions
//- Return the separator that delimits this interface's name
static word separator()
{
return word::null;
}
// Member Functions
//- Name
virtual word name() const;
//- Cast to derived type for use in a model
template<class ModelType, class Derived>
const Derived& modelCast() const
{
if (!isA<Derived>(*this))
{
FatalErrorInFunction
<< "Constructing " << ModelType::typeName
<< " for interface " << name()
<< " which is not of the required type "
<< Derived::typeName << exit(FatalError);
}
return refCast<const Derived>(*this);
}
// Access
//- Return the volume fraction of phase 1
virtual inline const volScalarField& alpha1() const;
//- Return the volume fraction of phase 2
virtual inline const volScalarField& alpha2() const;
//- Return the thermo for phase 1
virtual inline const rhoThermo& thermo1() const;
//- Return the thermo for phase 2
virtual inline const rhoThermo& thermo2() const;
//- Return the density of phase 1
virtual inline const volScalarField& rho1() const;
//- Return the density of phase 2
virtual inline const volScalarField& rho2() const;
//- Return phase 1
inline const phaseModel& phase1() const;
//- Return phase 2
inline const phaseModel& phase2() const;
//- Return true if this phaseInterface contains the given phase
inline bool contains(const phaseModel& phase) const;
//- Return the other phase relative to the given phase
// Generates a FatalError if this phaseInterface does not contain
// the given phase
inline const phaseModel& otherPhase(const phaseModel& phase) const;
//- Return the index of the given phase. Generates a FatalError if
// this phaseInterface does not contain the given phase
inline label index(const phaseModel& phase) const;
//- Return the phase system
inline const phaseSystem& fluid() const;
//- Return the mesh
inline const fvMesh& mesh() const;
//- Return gravitational acceleration
inline const uniformDimensionedVectorField& g() const;
// Properties
//- Average density
tmp<volScalarField> rho() const;
//- Relative velocity magnitude
tmp<volScalarField> magUr() const;
//- Surface tension coefficient
tmp<volScalarField> sigma() const;
//- STL const_iterator
class const_iterator
{
// Private Data
//- Reference to the pair for which this is an iterator
const phaseInterface& pair_;
//- Current index
label index_;
//- Construct an iterator with the given index
inline const_iterator(const phaseInterface&, const label index);
public:
friend class phaseInterface;
// Constructors
//- Construct from pair, moving to its 'begin' position
inline explicit const_iterator(const phaseInterface&);
// Access
//- Return the current index
inline label index() const;
// Member Operators
inline bool operator==(const const_iterator&) const;
inline bool operator!=(const const_iterator&) const;
inline const phaseModel& operator*() const;
inline const phaseModel& operator()() const;
inline const phaseModel& otherPhase() const;
inline const_iterator& operator++();
inline const_iterator operator++(int);
};
//- const_iterator set to the beginning of the pair
inline const_iterator cbegin() const;
//- const_iterator set to beyond the end of the pair
inline const_iterator cend() const;
//- const_iterator set to the beginning of the pair
inline const_iterator begin() const;
//- const_iterator set to beyond the end of the pair
inline const_iterator end() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "phaseInterfaceI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,270 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "phaseInterface.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::volScalarField& Foam::phaseInterface::alpha1() const
{
return phase1();
}
inline const Foam::volScalarField& Foam::phaseInterface::alpha2() const
{
return phase2();
}
inline const Foam::rhoThermo& Foam::phaseInterface::thermo1() const
{
return phase1().thermo();
}
inline const Foam::rhoThermo& Foam::phaseInterface::thermo2() const
{
return phase2().thermo();
}
inline const Foam::volScalarField& Foam::phaseInterface::rho1() const
{
return phase1().rho();
}
inline const Foam::volScalarField& Foam::phaseInterface::rho2() const
{
return phase2().rho();
}
inline const Foam::phaseModel& Foam::phaseInterface::phase1() const
{
return phase1_;
}
inline const Foam::phaseModel& Foam::phaseInterface::phase2() const
{
return phase2_;
}
inline bool Foam::phaseInterface::contains(const phaseModel& phase) const
{
return &phase1_ == &phase || &phase2_ == &phase;
}
inline const Foam::phaseModel& Foam::phaseInterface::otherPhase
(
const phaseModel& phase
) const
{
if (&phase1_ == &phase)
{
return phase2_;
}
else if (&phase2_ == &phase)
{
return phase1_;
}
else
{
FatalErrorInFunction
<< "this phaseInterface does not contain phase " << phase.name()
<< exit(FatalError);
return phase;
}
}
inline Foam::label Foam::phaseInterface::index(const phaseModel& phase) const
{
if (&phase1_ == &phase)
{
return 0;
}
else if (&phase2_ == &phase)
{
return 1;
}
else
{
FatalErrorInFunction
<< "this phaseInterface does not contain phase " << phase.name()
<< exit(FatalError);
return -1;
}
}
inline const Foam::phaseSystem& Foam::phaseInterface::fluid() const
{
return phase1().fluid();
}
inline const Foam::fvMesh& Foam::phaseInterface::mesh() const
{
return phase1().mesh();
}
inline const Foam::uniformDimensionedVectorField&
Foam::phaseInterface::g() const
{
return g_;
}
// * * * * * * * * * * * * * * * * Iterators * * * * * * * * * * * * * * * * //
inline Foam::phaseInterface::const_iterator::const_iterator
(
const phaseInterface& pair,
const label index
)
:
pair_(pair),
index_(index)
{}
inline Foam::phaseInterface::const_iterator::const_iterator
(
const phaseInterface& pair
)
:
const_iterator(pair, 0)
{}
inline Foam::label Foam::phaseInterface::const_iterator::index() const
{
return index_;
}
inline bool Foam::phaseInterface::const_iterator::operator==
(
const const_iterator& iter
) const
{
return (this->index_ == iter.index_);
}
inline bool Foam::phaseInterface::const_iterator::operator!=
(
const const_iterator& iter
) const
{
return !(this->operator==(iter));
}
inline const Foam::phaseModel&
Foam::phaseInterface::const_iterator::operator*() const
{
if (index_ == 0)
{
return pair_.phase1_;
}
else
{
return pair_.phase2_;
}
}
inline const Foam::phaseModel&
Foam::phaseInterface::const_iterator::operator()() const
{
return operator*();
}
inline const Foam::phaseModel&
Foam::phaseInterface::const_iterator::otherPhase() const
{
if (index_ == 0)
{
return pair_.phase2_;
}
else
{
return pair_.phase1_;
}
}
inline Foam::phaseInterface::const_iterator&
Foam::phaseInterface::const_iterator::operator++()
{
index_++;
return *this;
}
inline Foam::phaseInterface::const_iterator
Foam::phaseInterface::const_iterator::operator++(int)
{
const_iterator old = *this;
this->operator++();
return old;
}
inline Foam::phaseInterface::const_iterator Foam::phaseInterface::cbegin() const
{
return const_iterator(*this);
}
inline Foam::phaseInterface::const_iterator Foam::phaseInterface::cend() const
{
return const_iterator(*this, 2);
}
inline Foam::phaseInterface::const_iterator Foam::phaseInterface::begin() const
{
return const_iterator(*this);
}
inline Foam::phaseInterface::const_iterator Foam::phaseInterface::end() const
{
return const_iterator(*this, 2);
}
// ************************************************************************* //

View File

@ -0,0 +1,119 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "phaseModel.H"
#include "phaseInterface.H"
#include "phaseInterfaceKey.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::phaseInterfaceKey::hash::hash()
{}
Foam::phaseInterfaceKey::phaseInterfaceKey()
{}
Foam::phaseInterfaceKey::phaseInterfaceKey
(
const phaseModel& phase1,
const phaseModel& phase2
)
:
Pair<word>
(
phaseInterface::getPhase1(phase1, phase2).name(),
phaseInterface::getPhase2(phase1, phase2).name()
)
{}
Foam::phaseInterfaceKey::phaseInterfaceKey(const phaseInterface& interface)
:
phaseInterfaceKey(interface.phase1(), interface.phase2())
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::phaseInterfaceKey::~phaseInterfaceKey()
{}
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
Foam::label Foam::phaseInterfaceKey::hash::operator()
(
const phaseInterfaceKey& key
) const
{
return word::hash()(key.first()) + word::hash()(key.second());
}
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
bool Foam::operator==
(
const phaseInterfaceKey& a,
const phaseInterfaceKey& b
)
{
return Pair<word>::compare(a, b) == 1;
}
bool Foam::operator!=
(
const phaseInterfaceKey& a,
const phaseInterfaceKey& b
)
{
return !(a == b);
}
// * * * * * * * * * * * * * * Istream Operator * * * * * * * * * * * * * * //
Foam::Istream& Foam::operator>>(Istream& is, phaseInterfaceKey& key)
{
NotImplemented;
return is;
}
// * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const phaseInterfaceKey& key)
{
NotImplemented;
return os;
}
// ************************************************************************* //

View File

@ -0,0 +1,140 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
Class
Foam::phaseInterfaceKey
Description
Word-pair based class used for keying interface models in hash tables.
SourceFiles
phaseInterfaceKey.C
\*---------------------------------------------------------------------------*/
#ifndef phaseInterfaceKey_H
#define phaseInterfaceKey_H
#include "Pair.H"
#include "word.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of friend functions and operators
class phaseModel;
class phaseInterface;
class phaseInterfaceKey;
bool operator==(const phaseInterfaceKey&, const phaseInterfaceKey&);
bool operator!=(const phaseInterfaceKey&, const phaseInterfaceKey&);
Istream& operator>>(Istream&, phaseInterfaceKey&);
Ostream& operator<<(Ostream&, const phaseInterfaceKey&);
/*---------------------------------------------------------------------------*\
Class phaseInterfaceKey Declaration
\*---------------------------------------------------------------------------*/
class phaseInterfaceKey
:
public Pair<word>
{
public:
// Public Classes
//- Hashing class
class hash
:
public Hash<phaseInterfaceKey>
{
public:
// Constructors
// Construct null
hash();
// Member Operators
// Generate a hash from a phase interface key
label operator()(const phaseInterfaceKey& key) const;
};
public:
// Constructors
//- Construct null
phaseInterfaceKey();
//- Construct from phases
phaseInterfaceKey(const phaseModel& phase1, const phaseModel& phase2);
//- Construct from phase interface
phaseInterfaceKey(const phaseInterface& interface);
// Destructor
virtual ~phaseInterfaceKey();
// Friend Operators
//- Test if keys are equal
friend bool operator==
(
const phaseInterfaceKey& a,
const phaseInterfaceKey& b
);
//- Test if keys are unequal
friend bool operator!=
(
const phaseInterfaceKey& a,
const phaseInterfaceKey& b
);
//- Read from stream
friend Istream& operator>>(Istream& is, phaseInterfaceKey& key);
//- Write to stream
friend Ostream& operator<<(Ostream& os, const phaseInterfaceKey& key);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,97 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "segregatedDisplacedPhaseInterface.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebugWithName
(
segregatedDisplacedPhaseInterface,
separatorsToTypeName
({
segregatedPhaseInterface::separator(),
displacedPhaseInterface::separator()
}).c_str(),
0
);
addToRunTimeSelectionTable
(
phaseInterface,
segregatedDisplacedPhaseInterface,
word
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::segregatedDisplacedPhaseInterface::segregatedDisplacedPhaseInterface
(
const phaseModel& phase1,
const phaseModel& phase2,
const phaseModel& displacing
)
:
phaseInterface(phase1, phase2),
segregatedPhaseInterface(phase1, phase2),
displacedPhaseInterface(phase1, phase2, displacing)
{}
Foam::segregatedDisplacedPhaseInterface::segregatedDisplacedPhaseInterface
(
const phaseSystem& fluid,
const word& name
)
:
phaseInterface(fluid, name),
segregatedPhaseInterface(fluid, name),
displacedPhaseInterface(fluid, name)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::segregatedDisplacedPhaseInterface::~segregatedDisplacedPhaseInterface()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::word Foam::segregatedDisplacedPhaseInterface::name() const
{
return
segregatedPhaseInterface::name()
+ '_'
+ displacedPhaseInterface::separator()
+ '_'
+ displacing().name();
}
// ************************************************************************* //

View File

@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
Class
Foam::segregatedDisplacedPhaseInterface
Description
Class to represent a interface between phases where the two phases are
considered to be segregated, and the pair has been displaced to some extent
by a third phase.
SourceFiles
dispersedDisplacedPhaseInterface.C
\*---------------------------------------------------------------------------*/
#ifndef segregatedDisplacedPhaseInterface_H
#define segregatedDisplacedPhaseInterface_H
#include "segregatedPhaseInterface.H"
#include "displacedPhaseInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class segregatedDisplacedPhaseInterface Declaration
\*---------------------------------------------------------------------------*/
class segregatedDisplacedPhaseInterface
:
public segregatedPhaseInterface,
public displacedPhaseInterface
{
public:
//- Runtime type information
TypeName("segregatedDisplacedPhaseInterface");
// Constructors
//- Construct from phases
segregatedDisplacedPhaseInterface
(
const phaseModel& phase1,
const phaseModel& phase2,
const phaseModel& displacing
);
//- Construct from fluid and name
segregatedDisplacedPhaseInterface
(
const phaseSystem& fluid,
const word& name
);
//- Destructor
virtual ~segregatedDisplacedPhaseInterface();
// Member Functions
//- Name
virtual word name() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,111 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "segregatedDisplacedSidedPhaseInterface.H"
#include "segregatedDisplacedPhaseInterface.H"
#include "segregatedSidedPhaseInterface.H"
#include "displacedSidedPhaseInterface.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebugWithName
(
segregatedDisplacedSidedPhaseInterface,
separatorsToTypeName
({
segregatedPhaseInterface::separator(),
displacedPhaseInterface::separator(),
sidedPhaseInterface::separator()
}).c_str(),
0
);
addToRunTimeSelectionTable
(
phaseInterface,
segregatedDisplacedSidedPhaseInterface,
word
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::segregatedDisplacedSidedPhaseInterface::
segregatedDisplacedSidedPhaseInterface
(
const phaseModel& phase,
const phaseModel& otherPhase,
const phaseModel& displacing
)
:
phaseInterface(phase, otherPhase),
segregatedPhaseInterface(phase, otherPhase),
displacedPhaseInterface(phase, otherPhase, displacing),
sidedPhaseInterface(phase, otherPhase)
{}
Foam::segregatedDisplacedSidedPhaseInterface::
segregatedDisplacedSidedPhaseInterface
(
const phaseSystem& fluid,
const word& name
)
:
phaseInterface(fluid, name),
segregatedPhaseInterface(fluid, name),
displacedPhaseInterface(fluid, name),
sidedPhaseInterface(fluid, name)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::segregatedDisplacedSidedPhaseInterface::
~segregatedDisplacedSidedPhaseInterface()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::word Foam::segregatedDisplacedSidedPhaseInterface::name() const
{
return
segregatedPhaseInterface::name()
+ '_'
+ displacedPhaseInterface::separator()
+ '_'
+ displacing().name()
+ '_'
+ sidedPhaseInterface::separator()
+ '_'
+ phase().name();
}
// ************************************************************************* //

View File

@ -0,0 +1,102 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
Class
Foam::segregatedDisplacedSidedPhaseInterface
Description
Class to represent a certain side of an interface between phases, where one
phase is considered segregated within the other, and the pair has been
displaced to some extent by a third phase.
SourceFiles
segregatedDisplacedSidedPhaseInterface.C
\*---------------------------------------------------------------------------*/
#ifndef segregatedDisplacedSidedPhaseInterface_H
#define segregatedDisplacedSidedPhaseInterface_H
#include "segregatedPhaseInterface.H"
#include "displacedPhaseInterface.H"
#include "sidedPhaseInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class segregatedDisplacedSidedPhaseInterface Declaration
\*---------------------------------------------------------------------------*/
class segregatedDisplacedSidedPhaseInterface
:
public segregatedPhaseInterface,
public displacedPhaseInterface,
public sidedPhaseInterface
{
public:
//- Runtime type information
TypeName("segregatedDisplacedSidedPhaseInterface");
// Constructors
//- Construct from phases
segregatedDisplacedSidedPhaseInterface
(
const phaseModel& phase,
const phaseModel& otherPhase,
const phaseModel& displacing
);
//- Construct from fluid and name
segregatedDisplacedSidedPhaseInterface
(
const phaseSystem& fluid,
const word& name
);
//- Destructor
virtual ~segregatedDisplacedSidedPhaseInterface();
// Member Functions
//- Name
virtual word name() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,92 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "segregatedPhaseInterface.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
bool segregatedPhaseInterfaceAddedHeadSeparator =
phaseInterface::addHeadSeparator(segregatedPhaseInterface::separator());
bool segregatedPhaseInterfaceAddedOldSeparatorToSeparator =
phaseInterface::addOldSeparatorToSeparator
(
"and",
segregatedPhaseInterface::separator()
);
}
namespace Foam
{
defineTypeNameAndDebugWithName
(
segregatedPhaseInterface,
separatorsToTypeName({separator()}).c_str(),
0
);
addToRunTimeSelectionTable(phaseInterface, segregatedPhaseInterface, word);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::segregatedPhaseInterface::segregatedPhaseInterface
(
const phaseModel& phase1,
const phaseModel& phase2
)
:
phaseInterface(phase1, phase2)
{}
Foam::segregatedPhaseInterface::segregatedPhaseInterface
(
const phaseSystem& fluid,
const word& name
)
:
phaseInterface(fluid, name)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::segregatedPhaseInterface::~segregatedPhaseInterface()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::word Foam::segregatedPhaseInterface::name() const
{
return phase1().name() + '_' + separator() + '_' + phase2().name();
}
// ************************************************************************* //

View File

@ -0,0 +1,106 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
Class
Foam::segregatedPhaseInterface
Description
Class to represent a interface between phases where the two phases are
considered to be segregated; that is, separated by a geometrically complex
interface for which dispersed representations are inappropriate.
SourceFiles
segregatedPhaseInterface.C
\*---------------------------------------------------------------------------*/
#ifndef segregatedPhaseInterface_H
#define segregatedPhaseInterface_H
#include "phaseInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class segregatedPhaseInterface Declaration
\*---------------------------------------------------------------------------*/
class segregatedPhaseInterface
:
virtual public phaseInterface
{
public:
//- Runtime type information
TypeName("segregatedPhaseInterface");
// Constructors
//- Construct from phases
segregatedPhaseInterface
(
const phaseModel& phase1,
const phaseModel& phase2
);
//- Construct from fluid and name
segregatedPhaseInterface
(
const phaseSystem& fluid,
const word& name
);
//- Destructor
virtual ~segregatedPhaseInterface();
// Static Member Functions
//- Return the separator that delimits this interface's name
static word separator()
{
return "segregatedWith";
}
// Member Functions
//- Name
virtual word name() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,97 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "segregatedSidedPhaseInterface.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebugWithName
(
segregatedSidedPhaseInterface,
separatorsToTypeName
({
segregatedPhaseInterface::separator(),
sidedPhaseInterface::separator()
}).c_str(),
0
);
addToRunTimeSelectionTable
(
phaseInterface,
segregatedSidedPhaseInterface,
word
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::segregatedSidedPhaseInterface::segregatedSidedPhaseInterface
(
const phaseModel& phase,
const phaseModel& otherPhase
)
:
phaseInterface(phase, otherPhase),
segregatedPhaseInterface(phase, otherPhase),
sidedPhaseInterface(phase, otherPhase)
{}
Foam::segregatedSidedPhaseInterface::segregatedSidedPhaseInterface
(
const phaseSystem& fluid,
const word& name
)
:
phaseInterface(fluid, name),
segregatedPhaseInterface(fluid, name),
sidedPhaseInterface(fluid, name)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::segregatedSidedPhaseInterface::~segregatedSidedPhaseInterface()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::word Foam::segregatedSidedPhaseInterface::name() const
{
return
segregatedPhaseInterface::name()
+ '_'
+ sidedPhaseInterface::separator()
+ '_'
+ phase().name();
}
// ************************************************************************* //

View File

@ -0,0 +1,98 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
Class
Foam::segregatedSidedPhaseInterface
Description
Class to represent a certain side of an interface between phases, where one
phase is considered segregated within the other.
SourceFiles
segregatedSidedPhaseInterface.C
\*---------------------------------------------------------------------------*/
#ifndef segregatedSidedPhaseInterface_H
#define segregatedSidedPhaseInterface_H
#include "segregatedPhaseInterface.H"
#include "sidedPhaseInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class segregatedSidedPhaseInterface Declaration
\*---------------------------------------------------------------------------*/
class segregatedSidedPhaseInterface
:
public segregatedPhaseInterface,
public sidedPhaseInterface
{
public:
//- Runtime type information
TypeName("segregatedSidedPhaseInterface");
// Constructors
//- Construct from phases
segregatedSidedPhaseInterface
(
const phaseModel& phase,
const phaseModel& otherPhase
);
//- Construct from fluid and name
segregatedSidedPhaseInterface
(
const phaseSystem& fluid,
const word& name
);
//- Destructor
virtual ~segregatedSidedPhaseInterface();
// Member Functions
//- Name
virtual word name() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,124 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "phaseInterface.H"
#include "sidedPhaseInterface.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebugWithName
(
sidedPhaseInterface,
separatorsToTypeName
({
phaseInterface::separator(),
separator()
}).c_str(),
0
);
addToRunTimeSelectionTable(phaseInterface, sidedPhaseInterface, word);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::sidedPhaseInterface::sidedPhaseInterface
(
const phaseModel& phase,
const phaseModel& otherPhase
)
:
phaseInterface(phase, otherPhase),
phase_(phase)
{}
Foam::sidedPhaseInterface::sidedPhaseInterface
(
const phaseSystem& fluid,
const word& name
)
:
phaseInterface(fluid, name),
phase_(identifyPhases(fluid, name, {separator()}).second())
{
if (!contains(phase_))
{
FatalErrorInFunction
<< "Interface " << name << " is not valid. An interface cannot "
<< "have a side that is not one of its own phases."
<< exit(FatalError);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::sidedPhaseInterface::~sidedPhaseInterface()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::word Foam::sidedPhaseInterface::name() const
{
return phaseInterface::name() + '_' + separator() + '_' + phase().name();
}
const Foam::phaseModel& Foam::sidedPhaseInterface::phase() const
{
return phase_;
}
const Foam::phaseModel& Foam::sidedPhaseInterface::otherPhase() const
{
return phaseInterface::otherPhase(phase_);
}
Foam::autoPtr<Foam::phaseInterface>
Foam::sidedPhaseInterface::otherInterface() const
{
wordList nameParts = phaseInterface::nameToNameParts(fluid(), name());
const label i =
findIndex(nameParts, sidedPhaseInterface::separator());
nameParts[i+1] = otherPhase().name();
return phaseInterface::New
(
fluid(),
phaseInterface::namePartsToName(fluid(), nameParts)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,124 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ 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 <http://www.gnu.org/licenses/>.
Class
Foam::sidedPhaseInterface
Description
Class to represent a certain side of an interface between phases.
SourceFiles
sidedPhaseInterface.C
\*---------------------------------------------------------------------------*/
#ifndef sidedPhaseInterface_H
#define sidedPhaseInterface_H
#include "phaseInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class sidedPhaseInterface Declaration
\*---------------------------------------------------------------------------*/
class sidedPhaseInterface
:
virtual public phaseInterface
{
private:
// Private Data
//- Phase
const phaseModel& phase_;
public:
//- Runtime type information
TypeName("sidedPhaseInterface");
// Constructors
//- Construct from phases
sidedPhaseInterface
(
const phaseModel& phase,
const phaseModel& otherPhase
);
//- Construct from fluid and name
sidedPhaseInterface
(
const phaseSystem& fluid,
const word& name
);
//- Destructor
virtual ~sidedPhaseInterface();
// Static Member Functions
//- Return the separator that delimits this interface's name
static word separator()
{
return "inThe";
}
// Member Functions
//- Name
virtual word name() const;
// Access
//- Phase on the this side of the interface
const phaseModel& phase() const;
//- Phase on the other side of the interface
const phaseModel& otherPhase() const;
//- Interface on the other side of the interface
autoPtr<phaseInterface> otherInterface() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //