Compare commits

..

1 Commits

Author SHA1 Message Date
76d719d1e6 RELEASE: Updated version to v2206 2022-06-24 15:41:02 +01:00
450 changed files with 4491 additions and 6704 deletions

View File

@ -5,8 +5,6 @@ It is likely incomplete...
## Contributors (alphabetical by surname) ## Contributors (alphabetical by surname)
- Tetsuo Aoyagi
- Akira Azami
- William Bainbridge - William Bainbridge
- Gabriel Barajas - Gabriel Barajas
- Kutalmis Bercin - Kutalmis Bercin
@ -21,7 +19,6 @@ It is likely incomplete...
- Bernhard Gschaider - Bernhard Gschaider
- Andrew Heather - Andrew Heather
- David Hill - David Hill
- Yoshiaki Inoue
- Mattijs Janssens - Mattijs Janssens
- Andrew Jackson - Andrew Jackson
- Hrvoje Jasak - Hrvoje Jasak

View File

@ -1,9 +1,9 @@
Info<< "\nConstructing reacting cloud" << endl; Info<< "\nConstructing reacting cloud" << endl;
reactingCloud parcels basicReactingCloud parcels
( (
"reactingCloud1", "reactingCloud1",
g,
rho, rho,
U, U,
g,
slgThermo slgThermo
); );

View File

@ -37,7 +37,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "turbulentFluidThermoModel.H" #include "turbulentFluidThermoModel.H"
#include "reactingCloud.H" #include "basicReactingCloud.H"
#include "surfaceFilmModel.H" #include "surfaceFilmModel.H"
#include "pyrolysisModelCollection.H" #include "pyrolysisModelCollection.H"
#include "radiationModel.H" #include "radiationModel.H"

View File

@ -42,11 +42,11 @@ Description
#include "CorrectPhi.H" #include "CorrectPhi.H"
#ifdef MPPIC #ifdef MPPIC
#include "kinematicCloud.H" #include "basicKinematicCloud.H"
#define kinematicTypeCloud kinematicCloud #define basicKinematicTypeCloud basicKinematicCloud
#else #else
#include "kinematicCollidingCloud.H" #include "basicKinematicCollidingCloud.H"
#define kinematicTypeCloud kinematicCollidingCloud #define basicKinematicTypeCloud basicKinematicCollidingCloud
#endif #endif
int main(int argc, char *argv[]) int main(int argc, char *argv[])
@ -88,7 +88,7 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
// Store the particle positions // Store the particle positions
kCloud.storeGlobalPositions(); kinematicCloud.storeGlobalPositions();
mesh.update(); mesh.update();
@ -111,15 +111,15 @@ int main(int argc, char *argv[])
continuousPhaseTransport.correct(); continuousPhaseTransport.correct();
muc = rhoc*continuousPhaseTransport.nu(); muc = rhoc*continuousPhaseTransport.nu();
kCloud.evolve(); kinematicCloud.evolve();
// Update continuous phase volume fraction field // Update continuous phase volume fraction field
alphac = max(1.0 - kCloud.theta(), alphacMin); alphac = max(1.0 - kinematicCloud.theta(), alphacMin);
alphac.correctBoundaryConditions(); alphac.correctBoundaryConditions();
alphacf = fvc::interpolate(alphac); alphacf = fvc::interpolate(alphac);
alphaPhic = alphacf*phic; alphaPhic = alphacf*phic;
fvVectorMatrix cloudSU(kCloud.SU(Uc)); fvVectorMatrix cloudSU(kinematicCloud.SU(Uc));
volVectorField cloudVolSUSu volVectorField cloudVolSUSu
( (
IOobject IOobject

View File

@ -12,8 +12,6 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \

View File

@ -11,11 +11,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \

View File

@ -43,11 +43,11 @@ Description
#include "pimpleControl.H" #include "pimpleControl.H"
#ifdef MPPIC #ifdef MPPIC
#include "kinematicCloud.H" #include "basicKinematicCloud.H"
#define kinematicTypeCloud kinematicCloud #define basicKinematicTypeCloud basicKinematicCloud
#else #else
#include "kinematicCollidingCloud.H" #include "basicKinematicCollidingCloud.H"
#define kinematicTypeCloud kinematicCollidingCloud #define basicKinematicTypeCloud basicKinematicCollidingCloud
#endif #endif
int main(int argc, char *argv[]) int main(int argc, char *argv[])
@ -91,16 +91,16 @@ int main(int argc, char *argv[])
continuousPhaseTransport.correct(); continuousPhaseTransport.correct();
muc = rhoc*continuousPhaseTransport.nu(); muc = rhoc*continuousPhaseTransport.nu();
Info<< "Evolving " << kCloud.name() << endl; Info<< "Evolving " << kinematicCloud.name() << endl;
kCloud.evolve(); kinematicCloud.evolve();
// Update continuous phase volume fraction field // Update continuous phase volume fraction field
alphac = max(1.0 - kCloud.theta(), alphacMin); alphac = max(1.0 - kinematicCloud.theta(), alphacMin);
alphac.correctBoundaryConditions(); alphac.correctBoundaryConditions();
alphacf = fvc::interpolate(alphac); alphacf = fvc::interpolate(alphac);
alphaPhic = alphacf*phic; alphaPhic = alphacf*phic;
fvVectorMatrix cloudSU(kCloud.SU(Uc)); fvVectorMatrix cloudSU(kinematicCloud.SU(Uc));
volVectorField cloudVolSUSu volVectorField cloudVolSUSu
( (
IOobject IOobject

View File

@ -10,8 +10,6 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \

View File

@ -10,11 +10,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \

View File

@ -125,13 +125,13 @@ const word kinematicCloudName
); );
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl; Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
kinematicTypeCloud kCloud basicKinematicTypeCloud kinematicCloud
( (
kinematicCloudName, kinematicCloudName,
g,
rhoc, rhoc,
Uc, Uc,
muc muc,
g
); );
// Particle fraction upper limit // Particle fraction upper limit
@ -139,13 +139,13 @@ scalar alphacMin
( (
1.0 1.0
- ( - (
kCloud.particleProperties().subDict("constantProperties") kinematicCloud.particleProperties().subDict("constantProperties")
.get<scalar>("alphaMax") .get<scalar>("alphaMax")
) )
); );
// Update alphac from the particle locations // Update alphac from the particle locations
alphac = max(1.0 - kCloud.theta(), alphacMin); alphac = max(1.0 - kinematicCloud.theta(), alphacMin);
alphac.correctBoundaryConditions(); alphac.correctBoundaryConditions();
surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac)); surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac));

View File

@ -6,6 +6,7 @@ EXE_INC = \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \
@ -34,6 +35,7 @@ EXE_LIBS = \
-llagrangian \ -llagrangian \
-llagrangianIntermediate \ -llagrangianIntermediate \
-llagrangianTurbulence \ -llagrangianTurbulence \
-lcoalCombustion\
-lspecie \ -lspecie \
-lcompressibleTransportModels \ -lcompressibleTransportModels \
-lfluidThermophysicalModels \ -lfluidThermophysicalModels \

View File

@ -37,8 +37,8 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "turbulentFluidThermoModel.H" #include "turbulentFluidThermoModel.H"
#include "thermoCloud.H" #include "basicThermoCloud.H"
#include "reactingMultiphaseCloud.H" #include "coalCloud.H"
#include "psiReactionThermo.H" #include "psiReactionThermo.H"
#include "CombustionModel.H" #include "CombustionModel.H"
#include "fvOptions.H" #include "fvOptions.H"

View File

@ -1,19 +1,19 @@
Info<< "\nConstructing coal cloud" << endl; Info<< "\nConstructing coal cloud" << endl;
reactingMultiphaseCloud coalParcels coalCloud coalParcels
( (
"coalCloud1", "coalCloud1",
g,
rho, rho,
U, U,
g,
slgThermo slgThermo
); );
Info<< "\nConstructing limestone cloud" << endl; Info<< "\nConstructing limestone cloud" << endl;
thermoCloud limestoneParcels basicThermoCloud limestoneParcels
( (
"limestoneCloud1", "limestoneCloud1",
g,
rho, rho,
U, U,
g,
slgThermo slgThermo
); );

View File

@ -9,8 +9,6 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \

View File

@ -63,13 +63,13 @@ const word kinematicCloudName
); );
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl; Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
kinematicCollidingCloud kCloud basicKinematicCollidingCloud kinematicCloud
( (
kinematicCloudName, kinematicCloudName,
g,
rhoInf, rhoInf,
U, U,
mu mu,
g
); );
IOobject Hheader IOobject Hheader

View File

@ -10,8 +10,6 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \

View File

@ -41,7 +41,7 @@ Description
#include "dynamicFvMesh.H" #include "dynamicFvMesh.H"
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H" #include "turbulentTransportModel.H"
#include "kinematicCollidingCloud.H" #include "basicKinematicCollidingCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -76,19 +76,19 @@ int main(int argc, char *argv[])
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
kCloud.storeGlobalPositions(); kinematicCloud.storeGlobalPositions();
mesh.update(); mesh.update();
U.correctBoundaryConditions(); U.correctBoundaryConditions();
Info<< "Evolving " << kCloud.name() << endl; Info<< "Evolving " << kinematicCloud.name() << endl;
laminarTransport.correct(); laminarTransport.correct();
mu = laminarTransport.nu()*rhoInfValue; mu = laminarTransport.nu()*rhoInfValue;
kCloud.evolve(); kinematicCloud.evolve();
runTime.write(); runTime.write();

View File

@ -40,7 +40,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H" #include "turbulentTransportModel.H"
#include "kinematicCollidingCloud.H" #include "basicKinematicCollidingCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -75,13 +75,13 @@ int main(int argc, char *argv[])
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
Info<< "Evolving " << kCloud.name() << endl; Info<< "Evolving " << kinematicCloud.name() << endl;
laminarTransport.correct(); laminarTransport.correct();
mu = laminarTransport.nu()*rhoInfValue; mu = laminarTransport.nu()*rhoInfValue;
kCloud.evolve(); kinematicCloud.evolve();
runTime.write(); runTime.write();

View File

@ -8,12 +8,6 @@ EXE_INC = \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \

View File

@ -6,7 +6,7 @@
+ MRF.DDt(U) + MRF.DDt(U)
+ turbulence->divDevReff(U) + turbulence->divDevReff(U)
== ==
scalar(1)/rhoInfValue*parcels.SU(U) parcels.SU(U, true)
+ fvOptions(U) + fvOptions(U)
); );

View File

@ -4,12 +4,13 @@ const word kinematicCloudName
); );
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl; Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
kinematicCloud parcels
basicKinematicCloud parcels
( (
kinematicCloudName, kinematicCloudName,
g,
rhoInf, rhoInf,
U, U,
muc muc,
g
); );

View File

@ -40,7 +40,7 @@ Description
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H" #include "turbulentTransportModel.H"
#include "surfaceFilmModel.H" #include "surfaceFilmModel.H"
#include "kinematicCloud.H" #include "basicKinematicCloud.H"
#include "fvOptions.H" #include "fvOptions.H"
#include "pimpleControl.H" #include "pimpleControl.H"
#include "CorrectPhi.H" #include "CorrectPhi.H"
@ -67,6 +67,7 @@ int main(int argc, char *argv[])
#include "createDyMControls.H" #include "createDyMControls.H"
#include "createFields.H" #include "createFields.H"
#include "createFieldRefs.H" #include "createFieldRefs.H"
#include "createRegionControls.H"
#include "createUfIfPresent.H" #include "createUfIfPresent.H"
turbulence->validate(); turbulence->validate();
@ -94,7 +95,7 @@ int main(int argc, char *argv[])
// Do any mesh changes // Do any mesh changes
mesh.update(); mesh.update();
if (pimple.solveFlow() && mesh.changing()) if (solvePrimaryRegion && mesh.changing())
{ {
MRF.update(); MRF.update();
@ -119,7 +120,7 @@ int main(int argc, char *argv[])
parcels.evolve(); parcels.evolve();
surfaceFilm.evolve(); surfaceFilm.evolve();
if (pimple.solveFlow()) if (solvePrimaryRegion)
{ {
// --- PIMPLE loop // --- PIMPLE loop
while (pimple.loop()) while (pimple.loop())

View File

@ -1,3 +0,0 @@
parcelFoam.C
EXE = $(FOAM_USER_APPBIN)/parcelFoam

View File

@ -1,22 +0,0 @@
MRF.correctBoundaryVelocity(U);
fvVectorMatrix UEqn
(
fvm::ddt(U) + fvm::div(phi, U)
+ MRF.DDt(U)
+ turbulence->divDevReff(U)
==
scalar(1)/rhoInfValue*parcels.SU(U)
+ fvOptions(U)
);
UEqn.relax();
fvOptions.constrain(UEqn);
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
fvOptions.correct(U);
}

View File

@ -1,2 +0,0 @@
auto parcels = parcelCloudModelList(g, rhoInf, U, muc);

View File

@ -1 +0,0 @@
regionModels::surfaceFilmModel& surfaceFilm = tsurfaceFilm();

View File

@ -1,85 +0,0 @@
#include "readGravitationalAcceleration.H"
Info<< "Reading field p\n" << endl;
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "\nReading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#include "createPhi.H"
singlePhaseTransportModel laminarTransport(U, phi);
dimensionedScalar rhoInfValue
(
"rhoInf",
dimDensity,
laminarTransport
);
volScalarField rhoInf
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
rhoInfValue
);
volScalarField muc
(
IOobject
(
"muc",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
rhoInf*laminarTransport.nu()
);
Info<< "Creating turbulence model\n" << endl;
autoPtr<incompressible::turbulenceModel> turbulence
(
incompressible::turbulenceModel::New(U, phi, laminarTransport)
);
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, pimple.dict(), pRefCell, pRefValue);
mesh.setFluxRequired(p.name());
#include "createMRF.H"
#include "createClouds.H"
#include "createSurfaceFilmModel.H"
#include "createFvOptions.H"

View File

@ -1,58 +0,0 @@
volScalarField rAU(1.0/UEqn.A());
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA));
if (pimple.ddtCorr())
{
phiHbyA += MRF.zeroFilter(fvc::interpolate(rAU)*fvc::ddtCorr(U, phi, Uf));
}
MRF.makeRelative(phiHbyA);
if (p.needReference())
{
fvc::makeRelative(phiHbyA, U);
adjustPhi(phiHbyA, U, p);
fvc::makeAbsolute(phiHbyA, U);
}
// Update the pressure BCs to ensure flux consistency
constrainPressure(p, U, phiHbyA, rAU, MRF);
// Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p)
==
fvc::div(phiHbyA)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
{
phi = phiHbyA - pEqn.flux();
}
}
#include "continuityErrs.H"
p.relax();
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
fvOptions.correct(U);
// Correct rhoUf if the mesh is moving
fvc::correctUf(Uf, U, phi);
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);

View File

@ -1,154 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
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/>.
Application
parcelFoam
Group
grpLagrangianSolvers
Description
Transient solver for incompressible, turbulent flow with kinematic,
particle cloud, and surface film modelling.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "surfaceFilmModel.H"
#include "parcelCloudModelList.H"
#include "fvOptions.H"
#include "pimpleControl.H"
#include "CorrectPhi.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
argList::addNote
(
"Transient solver for incompressible, turbulent flow"
" with kinematic particle clouds"
" and surface film modelling."
);
#define CREATE_MESH createMeshesPostProcess.H
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "initContinuityErrs.H"
#include "createDyMControls.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "createUfIfPresent.H"
turbulence->validate();
#include "CourantNo.H"
#include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readDyMControls.H"
#include "CourantNo.H"
#include "setMultiRegionDeltaT.H"
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
// Store the particle positions
parcels.storeGlobalPositions();
// Do any mesh changes
mesh.update();
if (pimple.solveFlow() && mesh.changing())
{
MRF.update();
if (correctPhi)
{
// Calculate absolute flux
// from the mapped surface velocity
phi = mesh.Sf() & Uf();
#include "../../incompressible/pimpleFoam/correctPhi.H"
// Make the fluxes relative to the mesh-motion
fvc::makeRelative(phi, U);
}
if (checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
}
parcels.evolve();
surfaceFilm.evolve();
if (pimple.solveFlow())
{
// --- PIMPLE loop
while (pimple.loop())
{
#include "UEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{
#include "pEqn.H"
}
if (pimple.turbCorr())
{
laminarTransport.correct();
turbulence->correct();
}
}
}
runTime.write();
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,9 +1,9 @@
Info<< "\nConstructing reacting cloud" << endl; Info<< "\nConstructing reacting cloud" << endl;
reactingTypeCloud parcels basicReactingTypeCloud parcels
( (
"reactingCloud1", "reactingCloud1",
g,
rho, rho,
U, U,
g,
slgThermo slgThermo
); );

View File

@ -37,8 +37,8 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#define CLOUD_BASE_TYPE heterogeneousReacting #define CLOUD_BASE_TYPE HeterogeneousReacting
#define CLOUD_BASE_TYPE_NAME "heterogeneousReacting" #define CLOUD_BASE_TYPE_NAME "HeterogeneousReacting"
#include "reactingParcelFoam.C" #include "reactingParcelFoam.C"

View File

@ -53,12 +53,12 @@ Description
#include "cloudMacros.H" #include "cloudMacros.H"
#ifndef CLOUD_BASE_TYPE #ifndef CLOUD_BASE_TYPE
#define CLOUD_BASE_TYPE reactingMultiphase #define CLOUD_BASE_TYPE ReactingMultiphase
#define CLOUD_BASE_TYPE_NAME "reacting" #define CLOUD_BASE_TYPE_NAME "reacting"
#endif #endif
#include CLOUD_INCLUDE_FILE(CLOUD_BASE_TYPE) #include CLOUD_INCLUDE_FILE(CLOUD_BASE_TYPE)
#define reactingTypeCloud CLOUD_TYPE(CLOUD_BASE_TYPE) #define basicReactingTypeCloud CLOUD_TYPE(CLOUD_BASE_TYPE)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -81,6 +81,7 @@ int main(int argc, char *argv[])
#include "createDyMControls.H" #include "createDyMControls.H"
#include "createFields.H" #include "createFields.H"
#include "createFieldRefs.H" #include "createFieldRefs.H"
#include "createRegionControls.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
#include "createRhoUfIfPresent.H" #include "createRhoUfIfPresent.H"
@ -104,7 +105,7 @@ int main(int argc, char *argv[])
// so that it can be mapped and used in correctPhi // so that it can be mapped and used in correctPhi
// to ensure the corrected phi has the same divergence // to ensure the corrected phi has the same divergence
autoPtr<volScalarField> divrhoU; autoPtr<volScalarField> divrhoU;
if (pimple.solveFlow() && correctPhi) if (solvePrimaryRegion && correctPhi)
{ {
divrhoU.reset divrhoU.reset
( (
@ -132,7 +133,7 @@ int main(int argc, char *argv[])
// Store momentum to set rhoUf for introduced faces. // Store momentum to set rhoUf for introduced faces.
autoPtr<volVectorField> rhoU; autoPtr<volVectorField> rhoU;
if (pimple.solveFlow() && rhoUf.valid()) if (solvePrimaryRegion && rhoUf.valid())
{ {
rhoU.reset(new volVectorField("rhoU", rho*U)); rhoU.reset(new volVectorField("rhoU", rho*U));
} }
@ -143,7 +144,7 @@ int main(int argc, char *argv[])
// Do any mesh changes // Do any mesh changes
mesh.update(); mesh.update();
if (pimple.solveFlow() && mesh.changing()) if (solvePrimaryRegion && mesh.changing())
{ {
gh = (g & mesh.C()) - ghRef; gh = (g & mesh.C()) - ghRef;
ghf = (g & mesh.Cf()) - ghRef; ghf = (g & mesh.Cf()) - ghRef;
@ -171,7 +172,7 @@ int main(int argc, char *argv[])
parcels.evolve(); parcels.evolve();
surfaceFilm.evolve(); surfaceFilm.evolve();
if (pimple.solveFlow()) if (solvePrimaryRegion)
{ {
if (pimple.nCorrPIMPLE() <= 1) if (pimple.nCorrPIMPLE() <= 1)
{ {

View File

@ -7,6 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \

View File

@ -1,9 +1,9 @@
Info<< "\nConstructing " << CLOUD_BASE_TYPE_NAME << " cloud" << endl; Info<< "\nConstructing " << CLOUD_BASE_TYPE_NAME << " cloud" << endl;
reactingTypeCloud parcels basicReactingTypeCloud parcels
( (
word(CLOUD_BASE_TYPE_NAME) & "Cloud1", word(CLOUD_BASE_TYPE_NAME) & "Cloud1",
g,
rho, rho,
U, U,
g,
slgThermo slgThermo
); );

View File

@ -45,13 +45,13 @@ Description
#include "cloudMacros.H" #include "cloudMacros.H"
#ifndef CLOUD_BASE_TYPE #ifndef CLOUD_BASE_TYPE
#define CLOUD_BASE_TYPE reactingMultiphase #define CLOUD_BASE_TYPE ReactingMultiphase
//#define CLOUD_BASE_TYPE_NAME "reactingMultiphase" Backwards compat //#define CLOUD_BASE_TYPE_NAME "reactingMultiphase" Backwards compat
#define CLOUD_BASE_TYPE_NAME "reacting" #define CLOUD_BASE_TYPE_NAME "reacting"
#endif #endif
#include CLOUD_INCLUDE_FILE(CLOUD_BASE_TYPE) #include CLOUD_INCLUDE_FILE(CLOUD_BASE_TYPE)
#define reactingTypeCloud CLOUD_TYPE(CLOUD_BASE_TYPE) #define basicReactingTypeCloud CLOUD_TYPE(CLOUD_BASE_TYPE)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,41 +0,0 @@
{
volScalarField& he = thermo.he();
fvScalarMatrix EEqn
(
fvm::ddt(rho, he) + mvConvection->fvmDiv(phi, he)
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt
)
- fvm::laplacian(turbulence->alphaEff(), he)
==
rho*(U&g)
+ parcels.Sh(he)
+ surfaceFilm.Sh()
+ radiation->Sh(thermo, he)
+ Qdot
+ fvOptions(rho, he)
);
EEqn.relax();
fvOptions.constrain(EEqn);
EEqn.solve();
fvOptions.correct(he);
thermo.correct();
radiation->correct();
Info<< "T gas min/max = " << min(T).value() << ", "
<< max(T).value() << endl;
}

View File

@ -1,3 +0,0 @@
rhoParcelFoam.C
EXE = $(FOAM_USER_APPBIN)/rhoParcelFoam

View File

@ -1,34 +0,0 @@
MRF.correctBoundaryVelocity(U);
fvVectorMatrix UEqn
(
fvm::ddt(rho, U) + fvm::div(phi, U)
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U)
==
parcels.SU(U)
+ fvOptions(rho, U)
);
UEqn.relax();
fvOptions.constrain(UEqn);
if (pimple.momentumPredictor())
{
solve
(
UEqn
==
fvc::reconstruct
(
(
- ghf*fvc::snGrad(rho)
- fvc::snGrad(p_rgh)
)*mesh.magSf()
)
);
fvOptions.correct(U);
K = 0.5*magSqr(U);
}

View File

@ -1,51 +0,0 @@
tmp<fv::convectionScheme<scalar>> mvConvection
(
fv::convectionScheme<scalar>::New
(
mesh,
fields,
phi,
mesh.divScheme("div(phi,Yi_h)")
)
);
{
combustion->correct();
Qdot = combustion->Qdot();
volScalarField Yt(0.0*Y[0]);
forAll(Y, i)
{
if (i != inertIndex && composition.active(i))
{
volScalarField& Yi = Y[i];
fvScalarMatrix YEqn
(
fvm::ddt(rho, Yi)
+ mvConvection->fvmDiv(phi, Yi)
- fvm::laplacian(turbulence->muEff(), Yi)
==
parcels.SYi(i, Yi)
+ fvOptions(rho, Yi)
+ combustion->R(Yi)
+ surfaceFilm.Srho(i)
);
YEqn.relax();
fvOptions.constrain(YEqn);
YEqn.solve(mesh.solver("Yi"));
fvOptions.correct(Yi);
Yi.max(0.0);
Yt += Yi;
}
}
Y[inertIndex] = scalar(1) - Yt;
Y[inertIndex].max(0.0);
}

View File

@ -1,3 +0,0 @@
Info<< "\nConstructing cloud" << endl;
auto parcels = parcelCloudModelList(g, rho, U, slgThermo);

View File

@ -1,5 +0,0 @@
const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi();
const label inertIndex(composition.species().find(inertSpecie));
regionModels::surfaceFilmModel& surfaceFilm = tsurfaceFilm();

View File

@ -1,132 +0,0 @@
#include "createRDeltaT.H"
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<rhoReactionThermo> pThermo(rhoReactionThermo::New(mesh));
rhoReactionThermo& thermo = pThermo();
thermo.validate(args.executable(), "h", "e");
SLGThermo slgThermo(mesh, thermo);
basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.get<word>("inertSpecie"));
if
(
!composition.species().found(inertSpecie)
&& composition.species().size() > 0
)
{
FatalIOErrorIn(args.executable().c_str(), thermo)
<< "Inert specie " << inertSpecie << " not found in available species "
<< composition.species()
<< exit(FatalIOError);
}
Info<< "Creating field rho\n" << endl;
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo.rho()
);
volScalarField& p = thermo.p();
Info<< "\nReading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo
)
);
Info<< "Creating combustion model\n" << endl;
autoPtr<CombustionModel<rhoReactionThermo>> combustion
(
CombustionModel<rhoReactionThermo>::New(thermo, turbulence())
);
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
#include "gh.H"
volScalarField p_rgh
(
IOobject
(
"p_rgh",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
// Force p_rgh to be consistent with p
p_rgh = p - rho*gh;
pressureControl pressureControl(p, rho, pimple.dict(), false);
mesh.setFluxRequired(p_rgh.name());
Info<< "Creating multi-variate interpolation scheme\n" << endl;
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
forAll(Y, i)
{
fields.add(Y[i]);
}
fields.add(thermo.he());
volScalarField Qdot
(
IOobject
(
"Qdot",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar(dimEnergy/dimVolume/dimTime, Zero)
);
#include "createDpdt.H"
#include "createK.H"
#include "createMRF.H"
#include "createRadiationModel.H"
#include "createClouds.H"
#include "createSurfaceFilmModel.H"
#include "createFvOptions.H"

View File

@ -1,35 +0,0 @@
#include "createMesh.H"
dictionary filmDict;
IOobject io
(
"surfaceFilmProperties",
mesh.time().constant(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
);
if (io.typeHeaderOk<IOdictionary>())
{
IOdictionary propDict(io);
filmDict = std::move(propDict);
const word filmRegionName = filmDict.get<word>("region");
fvMesh filmMesh
(
IOobject
(
filmRegionName,
runTime.timeName(),
runTime,
IOobject::MUST_READ
)
);
}

View File

@ -1,6 +0,0 @@
Info<< "\nConstructing surface film model" << endl;
autoPtr<regionModels::surfaceFilmModel> tsurfaceFilm
(
regionModels::surfaceFilmModel::New(mesh, g)
);

View File

@ -1,96 +0,0 @@
if (!pimple.SIMPLErho())
{
rho = thermo.rho();
}
// Thermodynamic density needs to be updated by psi*d(p) after the
// pressure solution
const volScalarField psip0(psi*p);
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
surfaceScalarField phiHbyA
(
"phiHbyA",
(
fvc::flux(rho*HbyA)
+ MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi))
)
+ phig
);
fvc::makeRelative(phiHbyA, rho, U);
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
// Update the pressure BCs to ensure flux consistency
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
fvScalarMatrix p_rghDDtEqn
(
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
+ fvc::div(phiHbyA)
==
parcels.Srho()
+ surfaceFilm.Srho()
+ fvOptions(psi, p_rgh, rho.name())
);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix p_rghEqn
(
p_rghDDtEqn
- fvm::laplacian(rhorAUf, p_rgh)
);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
{
phi = phiHbyA + p_rghEqn.flux();
// Explicitly relax pressure for momentum corrector
p_rgh.relax();
U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/rhorAUf);
U.correctBoundaryConditions();
fvOptions.correct(U);
K = 0.5*magSqr(U);
}
}
p = p_rgh + rho*gh;
// Thermodynamic density update
thermo.correctRho(psi*p - psip0);
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
if (pressureControl.limit(p))
{
p.correctBoundaryConditions();
rho = thermo.rho();
p_rgh = p - rho*gh;
}
else if (pimple.SIMPLErho())
{
rho = thermo.rho();
}
// Correct rhoUf if the mesh is moving
fvc::correctRhoUf(rhoUf, rho, U, phi);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
if (mesh.moving())
{
dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
}
}

View File

@ -1,50 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
-------------------------------------------------------------------------------
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/>.
Global
rhoEqn
Description
Solve the continuity for density.
\*---------------------------------------------------------------------------*/
{
fvScalarMatrix rhoEqn
(
fvm::ddt(rho)
+ fvc::div(phi)
==
parcels.Srho(rho)
+ surfaceFilm.Srho()
+ fvOptions(rho)
);
rhoEqn.solve();
fvOptions.correct(rho);
}
// ************************************************************************* //

View File

@ -1,206 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2020 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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/>.
Application
rhoParcelFoam
Group
grpLagrangianSolvers
Description
Transient solver for compressible, turbulent flow with a reacting,
multiphase particle cloud, and surface film modelling.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "turbulentFluidThermoModel.H"
#include "surfaceFilmModel.H"
#include "rhoReactionThermo.H"
#include "CombustionModel.H"
#include "radiationModel.H"
#include "SLGThermo.H"
#include "fvOptions.H"
#include "pimpleControl.H"
#include "pressureControl.H"
#include "CorrectPhi.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"
#include "parcelCloudModelList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
argList::addNote
(
"Transient solver for compressible, turbulent flow"
" with lagrangian parcel clouds and surface film modelling."
);
#define CREATE_MESH createMeshesPostProcess.H
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createDyMControls.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "initContinuityErrs.H"
#include "createRhoUfIfPresent.H"
turbulence->validate();
if (!LTS)
{
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readDyMControls.H"
// Store divrhoU from the previous mesh
// so that it can be mapped and used in correctPhi
// to ensure the corrected phi has the same divergence
autoPtr<volScalarField> divrhoU;
if (pimple.solveFlow() && correctPhi)
{
divrhoU.reset
(
new volScalarField
(
"divrhoU",
fvc::div(fvc::absolute(phi, rho, U))
)
);
}
if (LTS)
{
#include "setRDeltaT.H"
}
else
{
#include "compressibleCourantNo.H"
#include "setMultiRegionDeltaT.H"
}
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
// Store momentum to set rhoUf for introduced faces.
autoPtr<volVectorField> rhoU;
if (pimple.solveFlow() && rhoUf.valid())
{
rhoU.reset(new volVectorField("rhoU", rho*U));
}
// Store the particle positions
parcels.storeGlobalPositions();
// Do any mesh changes
mesh.update();
if (pimple.solveFlow() && mesh.changing())
{
gh = (g & mesh.C()) - ghRef;
ghf = (g & mesh.Cf()) - ghRef;
MRF.update();
if (correctPhi)
{
// Calculate absolute flux
// from the mapped surface velocity
phi = mesh.Sf() & rhoUf();
#include "../../compressible/rhoPimpleFoam/correctPhi.H"
// Make the fluxes relative to the mesh-motion
fvc::makeRelative(phi, rho, U);
}
if (checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
}
parcels.evolve();
surfaceFilm.evolve();
if (pimple.solveFlow())
{
if (pimple.nCorrPIMPLE() <= 1)
{
#include "rhoEqn.H"
}
// --- PIMPLE loop
while (pimple.loop())
{
#include "UEqn.H"
#include "YEqn.H"
#include "EEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{
#include "pEqn.H"
}
if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = thermo.rho();
}
runTime.write();
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,55 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
-------------------------------------------------------------------------------
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/>.
Global
setMultiRegionDeltaT
Description
Reset the timestep to maintain a constant maximum Courant numbers.
Reduction of time-step is immediate, but increase is damped to avoid
unstable oscillations.
\*---------------------------------------------------------------------------*/
if (adjustTimeStep)
{
const scalar maxDeltaTFact =
min(maxCo/(CoNum + SMALL), maxCo/(surfaceFilm.CourantNumber() + SMALL));
const scalar deltaTFact =
min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
runTime.setDeltaT
(
min
(
deltaTFact*runTime.deltaTValue(),
maxDeltaT
)
);
Info<< "deltaT = " << runTime.deltaTValue() << endl;
}
// ************************************************************************* //

View File

@ -1,137 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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/>.
\*---------------------------------------------------------------------------*/
{
volScalarField& rDeltaT = trDeltaT.ref();
const dictionary& pimpleDict = pimple.dict();
// Maximum flow Courant number
scalar maxCo(pimpleDict.get<scalar>("maxCo"));
// Maximum time scale
scalar maxDeltaT(pimpleDict.getOrDefault<scalar>("maxDeltaT", GREAT));
// Smoothing parameter (0-1) when smoothing iterations > 0
scalar rDeltaTSmoothingCoeff
(
pimpleDict.getOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.1)
);
// Damping coefficient (1-0)
scalar rDeltaTDampingCoeff
(
pimpleDict.getOrDefault<scalar>("rDeltaTDampingCoeff", 0.2)
);
// Maximum change in cell temperature per iteration
// (relative to previous value)
scalar alphaTemp(pimpleDict.getOrDefault("alphaTemp", 0.05));
Info<< "Time scales min/max:" << endl;
// Cache old reciprocal time scale field
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
// Flow time scale
{
rDeltaT.ref() =
(
fvc::surfaceSum(mag(phi))()()
/((2*maxCo)*mesh.V()*rho())
);
// Limit the largest time scale
rDeltaT.max(1/maxDeltaT);
Info<< " Flow = "
<< gMin(1/rDeltaT.primitiveField()) << ", "
<< gMax(1/rDeltaT.primitiveField()) << endl;
}
// Reaction source time scale
{
volScalarField::Internal rDeltaTT
(
mag
(
parcels.hsTrans()/(mesh.V()*runTime.deltaT())
+ Qdot()
)
/(
alphaTemp
*rho()
*thermo.Cp()()()
*T()
)
);
Info<< " Temperature = "
<< gMin(1/(rDeltaTT.field() + VSMALL)) << ", "
<< gMax(1/(rDeltaTT.field() + VSMALL)) << endl;
rDeltaT.ref() = max
(
rDeltaT(),
rDeltaTT
);
}
// Update the boundary values of the reciprocal time-step
rDeltaT.correctBoundaryConditions();
// Spatially smooth the time scale field
if (rDeltaTSmoothingCoeff < 1.0)
{
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
}
// Limit rate of change of time scale
// - reduce as much as required
// - only increase at a fraction of old time scale
if
(
rDeltaTDampingCoeff < 1.0
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
)
{
rDeltaT = max
(
rDeltaT,
(scalar(1) - rDeltaTDampingCoeff)*rDeltaT0
);
}
Info<< " Overall = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
}
// ************************************************************************* //

View File

@ -7,6 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \
@ -46,6 +47,7 @@ EXE_LIBS = \
-lsurfaceFilmModels \ -lsurfaceFilmModels \
-lcombustionModels \ -lcombustionModels \
-lsampling \ -lsampling \
-lcoalCombustion \
-lregionFaModels \ -lregionFaModels \
-lfiniteArea \ -lfiniteArea \
-lfaOptions -lfaOptions

View File

@ -1,9 +1,9 @@
Info<< "\nConstructing coal cloud" << endl; Info<< "\nConstructing coal cloud" << endl;
reactingMultiphaseCloud parcels coalCloud parcels
( (
"reactingCloud1", "reactingCloud1",
g,
rho, rho,
U, U,
g,
slgThermo slgThermo
); );

View File

@ -37,7 +37,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "turbulentFluidThermoModel.H" #include "turbulentFluidThermoModel.H"
#include "reactingMultiphaseCloud.H" #include "coalCloud.H"
#include "rhoReactionThermo.H" #include "rhoReactionThermo.H"
#include "CombustionModel.H" #include "CombustionModel.H"
#include "radiationModel.H" #include "radiationModel.H"

View File

@ -35,6 +35,7 @@ EXE_LIBS = \
-llagrangian \ -llagrangian \
-llagrangianIntermediate \ -llagrangianIntermediate \
-llagrangianTurbulence \ -llagrangianTurbulence \
-llagrangianSpray \
-lspecie \ -lspecie \
-lcompressibleTransportModels \ -lcompressibleTransportModels \
-lfluidThermophysicalModels \ -lfluidThermophysicalModels \

View File

@ -1,9 +1,9 @@
Info<< "\nConstructing reacting cloud" << endl; Info<< "\nConstructing reacting cloud" << endl;
sprayCloud parcels basicSprayCloud parcels
( (
"sprayCloud", "sprayCloud",
g,
rho, rho,
U, U,
g,
slgThermo slgThermo
); );

View File

@ -39,6 +39,7 @@ EXE_LIBS = \
-llagrangian \ -llagrangian \
-llagrangianIntermediate \ -llagrangianIntermediate \
-llagrangianTurbulence \ -llagrangianTurbulence \
-llagrangianSpray \
-lspecie \ -lspecie \
-lcompressibleTransportModels \ -lcompressibleTransportModels \
-lfluidThermophysicalModels \ -lfluidThermophysicalModels \

View File

@ -37,7 +37,7 @@ Description
#include "engineTime.H" #include "engineTime.H"
#include "engineMesh.H" #include "engineMesh.H"
#include "turbulentFluidThermoModel.H" #include "turbulentFluidThermoModel.H"
#include "sprayCloud.H" #include "basicSprayCloud.H"
#include "psiReactionThermo.H" #include "psiReactionThermo.H"
#include "CombustionModel.H" #include "CombustionModel.H"
#include "radiationModel.H" #include "radiationModel.H"

View File

@ -34,6 +34,7 @@ EXE_LIBS = \
-lthermoTools \ -lthermoTools \
-llagrangian \ -llagrangian \
-llagrangianIntermediate \ -llagrangianIntermediate \
-llagrangianSpray \
-llagrangianTurbulence \ -llagrangianTurbulence \
-lspecie \ -lspecie \
-lcompressibleTransportModels \ -lcompressibleTransportModels \

View File

@ -35,7 +35,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#define CLOUD_BASE_TYPE spray #define CLOUD_BASE_TYPE Spray
#define CLOUD_BASE_TYPE_NAME "spray" #define CLOUD_BASE_TYPE_NAME "spray"
#include "simpleReactingParcelFoam.C" #include "simpleReactingParcelFoam.C"

View File

@ -40,6 +40,7 @@ EXE_LIBS = \
-llagrangian \ -llagrangian \
-llagrangianIntermediate \ -llagrangianIntermediate \
-llagrangianTurbulence \ -llagrangianTurbulence \
-llagrangianSpray \
-lspecie \ -lspecie \
-lcompressibleTransportModels \ -lcompressibleTransportModels \
-lfluidThermophysicalModels \ -lfluidThermophysicalModels \

View File

@ -38,7 +38,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "dynamicFvMesh.H" #include "dynamicFvMesh.H"
#include "turbulenceModel.H" #include "turbulenceModel.H"
#include "sprayCloud.H" #include "basicSprayCloud.H"
#include "psiReactionThermo.H" #include "psiReactionThermo.H"
#include "CombustionModel.H" #include "CombustionModel.H"
#include "radiationModel.H" #include "radiationModel.H"

View File

@ -37,7 +37,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "turbulentFluidThermoModel.H" #include "turbulentFluidThermoModel.H"
#include "sprayCloud.H" #include "basicSprayCloud.H"
#include "psiReactionThermo.H" #include "psiReactionThermo.H"
#include "CombustionModel.H" #include "CombustionModel.H"
#include "radiationModel.H" #include "radiationModel.H"

View File

@ -9,8 +9,6 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \

View File

@ -55,11 +55,11 @@ const word kinematicCloudName
); );
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl; Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
kinematicCloud kCloud basicKinematicCloud kinematicCloud
( (
kinematicCloudName, kinematicCloudName,
g,
rho, rho,
U, U,
thermo.mu() thermo.mu(),
g
); );

View File

@ -10,8 +10,6 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \

View File

@ -37,7 +37,7 @@ Description
#include "dynamicFvMesh.H" #include "dynamicFvMesh.H"
#include "psiThermo.H" #include "psiThermo.H"
#include "turbulentFluidThermoModel.H" #include "turbulentFluidThermoModel.H"
#include "kinematicCloud.H" #include "basicKinematicCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -73,14 +73,14 @@ int main(int argc, char *argv[])
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
kCloud.storeGlobalPositions(); kinematicCloud.storeGlobalPositions();
mesh.update(); mesh.update();
U.correctBoundaryConditions(); U.correctBoundaryConditions();
Info<< "Evolving " << kCloud.name() << endl; Info<< "Evolving " << kinematicCloud.name() << endl;
kCloud.evolve(); kinematicCloud.evolve();
runTime.write(); runTime.write();

View File

@ -39,7 +39,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "psiThermo.H" #include "psiThermo.H"
#include "turbulentFluidThermoModel.H" #include "turbulentFluidThermoModel.H"
#include "kinematicCloud.H" #include "basicKinematicCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -75,8 +75,8 @@ int main(int argc, char *argv[])
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
Info<< "Evolving " << kCloud.name() << endl; Info<< "Evolving " << kinematicCloud.name() << endl;
kCloud.evolve(); kinematicCloud.evolve();
runTime.write(); runTime.write();

View File

@ -52,7 +52,7 @@ Description
#include "CorrectPhi.H" #include "CorrectPhi.H"
#include "fvcSmooth.H" #include "fvcSmooth.H"
#include "kinematicCloud.H" #include "basicKinematicCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -111,12 +111,12 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
Info<< "Evolving " << kCloud.name() << endl; Info<< "Evolving " << kinematicCloud.name() << endl;
kCloud.evolve(); kinematicCloud.evolve();
// Update continuous phase volume fraction field // Update continuous phase volume fraction field
alphac = max(1.0 - kCloud.theta(), alphacMin); alphac = max(1.0 - kinematicCloud.theta(), alphacMin);
alphac.correctBoundaryConditions(); alphac.correctBoundaryConditions();
Info<< "Continuous phase-1 volume fraction = " Info<< "Continuous phase-1 volume fraction = "
@ -130,7 +130,7 @@ int main(int argc, char *argv[])
alphaPhic = alphacf*phi; alphaPhic = alphacf*phi;
alphacRho = alphac*rho; alphacRho = alphac*rho;
fvVectorMatrix cloudSU(kCloud.SU(U)); fvVectorMatrix cloudSU(kinematicCloud.SU(U));
volVectorField cloudVolSUSu volVectorField cloudVolSUSu
( (
IOobject IOobject

View File

@ -12,14 +12,11 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \

View File

@ -147,13 +147,13 @@ volScalarField alphacRho(alphac*rho);
alphacRho.oldTime(); alphacRho.oldTime();
Info<< "Constructing kinematicCloud " << endl; Info<< "Constructing kinematicCloud " << endl;
kinematicCloud kCloud basicKinematicCloud kinematicCloud
( (
"kinematicCloud", "kinematicCloud",
g,
rho, rho,
U, U,
mu mu,
g
); );
// Particle fraction upper limit // Particle fraction upper limit
@ -161,13 +161,13 @@ scalar alphacMin
( (
1.0 1.0
- ( - (
kCloud.particleProperties().subDict("constantProperties") kinematicCloud.particleProperties().subDict("constantProperties")
.get<scalar>("alphaMax") .get<scalar>("alphaMax")
) )
); );
// Update alphac from the particle locations // Update alphac from the particle locations
alphac = max(1.0 - kCloud.theta(), alphacMin); alphac = max(1.0 - kinematicCloud.theta(), alphacMin);
alphac.correctBoundaryConditions(); alphac.correctBoundaryConditions();
surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac)); surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac));

View File

@ -34,8 +34,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef Foam_DTRMParticle_H #ifndef DTRMParticle_H
#define Foam_DTRMParticle_H #define DTRMParticle_H
#include "particle.H" #include "particle.H"
#include "IOstream.H" #include "IOstream.H"
@ -50,13 +50,12 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward Declarations
class DTRMParticle; class DTRMParticle;
Ostream& operator<<(Ostream&, const DTRMParticle&);
using namespace Foam::radiation; using namespace Foam::radiation;
// Forward declaration of friend functions
Ostream& operator<<(Ostream&, const DTRMParticle&);
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class DTRMParticle Declaration Class DTRMParticle Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -131,7 +130,7 @@ public:
); );
// Member Functions // Member functions
inline const interpolationCell<scalar>& aInterp() const; inline const interpolationCell<scalar>& aInterp() const;
inline const interpolationCell<scalar>& eInterp() const; inline const interpolationCell<scalar>& eInterp() const;
@ -233,34 +232,37 @@ public:
// Access // Access
//- Return const access to the initial position //- Return const access to the initial position
const point& p0() const noexcept { return p0_; } inline const point& p0() const;
//- Return const access to the target position //- Return const access to the target position
const point& p1() const noexcept { return p1_; } inline const point& p1() const;
//- Return const access to the initial intensity //- Return const access to the initial intensity
scalar I0() const noexcept { return I0_; } inline scalar I0() const;
//- Return const access to the current intensity //- Return const access to the current intensity
scalar I() const noexcept { return I_; } inline scalar I() const;
//- Return const access dA //- Return const access dA
scalar dA() const noexcept { return dA_; } inline scalar dA() const;
// Edit // Edit
//- Return access to the target position //- Return access to the target position
point& p1() noexcept { return p1_; } inline point& p1();
//- Return access to the initial intensity //- Return access to the initial intensity
scalar& I0() noexcept { return I0_; } inline scalar& I0();
//- Return access to the current intensity //- Return access to the current intensity
scalar& I() noexcept { return I_; } inline scalar& I();
//- Return access to dA //- Return access to dA
scalar& dA() noexcept { return dA_; } inline scalar& dA();
//- Return access to reflectedId
inline label& reflectedId();
// Tracking // Tracking

View File

@ -107,4 +107,58 @@ inline Foam::scalar& Foam::DTRMParticle::trackingData::Q(label celli)
} }
inline const Foam::point& Foam::DTRMParticle::p0() const
{
return p0_;
}
inline const Foam::point& Foam::DTRMParticle::p1() const
{
return p1_;
}
inline Foam::scalar Foam::DTRMParticle::I0() const
{
return I0_;
}
inline Foam::scalar Foam::DTRMParticle::I() const
{
return I_;
}
inline Foam::scalar Foam::DTRMParticle::dA() const
{
return dA_;
}
inline Foam::scalar& Foam::DTRMParticle::dA()
{
return dA_;
}
inline Foam::point& Foam::DTRMParticle::p1()
{
return p1_;
}
inline Foam::scalar& Foam::DTRMParticle::I0()
{
return I0_;
}
inline Foam::scalar& Foam::DTRMParticle::I()
{
return I_;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -1,3 +0,0 @@
Test-barycentric.C
EXE = $(FOAM_USER_APPBIN)/Test-barycentric

View File

@ -1,2 +0,0 @@
/* EXE_INC = */
/* EXE_LIBS = */

View File

@ -1,93 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
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/>.
Application
Test-barycentric
Description
Some simple tests for barycentric coordinates and transforms
\*---------------------------------------------------------------------------*/
#include "barycentricTensor.H"
#include "tetrahedron.H"
#include "vectorField.H"
#include "IOstreams.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
// Tets to test
tetPoints tetA
(
point(0, 0, 0),
point(1, 0, 0),
point(1, 1, 0),
point(1, 1, 1)
);
const barycentricTensor baryT(tetA[0], tetA[1], tetA[2], tetA[3]);
Info<< nl << "Tet: " << tetA << nl;
Info<< "tens:" << baryT << nl;
for
(
const barycentric& bary :
List<barycentric>
({
{0.25, 0.25, 0.25, 0.25},
{1, 0, 0, 0},
{0, 1, 0, 0},
{0, 0, 1, 0},
{0, 0, 0, 1},
{0, 0, 0, 0} // Not really valid
})
)
{
vector v(tetA.tet().barycentricToPoint(bary));
barycentric b(tetA.tet().pointToBarycentric(v));
Info<< nl
<< "bary: " << bary << nl
<< "vec: " << v << nl
// << "Vec: " << baryT.inner(bary) << nl
<< "Vec: " << (baryT & bary) << nl
<< "bary: " << b << nl
// This won't work (needs a differently defined tensor)
// << "Bary: " << (v & baryT) << nl
;
}
Info<< "\nEnd\n" << nl;
return 0;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -38,7 +38,7 @@ Description
#include "polyMesh.H" #include "polyMesh.H"
#include "ListOps.H" #include "ListOps.H"
#include "face.H" #include "face.H"
#include "tetrahedron.H" #include "tetPointRef.H"
#include "triFaceList.H" #include "triFaceList.H"
#include "OFstream.H" #include "OFstream.H"
#include "meshTools.H" #include "meshTools.H"

View File

@ -6,7 +6,6 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -32,7 +31,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "tetrahedron.H" #include "tetPointRef.H"
#include "OFstream.H" #include "OFstream.H"
#include "meshTools.H" #include "meshTools.H"
#include "cut.H" #include "cut.H"
@ -45,12 +44,12 @@ void writeOBJ
( (
Ostream& os, Ostream& os,
label& vertI, label& vertI,
const tetPoints& tet const FixedList<point, 4>& tet
) )
{ {
for (const point& p : tet) forAll(tet, fp)
{ {
meshTools::writeOBJ(os, p); meshTools::writeOBJ(os, tet[fp]);
} }
os << "l " << vertI+1 << ' ' << vertI+2 << nl os << "l " << vertI+1 << ' ' << vertI+2 << nl
<< "l " << vertI+1 << ' ' << vertI+3 << nl << "l " << vertI+1 << ' ' << vertI+3 << nl
@ -62,27 +61,33 @@ void writeOBJ
} }
tetPointRef makeTetPointRef(const FixedList<point, 4>& p)
{
return tetPointRef(p[0], p[1], p[2], p[3]);
}
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
// Tets to test // Tets to test
tetPoints tetA FixedList<point, 4> tetA
( ({
point(0, 0, 0), point(0, 0, 0),
point(1, 0, 0), point(1, 0, 0),
point(1, 1, 0), point(1, 1, 0),
point(1, 1, 1) point(1, 1, 1)
); });
tetPoints tetB FixedList<point, 4> tetB
( ({
point(0.1, 0.1, 0.1), point(0.1, 0.1, 0.1),
point(1.1, 0.1, 0.1), point(1.1, 0.1, 0.1),
point(1.1, 1.1, 0.1), point(1.1, 1.1, 0.1),
point(1.1, 1.1, 1.1) point(1.1, 1.1, 1.1)
); });
// Do intersection // Do intersection
typedef DynamicList<tetPoints> tetList; typedef DynamicList<FixedList<point, 4>> tetList;
tetList tetsIn1, tetsIn2, tetsOut; tetList tetsIn1, tetsIn2, tetsOut;
cut::appendOp<tetList> tetOpIn1(tetsIn1); cut::appendOp<tetList> tetOpIn1(tetsIn1);
cut::appendOp<tetList> tetOpIn2(tetsIn2); cut::appendOp<tetList> tetOpIn2(tetsIn2);
@ -150,25 +155,25 @@ int main(int argc, char *argv[])
// Check the volumes // Check the volumes
Info<< "Vol A: " << tetA.tet().mag() << endl; Info<< "Vol A: " << makeTetPointRef(tetA).mag() << endl;
scalar volIn = 0; scalar volIn = 0;
for (const auto& t : tetsIn) forAll(tetsIn, i)
{ {
volIn += t.tet().mag(); volIn += makeTetPointRef(tetsIn[i]).mag();
} }
Info<< "Vol A inside B: " << volIn << endl; Info<< "Vol A inside B: " << volIn << endl;
scalar volOut = 0; scalar volOut = 0;
for (const auto& t : tetsOut) forAll(tetsOut, i)
{ {
volOut += t.tet().mag(); volOut += makeTetPointRef(tetsOut[i]).mag();
} }
Info<< "Vol A outside B: " << volOut << endl; Info<< "Vol A outside B: " << volOut << endl;
Info<< "Sum inside and outside: " << volIn + volOut << endl; Info<< "Sum inside and outside: " << volIn + volOut << endl;
if (mag(volIn + volOut - tetA.tet().mag()) > SMALL) if (mag(volIn + volOut - makeTetPointRef(tetA).mag()) > SMALL)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Tet volumes do not sum up to input tet." << "Tet volumes do not sum up to input tet."

View File

@ -31,7 +31,7 @@ License
#include "pointIOField.H" #include "pointIOField.H"
#include "scalarIOField.H" #include "scalarIOField.H"
#include "triadIOField.H" #include "triadIOField.H"
#include "tetrahedron.H" #include "tetPointRef.H"
#include "plane.H" #include "plane.H"
#include "transform.H" #include "transform.H"
#include "meshTools.H" #include "meshTools.H"

View File

@ -27,6 +27,7 @@ License
#include "fileControl.H" #include "fileControl.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "tetPointRef.H"
#include "scalarList.H" #include "scalarList.H"
#include "vectorTools.H" #include "vectorTools.H"
#include "pointIOField.H" #include "pointIOField.H"
@ -49,6 +50,9 @@ addToRunTimeSelectionTable
} }
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fileControl::fileControl Foam::fileControl::fileControl

View File

@ -31,6 +31,7 @@ License
#include "cellSizeFunction.H" #include "cellSizeFunction.H"
#include "triSurfaceMesh.H" #include "triSurfaceMesh.H"
#include "searchableBox.H" #include "searchableBox.H"
#include "tetPointRef.H"
#include "vectorTools.H" #include "vectorTools.H"
#include "quaternion.H" #include "quaternion.H"

View File

@ -26,7 +26,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "plane.H" #include "plane.H"
#include "tetrahedron.H" #include "tetPointRef.H"
#include "pointConversion.H" #include "pointConversion.H"
#include "CGALTriangulation3DKernel.H" #include "CGALTriangulation3DKernel.H"

View File

@ -4,7 +4,7 @@
#include "polyMeshTools.H" #include "polyMeshTools.H"
#include "zeroGradientFvPatchFields.H" #include "zeroGradientFvPatchFields.H"
#include "syncTools.H" #include "syncTools.H"
#include "tetrahedron.H" #include "tetPointRef.H"
#include "regionSplit.H" #include "regionSplit.H"
#include "wallDist.H" #include "wallDist.H"
#include "cellAspectRatio.H" #include "cellAspectRatio.H"

View File

@ -606,7 +606,7 @@ void syncPoints
pointField nbrPatchInfo(procPatch.nPoints()); pointField nbrPatchInfo(procPatch.nPoints());
{ {
// We do not know the number of points on the other side // We do not know the number of points on the other side
// so cannot use UIPstream::read // so cannot use Pstream::read.
IPstream fromNbr IPstream fromNbr
( (
Pstream::commsTypes::blocking, Pstream::commsTypes::blocking,

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2020-2022 OpenCFD Ltd. Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -55,30 +55,17 @@ int main(int argc, char *argv[])
( (
"deltaT", "deltaT",
"time", "time",
"Override deltaT (eg, for accelerated motion)" "Override deltaT for accelerated motion"
);
argList::addOption
(
"endTime",
"time",
"Override endTime (eg, for shorter tests)"
); );
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createNamedMesh.H" #include "createNamedMesh.H"
scalar timeVal = 0; scalar deltaT = 0;
if (args.readIfPresent("deltaT", timeVal)) if (args.readIfPresent("deltaT", deltaT))
{ {
runTime.setDeltaT(timeVal); runTime.setDeltaT(deltaT);
}
if (args.readIfPresent("endTime", timeVal))
{
runTime.stopAt(Time::stopAtControls::saEndTime);
runTime.setEndTime(timeVal);
} }
autoPtr<motionSolver> motionPtr = motionSolver::New(mesh); autoPtr<motionSolver> motionPtr = motionSolver::New(mesh);

View File

@ -35,8 +35,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef Foam_passivePositionParticle_H #ifndef passivePositionParticle_H
#define Foam_passivePositionParticle_H #define passivePositionParticle_H
#include "passiveParticle.H" #include "passiveParticle.H"
@ -130,9 +130,7 @@ public:
}; };
// Member Functions const point& cachedPosition() const
const point& cachedPosition() const noexcept
{ {
return cachedPosition_; return cachedPosition_;
} }

View File

@ -55,7 +55,7 @@
# [WM_PROJECT_VERSION] - A human-readable version name # [WM_PROJECT_VERSION] - A human-readable version name
# A development version is often named 'com' - as in www.openfoam.com # A development version is often named 'com' - as in www.openfoam.com
export WM_PROJECT_VERSION=com export WM_PROJECT_VERSION=v2206
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Configuration environment variables. # Configuration environment variables.

View File

@ -13,7 +13,7 @@ executeControl writeTime;
writeControl writeTime; writeControl writeTime;
setFormat vtk; setFormat vtk;
direction forward; // (forward | backward | bidirectional) trackForward true;
lifeTime 10000; lifeTime 10000;
nSubCycle 5; nSubCycle 5;

View File

@ -55,7 +55,7 @@
# [WM_PROJECT_VERSION] - A human-readable version name # [WM_PROJECT_VERSION] - A human-readable version name
# A development version is often named 'com' - as in www.openfoam.com # A development version is often named 'com' - as in www.openfoam.com
setenv WM_PROJECT_VERSION com setenv WM_PROJECT_VERSION v2206
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Configuration environment variables. # Configuration environment variables.

View File

@ -27,7 +27,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "dynamicIndexedOctree.H" #include "dynamicIndexedOctree.H"
#include "line.H" #include "linePointRef.H"
#include "OFstream.H" #include "OFstream.H"
#include "ListOps.H" #include "ListOps.H"

View File

@ -35,8 +35,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef Foam_dynamicIndexedOctree_H #ifndef dynamicIndexedOctree_H
#define Foam_dynamicIndexedOctree_H #define dynamicIndexedOctree_H
#include "treeBoundBox.H" #include "treeBoundBox.H"
#include "pointIndexHit.H" #include "pointIndexHit.H"
@ -54,7 +54,7 @@ namespace Foam
typedef DynamicList<autoPtr<DynamicList<label>>> contentListList; typedef DynamicList<autoPtr<DynamicList<label>>> contentListList;
// Forward Declarations // Forward declaration of classes
template<class Type> class dynamicIndexedOctree; template<class Type> class dynamicIndexedOctree;
template<class Type> Ostream& operator<< template<class Type> Ostream& operator<<

View File

@ -39,12 +39,12 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef Foam_dynamicTreeDataPoint_H #ifndef dynamicTreeDataPoint_H
#define Foam_dynamicTreeDataPoint_H #define dynamicTreeDataPoint_H
#include "pointField.H" #include "pointField.H"
#include "treeBoundBox.H" #include "treeBoundBox.H"
#include "line.H" #include "linePointRef.H"
#include "volumeType.H" #include "volumeType.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -52,7 +52,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward Declarations // Forward declaration of classes
template<class Type> class dynamicIndexedOctree; template<class Type> class dynamicIndexedOctree;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\

View File

@ -27,7 +27,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "indexedOctree.H" #include "indexedOctree.H"
#include "line.H" #include "linePointRef.H"
#include "OFstream.H" #include "OFstream.H"
#include "ListOps.H" #include "ListOps.H"
#include "memInfo.H" #include "memInfo.H"

View File

@ -34,8 +34,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef Foam_indexedOctree_H #ifndef indexedOctree_H
#define Foam_indexedOctree_H #define indexedOctree_H
#include "treeBoundBox.H" #include "treeBoundBox.H"
#include "pointIndexHit.H" #include "pointIndexHit.H"
@ -51,7 +51,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward Declarations // Forward declaration of classes
template<class Type> class indexedOctree; template<class Type> class indexedOctree;
template<class Type> Ostream& operator<<(Ostream&, const indexedOctree<Type>&); template<class Type> Ostream& operator<<(Ostream&, const indexedOctree<Type>&);
class Istream; class Istream;

View File

@ -789,7 +789,7 @@ bool Foam::decomposedBlockData::writeBlocks
for (label proci = 1; proci < nProcs; ++proci) for (label proci = 1; proci < nProcs; ++proci)
{ {
elems.resize(recvSizes[proci]); elems.resize(recvSizes[proci]);
UIPstream::read IPstream::read
( (
UPstream::commsTypes::scheduled, UPstream::commsTypes::scheduled,
proci, proci,

View File

@ -119,7 +119,7 @@ void Foam::processorCyclicPointPatchField<Type>::initSwapAddSeparated
if (commsType == Pstream::commsTypes::nonBlocking) if (commsType == Pstream::commsTypes::nonBlocking)
{ {
receiveBuf_.setSize(pf.size()); receiveBuf_.setSize(pf.size());
UIPstream::read IPstream::read
( (
commsType, commsType,
procPatch_.neighbProcNo(), procPatch_.neighbProcNo(),
@ -129,7 +129,7 @@ void Foam::processorCyclicPointPatchField<Type>::initSwapAddSeparated
procPatch_.comm() procPatch_.comm()
); );
} }
UOPstream::write OPstream::write
( (
commsType, commsType,
procPatch_.neighbProcNo(), procPatch_.neighbProcNo(),
@ -155,7 +155,7 @@ void Foam::processorCyclicPointPatchField<Type>::swapAddSeparated
if (commsType != Pstream::commsTypes::nonBlocking) if (commsType != Pstream::commsTypes::nonBlocking)
{ {
receiveBuf_.setSize(this->size()); receiveBuf_.setSize(this->size());
UIPstream::read IPstream::read
( (
commsType, commsType,
procPatch_.neighbProcNo(), procPatch_.neighbProcNo(),

View File

@ -86,7 +86,7 @@ Foam::LUscalarMatrix::LUscalarMatrix
if (Pstream::master(comm_)) if (Pstream::master(comm_))
{ {
for (const int proci : Pstream::subProcs(comm_)) for (const int slave : Pstream::subProcs(comm_))
{ {
lduMatrices.set lduMatrices.set
( (
@ -96,7 +96,7 @@ Foam::LUscalarMatrix::LUscalarMatrix
IPstream IPstream
( (
Pstream::commsTypes::scheduled, Pstream::commsTypes::scheduled,
proci, slave,
0, // bufSize 0, // bufSize
Pstream::msgType(), Pstream::msgType(),
comm_ comm_

View File

@ -54,17 +54,17 @@ void Foam::LUscalarMatrix::solve
SubList<Type>(X, x.size()) = x; SubList<Type>(X, x.size()) = x;
for (const int proci : Pstream::subProcs(comm_)) for (const int slave : Pstream::subProcs(comm_))
{ {
UIPstream::read IPstream::read
( (
Pstream::commsTypes::scheduled, Pstream::commsTypes::scheduled,
proci, slave,
reinterpret_cast<char*> reinterpret_cast<char*>
( (
&(X[procOffsets_[proci]]) &(X[procOffsets_[slave]])
), ),
(procOffsets_[proci+1]-procOffsets_[proci])*sizeof(Type), (procOffsets_[slave+1]-procOffsets_[slave])*sizeof(Type),
Pstream::msgType(), Pstream::msgType(),
comm_ comm_
); );
@ -72,7 +72,7 @@ void Foam::LUscalarMatrix::solve
} }
else else
{ {
UOPstream::write OPstream::write
( (
Pstream::commsTypes::scheduled, Pstream::commsTypes::scheduled,
Pstream::masterNo(), Pstream::masterNo(),
@ -89,17 +89,17 @@ void Foam::LUscalarMatrix::solve
x = SubList<Type>(X, x.size()); x = SubList<Type>(X, x.size());
for (const int proci : Pstream::subProcs(comm_)) for (const int slave : Pstream::subProcs(comm_))
{ {
UOPstream::write OPstream::write
( (
Pstream::commsTypes::scheduled, Pstream::commsTypes::scheduled,
proci, slave,
reinterpret_cast<const char*> reinterpret_cast<const char*>
( (
&(X[procOffsets_[proci]]) &(X[procOffsets_[slave]])
), ),
(procOffsets_[proci+1]-procOffsets_[proci])*sizeof(Type), (procOffsets_[slave+1]-procOffsets_[slave])*sizeof(Type),
Pstream::msgType(), Pstream::msgType(),
comm_ comm_
); );
@ -107,7 +107,7 @@ void Foam::LUscalarMatrix::solve
} }
else else
{ {
UIPstream::read IPstream::read
( (
Pstream::commsTypes::scheduled, Pstream::commsTypes::scheduled,
Pstream::masterNo(), Pstream::masterNo(),

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2022 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -54,7 +54,6 @@ SourceFiles
#define Foam_LduMatrix_H #define Foam_LduMatrix_H
#include "lduMesh.H" #include "lduMesh.H"
#include "lduMatrix.H"
#include "Field.H" #include "Field.H"
#include "FieldField.H" #include "FieldField.H"
#include "LduInterfaceFieldPtrsList.H" #include "LduInterfaceFieldPtrsList.H"
@ -70,7 +69,8 @@ namespace Foam
// Forward Declarations // Forward Declarations
template<class Type, class DType, class LUType> class LduMatrix; template<class Type, class DType, class LUType>
class LduMatrix;
template<class Type, class DType, class LUType> template<class Type, class DType, class LUType>
Ostream& operator<< Ostream& operator<<
@ -119,13 +119,16 @@ public:
// Protected Data // Protected Data
//- Default maximum number of iterations in the solver
static const label defaultMaxIter_ = 1000;
word fieldName_; word fieldName_;
const LduMatrix<Type, DType, LUType>& matrix_; const LduMatrix<Type, DType, LUType>& matrix_;
//- Dictionary of solution controls //- Dictionary of controls
dictionary controlDict_; dictionary controlDict_;
//- Verbosity level for solver output statements //- Level of verbosity in the solver output statements
int log_; int log_;
//- Minimum number of iterations in the solver //- Minimum number of iterations in the solver
@ -134,9 +137,6 @@ public:
//- Maximum number of iterations in the solver //- Maximum number of iterations in the solver
label maxIter_; label maxIter_;
//- The matrix normalisation type
lduMatrix::normTypes normType_;
//- Final convergence tolerance //- Final convergence tolerance
Type tolerance_; Type tolerance_;
@ -146,7 +146,7 @@ public:
// Protected Member Functions // Protected Member Functions
//- Read the control parameters from controlDict_ //- Read the control parameters from the controlDict_
virtual void readControls(); virtual void readControls();
@ -206,7 +206,6 @@ public:
// Constructors // Constructors
//- Construct for given field name, matrix and controls
solver solver
( (
const word& fieldName, const word& fieldName,
@ -226,8 +225,9 @@ public:
); );
//- Destructor // Destructor
virtual ~solver() = default;
virtual ~solver() = default;
// Member Functions // Member Functions
@ -244,33 +244,21 @@ public:
//- Read and reset the solver parameters from the given dictionary //- Read and reset the solver parameters from the given dictionary
virtual void read(const dictionary&); virtual void read(const dictionary& solverDict);
virtual SolverPerformance<Type> solve virtual SolverPerformance<Type> solve
( (
Field<Type>& psi Field<Type>& psi
) const = 0; ) const = 0;
//- Return the matrix norm using the specified norm method
Type normFactor
(
const Field<Type>& psi,
const Field<Type>& Apsi,
Field<Type>& tmpField,
const lduMatrix::normTypes normType
) const;
//- Return the matrix norm used to normalise the residual for the //- Return the matrix norm used to normalise the residual for the
//- stopping criterion // stopping criterion
Type normFactor Type normFactor
( (
const Field<Type>& psi, const Field<Type>& psi,
const Field<Type>& Apsi, const Field<Type>& Apsi,
Field<Type>& tmpField Field<Type>& tmpField
) const ) const;
{
return this->normFactor(psi, Apsi, tmpField, normType_);
}
}; };
@ -326,7 +314,6 @@ public:
// Constructors // Constructors
//- Construct for given field name and matrix
smoother smoother
( (
const word& fieldName, const word& fieldName,
@ -345,8 +332,9 @@ public:
); );
//- Destructor // Destructor
virtual ~smoother() = default;
virtual ~smoother() = default;
// Member Functions // Member Functions
@ -417,8 +405,10 @@ public:
// Constructors // Constructors
//- Construct for given solver preconditioner
preconditioner(const solver& sol) (
const solver& sol
)
: :
solver_(sol) solver_(sol)
{} {}
@ -434,15 +424,16 @@ public:
); );
//- Destructor // Destructor
virtual ~preconditioner() = default;
virtual ~preconditioner() = default;
// Member functions // Member functions
//- Read and reset the preconditioner parameters //- Read and reset the preconditioner parameters
//- from the given dictionary // from the given dictionary
virtual void read(const dictionary&) virtual void read(const dictionary& preconditionerDict)
{} {}
//- Return wA the preconditioned form of residual rA //- Return wA the preconditioned form of residual rA
@ -453,7 +444,7 @@ public:
) const = 0; ) const = 0;
//- Return wT the transpose-matrix preconditioned form of //- Return wT the transpose-matrix preconditioned form of
//- residual rT. // residual rT.
// This is only required for preconditioning asymmetric matrices. // This is only required for preconditioning asymmetric matrices.
virtual void preconditionT virtual void preconditionT
( (
@ -489,16 +480,17 @@ public:
LduMatrix(const lduMesh&, Istream&); LduMatrix(const lduMesh&, Istream&);
//- Destructor // Destructor
~LduMatrix();
~LduMatrix();
// Member Functions // Member functions
// Access to addressing // Access to addressing
//- Return the LDU mesh from which the addressing is obtained //- Return the LDU mesh from which the addressing is obtained
const lduMesh& mesh() const noexcept const lduMesh& mesh() const
{ {
return lduMesh_; return lduMesh_;
} }
@ -562,43 +554,43 @@ public:
} }
bool hasDiag() const noexcept bool hasDiag() const
{ {
return (diagPtr_); return (diagPtr_);
} }
bool hasUpper() const noexcept bool hasUpper() const
{ {
return (upperPtr_); return (upperPtr_);
} }
bool hasLower() const noexcept bool hasLower() const
{ {
return (lowerPtr_); return (lowerPtr_);
} }
bool hasSource() const noexcept bool hasSource() const
{ {
return (sourcePtr_); return (sourcePtr_);
} }
bool diagonal() const noexcept bool diagonal() const
{ {
return (diagPtr_ && !lowerPtr_ && !upperPtr_); return (diagPtr_ && !lowerPtr_ && !upperPtr_);
} }
bool symmetric() const noexcept bool symmetric() const
{ {
return (diagPtr_ && (!lowerPtr_ && upperPtr_)); return (diagPtr_ && (!lowerPtr_ && upperPtr_));
} }
bool asymmetric() const noexcept bool asymmetric() const
{ {
return (diagPtr_ && lowerPtr_ && upperPtr_); return (diagPtr_ && lowerPtr_ && upperPtr_);
} }
// Operations // operations
void sumDiag(); void sumDiag();
void negSumDiag(); void negSumDiag();
@ -648,7 +640,7 @@ public:
tmp<Field<Type>> faceH(const tmp<Field<Type>>&) const; tmp<Field<Type>> faceH(const tmp<Field<Type>>&) const;
// Member Operators // Member operators
void operator=(const LduMatrix<Type, DType, LUType>&); void operator=(const LduMatrix<Type, DType, LUType>&);
@ -661,7 +653,7 @@ public:
void operator*=(scalar); void operator*=(scalar);
// Ostream Operator // Ostream operator
friend Ostream& operator<< <Type, DType, LUType> friend Ostream& operator<< <Type, DType, LUType>
( (

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2022 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -131,9 +131,8 @@ Foam::LduMatrix<Type, DType, LUType>::solver::solver
log_(1), log_(1),
minIter_(0), minIter_(0),
maxIter_(lduMatrix::defaultMaxIter), maxIter_(defaultMaxIter_),
normType_(lduMatrix::normTypes::DEFAULT_NORM), tolerance_(1e-6*pTraits<Type>::one),
tolerance_(lduMatrix::defaultTolerance*pTraits<Type>::one),
relTol_(Zero) relTol_(Zero)
{ {
readControls(); readControls();
@ -146,8 +145,6 @@ template<class Type, class DType, class LUType>
void Foam::LduMatrix<Type, DType, LUType>::solver::readControls() void Foam::LduMatrix<Type, DType, LUType>::solver::readControls()
{ {
controlDict_.readIfPresent("log", log_); controlDict_.readIfPresent("log", log_);
normType_ = lduMatrix::normTypes::DEFAULT_NORM;
lduMatrix::normTypesNames_.readIfPresent("norm", controlDict_, normType_);
controlDict_.readIfPresent("minIter", minIter_); controlDict_.readIfPresent("minIter", minIter_);
controlDict_.readIfPresent("maxIter", maxIter_); controlDict_.readIfPresent("maxIter", maxIter_);
controlDict_.readIfPresent("tolerance", tolerance_); controlDict_.readIfPresent("tolerance", tolerance_);
@ -171,45 +168,21 @@ Type Foam::LduMatrix<Type, DType, LUType>::solver::normFactor
( (
const Field<Type>& psi, const Field<Type>& psi,
const Field<Type>& Apsi, const Field<Type>& Apsi,
Field<Type>& tmpField, Field<Type>& tmpField
const lduMatrix::normTypes normType
) const ) const
{ {
switch (normType) // --- Calculate A dot reference value of psi
{ matrix_.sumA(tmpField);
case lduMatrix::normTypes::NO_NORM : cmptMultiply(tmpField, tmpField, gAverage(psi));
{
break;
}
case lduMatrix::normTypes::DEFAULT_NORM : return stabilise
case lduMatrix::normTypes::L1_SCALED_NORM : (
{ gSum(cmptMag(Apsi - tmpField) + cmptMag(matrix_.source() - tmpField)),
// --- Calculate A dot reference value of psi SolverPerformance<Type>::small_
matrix_.sumA(tmpField); );
cmptMultiply(tmpField, tmpField, gAverage(psi));
return stabilise // At convergence this simpler method is equivalent to the above
( // return stabilise(2*gSumCmptMag(matrix_.source()), matrix_.small_);
gSum
(
cmptMag(Apsi - tmpField)
+ cmptMag(matrix_.source() - tmpField)
),
SolverPerformance<Type>::small_
);
// Equivalent at convergence:
// return stabilise
// (
// 2*gSumCmptMag(matrix_.source()), matrix_.small_
// );
break;
}
}
// Fall-through: no norm
return pTraits<Type>::one;
} }

View File

@ -34,8 +34,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef Foam_DiagonalSolver_H #ifndef DiagonalSolver_H
#define Foam_DiagonalSolver_H #define DiagonalSolver_H
#include "LduMatrix.H" #include "LduMatrix.H"
@ -53,9 +53,7 @@ class DiagonalSolver
: :
public LduMatrix<Type, DType, LUType>::solver public LduMatrix<Type, DType, LUType>::solver
{ {
public: // Private Member Functions
// Generated Methods
//- No copy construct //- No copy construct
DiagonalSolver(const DiagonalSolver&) = delete; DiagonalSolver(const DiagonalSolver&) = delete;
@ -64,6 +62,8 @@ public:
void operator=(const DiagonalSolver&) = delete; void operator=(const DiagonalSolver&) = delete;
public:
//- Runtime type information //- Runtime type information
TypeName("diagonal"); TypeName("diagonal");

View File

@ -37,8 +37,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef Foam_SmoothSolver_H #ifndef SmoothSolver_H
#define Foam_SmoothSolver_H #define SmoothSolver_H
#include "lduMatrix.H" #include "lduMatrix.H"
@ -56,9 +56,10 @@ class SmoothSolver
: :
public LduMatrix<Type, DType, LUType>::solver public LduMatrix<Type, DType, LUType>::solver
{ {
protected: protected:
// Protected Data // Protected data
//- Number of sweeps before the evaluation of residual //- Number of sweeps before the evaluation of residual
label nSweeps_; label nSweeps_;

Some files were not shown because too many files have changed in this diff Show More