mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
MRG: Initial commit after latest Foundation merge
This commit is contained in:
@ -1,3 +1,5 @@
|
|||||||
|
#include "createRDeltaT.H"
|
||||||
|
|
||||||
Info<< "Creating reaction model\n" << endl;
|
Info<< "Creating reaction model\n" << endl;
|
||||||
|
|
||||||
autoPtr<combustionModels::psiCombustionModel> reaction
|
autoPtr<combustionModels::psiCombustionModel> reaction
|
||||||
|
|||||||
@ -52,7 +52,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
#include "createControl.H"
|
#include "createControl.H"
|
||||||
#include "createTimeControls.H"
|
#include "createTimeControls.H"
|
||||||
#include "createRDeltaT.H"
|
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createFieldRefs.H"
|
#include "createFieldRefs.H"
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
#include "createRDeltaT.H"
|
||||||
|
|
||||||
Info<< "Creating reaction model\n" << endl;
|
Info<< "Creating reaction model\n" << endl;
|
||||||
|
|
||||||
autoPtr<combustionModels::rhoCombustionModel> reaction
|
autoPtr<combustionModels::rhoCombustionModel> reaction
|
||||||
|
|||||||
@ -53,7 +53,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
#include "createControl.H"
|
#include "createControl.H"
|
||||||
#include "createTimeControls.H"
|
#include "createTimeControls.H"
|
||||||
#include "createRDeltaT.H"
|
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createFieldRefs.H"
|
#include "createFieldRefs.H"
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
#include "createRDeltaT.H"
|
||||||
|
|
||||||
Info<< "Creating reaction model\n" << endl;
|
Info<< "Creating reaction model\n" << endl;
|
||||||
|
|
||||||
autoPtr<combustionModels::rhoCombustionModel> reaction
|
autoPtr<combustionModels::rhoCombustionModel> reaction
|
||||||
|
|||||||
@ -53,7 +53,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
#include "createControl.H"
|
#include "createControl.H"
|
||||||
#include "createTimeControls.H"
|
#include "createTimeControls.H"
|
||||||
#include "createRDeltaT.H"
|
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createFieldRefs.H"
|
#include "createFieldRefs.H"
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
#include "createRDeltaT.H"
|
||||||
|
|
||||||
Info<< "Reading thermophysical properties\n" << endl;
|
Info<< "Reading thermophysical properties\n" << endl;
|
||||||
|
|
||||||
autoPtr<psiThermo> pThermo
|
autoPtr<psiThermo> pThermo
|
||||||
|
|||||||
@ -39,6 +39,8 @@ Description
|
|||||||
#include "turbulentFluidThermoModel.H"
|
#include "turbulentFluidThermoModel.H"
|
||||||
#include "fixedRhoFvPatchScalarField.H"
|
#include "fixedRhoFvPatchScalarField.H"
|
||||||
#include "directionInterpolate.H"
|
#include "directionInterpolate.H"
|
||||||
|
#include "localEulerDdtScheme.H"
|
||||||
|
#include "fvcSmooth.H"
|
||||||
#include "motionSolver.H"
|
#include "motionSolver.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -54,7 +54,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createFieldRefs.H"
|
#include "createFieldRefs.H"
|
||||||
#include "createTimeControls.H"
|
#include "createTimeControls.H"
|
||||||
#include "createRDeltaT.H"
|
|
||||||
|
|
||||||
turbulence->validate();
|
turbulence->validate();
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
#include "createRDeltaT.H"
|
||||||
|
|
||||||
Info<< "Reading thermophysical properties\n" << endl;
|
Info<< "Reading thermophysical properties\n" << endl;
|
||||||
|
|
||||||
autoPtr<psiThermo> pThermo
|
autoPtr<psiThermo> pThermo
|
||||||
|
|||||||
@ -57,7 +57,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createDynamicFvMesh.H"
|
#include "createDynamicFvMesh.H"
|
||||||
#include "createControl.H"
|
#include "createControl.H"
|
||||||
#include "createRDeltaT.H"
|
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createFieldRefs.H"
|
#include "createFieldRefs.H"
|
||||||
|
|||||||
@ -56,7 +56,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
#include "createControl.H"
|
#include "createControl.H"
|
||||||
#include "createTimeControls.H"
|
#include "createTimeControls.H"
|
||||||
#include "createRDeltaT.H"
|
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createFieldRefs.H"
|
#include "createFieldRefs.H"
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -22,7 +22,7 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Global
|
Global
|
||||||
setInitialDeltaT
|
setInitialMultiRegionDeltaT
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Set the initial timestep for the CHT MultiRegion solver.
|
Set the initial timestep for the CHT MultiRegion solver.
|
||||||
@ -48,7 +48,7 @@ if (adjustTimeStep)
|
|||||||
min
|
min
|
||||||
(
|
(
|
||||||
min(maxCo/CoNum, maxDi/DiNum)*runTime.deltaT().value(),
|
min(maxCo/CoNum, maxDi/DiNum)*runTime.deltaT().value(),
|
||||||
maxDeltaT
|
min(runTime.deltaTValue(), maxDeltaT)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
Info<< "deltaT = " << runTime.deltaT().value() << endl;
|
Info<< "deltaT = " << runTime.deltaT().value() << endl;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -63,13 +63,8 @@ adjointOutletPressureFvPatchScalarField
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(p, iF)
|
fixedValueFvPatchScalarField(p, iF, dict)
|
||||||
{
|
{}
|
||||||
fvPatchField<scalar>::operator=
|
|
||||||
(
|
|
||||||
scalarField("value", dict, p.size())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::adjointOutletPressureFvPatchScalarField::
|
Foam::adjointOutletPressureFvPatchScalarField::
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -50,10 +50,8 @@ adjointOutletVelocityFvPatchVectorField
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchVectorField(p, iF)
|
fixedValueFvPatchVectorField(p, iF, dict)
|
||||||
{
|
{}
|
||||||
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::adjointOutletVelocityFvPatchVectorField::
|
Foam::adjointOutletVelocityFvPatchVectorField::
|
||||||
|
|||||||
@ -28,8 +28,8 @@ License
|
|||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "makeTurbulenceModel.H"
|
#include "makeTurbulenceModel.H"
|
||||||
|
|
||||||
#include "laminar.H"
|
#include "laminarModel.H"
|
||||||
#include "turbulentTransportModel.H"
|
#include "RASModel.H"
|
||||||
#include "LESModel.H"
|
#include "LESModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -52,6 +52,10 @@ makeBaseTurbulenceModel
|
|||||||
singlePhaseTransportModel
|
singlePhaseTransportModel
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#define makeLaminarModel(Type) \
|
||||||
|
makeTemplatedTurbulenceModel \
|
||||||
|
(singlePhaseTransportModelPhaseIncompressibleTurbulenceModel, laminar, Type)
|
||||||
|
|
||||||
#define makeRASModel(Type) \
|
#define makeRASModel(Type) \
|
||||||
makeTemplatedTurbulenceModel \
|
makeTemplatedTurbulenceModel \
|
||||||
(singlePhaseTransportModelPhaseIncompressibleTurbulenceModel, RAS, Type)
|
(singlePhaseTransportModelPhaseIncompressibleTurbulenceModel, RAS, Type)
|
||||||
@ -60,6 +64,9 @@ makeBaseTurbulenceModel
|
|||||||
makeTemplatedTurbulenceModel \
|
makeTemplatedTurbulenceModel \
|
||||||
(singlePhaseTransportModelPhaseIncompressibleTurbulenceModel, LES, Type)
|
(singlePhaseTransportModelPhaseIncompressibleTurbulenceModel, LES, Type)
|
||||||
|
|
||||||
|
#include "Stokes.H"
|
||||||
|
makeLaminarModel(Stokes);
|
||||||
|
|
||||||
#include "kEpsilon.H"
|
#include "kEpsilon.H"
|
||||||
makeRASModel(kEpsilon);
|
makeRASModel(kEpsilon);
|
||||||
|
|
||||||
|
|||||||
@ -56,7 +56,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
#include "createControl.H"
|
#include "createControl.H"
|
||||||
#include "createTimeControls.H"
|
#include "createTimeControls.H"
|
||||||
#include "createRDeltaT.H"
|
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createFieldRefs.H"
|
#include "createFieldRefs.H"
|
||||||
#include "createFvOptions.H"
|
#include "createFvOptions.H"
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
#include "createRDeltaT.H"
|
||||||
|
|
||||||
#include "readGravitationalAcceleration.H"
|
#include "readGravitationalAcceleration.H"
|
||||||
|
|
||||||
Info<< "Creating combustion model\n" << endl;
|
Info<< "Creating combustion model\n" << endl;
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
|
-I. \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I${LIB_SRC}/sampling/lnInclude \
|
-I${LIB_SRC}/sampling/lnInclude \
|
||||||
-I${LIB_SRC}/meshTools/lnInclude \
|
-I${LIB_SRC}/meshTools/lnInclude \
|
||||||
@ -25,7 +26,6 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/combustionModels/lnInclude \
|
-I$(LIB_SRC)/combustionModels/lnInclude \
|
||||||
-I$(FOAM_SOLVERS)/combustion/reactingFoam
|
-I$(FOAM_SOLVERS)/combustion/reactingFoam
|
||||||
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lfvOptions \
|
-lfvOptions \
|
||||||
|
|||||||
@ -1 +1,5 @@
|
|||||||
const label inertIndex(composition.species()[inertSpecie]);
|
const label inertIndex(composition.species()[inertSpecie]);
|
||||||
|
|
||||||
|
const volScalarField& T = thermo.T();
|
||||||
|
const volScalarField& psi = thermo.psi();
|
||||||
|
filmModelType& surfaceFilm = tsurfaceFilm();
|
||||||
|
|||||||
@ -37,8 +37,6 @@ volScalarField rho
|
|||||||
);
|
);
|
||||||
|
|
||||||
volScalarField& p = thermo.p();
|
volScalarField& p = thermo.p();
|
||||||
const volScalarField& T = thermo.T();
|
|
||||||
const volScalarField& psi = thermo.psi();
|
|
||||||
|
|
||||||
Info<< "\nReading field U\n" << endl;
|
Info<< "\nReading field U\n" << endl;
|
||||||
volVectorField U
|
volVectorField U
|
||||||
|
|||||||
@ -3,5 +3,3 @@ Info<< "\nConstructing surface film model" << endl;
|
|||||||
typedef regionModels::surfaceFilmModels::surfaceFilmModel filmModelType;
|
typedef regionModels::surfaceFilmModels::surfaceFilmModel filmModelType;
|
||||||
|
|
||||||
autoPtr<filmModelType> tsurfaceFilm(filmModelType::New(mesh, g));
|
autoPtr<filmModelType> tsurfaceFilm(filmModelType::New(mesh, g));
|
||||||
filmModelType& surfaceFilm = tsurfaceFilm();
|
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
#include "createRDeltaT.H"
|
||||||
|
|
||||||
#include "readGravitationalAcceleration.H"
|
#include "readGravitationalAcceleration.H"
|
||||||
|
|
||||||
Info<< "Creating combustion model\n" << endl;
|
Info<< "Creating combustion model\n" << endl;
|
||||||
|
|||||||
@ -55,7 +55,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
#include "createControl.H"
|
#include "createControl.H"
|
||||||
#include "createTimeControls.H"
|
#include "createTimeControls.H"
|
||||||
#include "createRDeltaT.H"
|
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createFieldRefs.H"
|
#include "createFieldRefs.H"
|
||||||
#include "createFvOptions.H"
|
#include "createFvOptions.H"
|
||||||
|
|||||||
@ -28,7 +28,7 @@ License
|
|||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "makeTurbulenceModel.H"
|
#include "makeTurbulenceModel.H"
|
||||||
|
|
||||||
#include "laminar.H"
|
#include "laminarModel.H"
|
||||||
#include "RASModel.H"
|
#include "RASModel.H"
|
||||||
#include "LESModel.H"
|
#include "LESModel.H"
|
||||||
|
|
||||||
@ -52,6 +52,14 @@ makeBaseTurbulenceModel
|
|||||||
incompressibleTwoPhaseInteractingMixture
|
incompressibleTwoPhaseInteractingMixture
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#define makeLaminarModel(Type) \
|
||||||
|
makeTemplatedTurbulenceModel \
|
||||||
|
( \
|
||||||
|
incompressibleTwoPhaseInteractingMixtureCompressibleTurbulenceModel, \
|
||||||
|
laminar, \
|
||||||
|
Type \
|
||||||
|
)
|
||||||
|
|
||||||
#define makeRASModel(Type) \
|
#define makeRASModel(Type) \
|
||||||
makeTemplatedTurbulenceModel \
|
makeTemplatedTurbulenceModel \
|
||||||
( \
|
( \
|
||||||
@ -68,6 +76,9 @@ makeBaseTurbulenceModel
|
|||||||
Type \
|
Type \
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#include "Stokes.H"
|
||||||
|
makeLaminarModel(Stokes);
|
||||||
|
|
||||||
#include "kEpsilon.H"
|
#include "kEpsilon.H"
|
||||||
makeRASModel(kEpsilon);
|
makeRASModel(kEpsilon);
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
#include "createRDeltaT.H"
|
||||||
|
|
||||||
Info<< "Reading field p_rgh\n" << endl;
|
Info<< "Reading field p_rgh\n" << endl;
|
||||||
volScalarField p_rgh
|
volScalarField p_rgh
|
||||||
(
|
(
|
||||||
|
|||||||
@ -63,7 +63,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createControl.H"
|
#include "createControl.H"
|
||||||
#include "createTimeControls.H"
|
#include "createTimeControls.H"
|
||||||
#include "createDyMControls.H"
|
#include "createDyMControls.H"
|
||||||
#include "createRDeltaT.H"
|
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createFvOptions.H"
|
#include "createFvOptions.H"
|
||||||
|
|
||||||
|
|||||||
@ -65,7 +65,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
#include "createControl.H"
|
#include "createControl.H"
|
||||||
#include "createTimeControls.H"
|
#include "createTimeControls.H"
|
||||||
#include "createRDeltaT.H"
|
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createFvOptions.H"
|
#include "createFvOptions.H"
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
#include "createRDeltaT.H"
|
||||||
|
|
||||||
Info<< "Reading field p_rgh\n" << endl;
|
Info<< "Reading field p_rgh\n" << endl;
|
||||||
volScalarField p_rgh
|
volScalarField p_rgh
|
||||||
(
|
(
|
||||||
|
|||||||
@ -55,7 +55,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
#include "createControl.H"
|
#include "createControl.H"
|
||||||
#include "createTimeControls.H"
|
#include "createTimeControls.H"
|
||||||
#include "createRDeltaT.H"
|
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createFvOptions.H"
|
#include "createFvOptions.H"
|
||||||
|
|||||||
0
applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.C
Executable file → Normal file
0
applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.C
Executable file → Normal file
0
applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.H
Executable file → Normal file
0
applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.H
Executable file → Normal file
0
applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.C
Executable file → Normal file
0
applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.C
Executable file → Normal file
3
applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.H
Executable file → Normal file
3
applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.H
Executable file → Normal file
@ -58,6 +58,7 @@ namespace dragModels
|
|||||||
{
|
{
|
||||||
|
|
||||||
class SchillerNaumann;
|
class SchillerNaumann;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class Tenneti Declaration
|
Class Tenneti Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -68,7 +69,7 @@ class Tenneti
|
|||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Ergun drag model
|
//- SchillerNaumann drag model
|
||||||
autoPtr<SchillerNaumann> SchillerNaumann_;
|
autoPtr<SchillerNaumann> SchillerNaumann_;
|
||||||
|
|
||||||
//- Residual Reynolds Number
|
//- Residual Reynolds Number
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include "createRDeltaT.H"
|
||||||
#include "readGravitationalAcceleration.H"
|
#include "readGravitationalAcceleration.H"
|
||||||
#include "readhRef.H"
|
#include "readhRef.H"
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ License
|
|||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "makeTurbulenceModel.H"
|
#include "makeTurbulenceModel.H"
|
||||||
|
|
||||||
#include "laminar.H"
|
#include "laminarModel.H"
|
||||||
#include "RASModel.H"
|
#include "RASModel.H"
|
||||||
#include "LESModel.H"
|
#include "LESModel.H"
|
||||||
|
|
||||||
@ -53,6 +53,10 @@ makeBaseTurbulenceModel
|
|||||||
phaseModel
|
phaseModel
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#define makeLaminarModel(Type) \
|
||||||
|
makeTemplatedLaminarModel \
|
||||||
|
(phaseModelPhaseCompressibleTurbulenceModel, laminar, Type)
|
||||||
|
|
||||||
#define makeRASModel(Type) \
|
#define makeRASModel(Type) \
|
||||||
makeTemplatedTurbulenceModel \
|
makeTemplatedTurbulenceModel \
|
||||||
(phaseModelPhaseCompressibleTurbulenceModel, RAS, Type)
|
(phaseModelPhaseCompressibleTurbulenceModel, RAS, Type)
|
||||||
@ -61,6 +65,9 @@ makeBaseTurbulenceModel
|
|||||||
makeTemplatedTurbulenceModel \
|
makeTemplatedTurbulenceModel \
|
||||||
(phaseModelPhaseCompressibleTurbulenceModel, LES, Type)
|
(phaseModelPhaseCompressibleTurbulenceModel, LES, Type)
|
||||||
|
|
||||||
|
#include "Stokes.H"
|
||||||
|
makeLaminarModel(Stokes);
|
||||||
|
|
||||||
#include "kEpsilon.H"
|
#include "kEpsilon.H"
|
||||||
makeRASModel(kEpsilon);
|
makeRASModel(kEpsilon);
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
#include "createControl.H"
|
#include "createControl.H"
|
||||||
#include "createTimeControls.H"
|
#include "createTimeControls.H"
|
||||||
#include "createRDeltaT.H"
|
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createFieldRefs.H"
|
#include "createFieldRefs.H"
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include "createRDeltaT.H"
|
||||||
#include "readGravitationalAcceleration.H"
|
#include "readGravitationalAcceleration.H"
|
||||||
#include "readhRef.H"
|
#include "readhRef.H"
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
#include "createControl.H"
|
#include "createControl.H"
|
||||||
#include "createTimeControls.H"
|
#include "createTimeControls.H"
|
||||||
#include "createRDeltaT.H"
|
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createFieldRefs.H"
|
#include "createFieldRefs.H"
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ License
|
|||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "makeTurbulenceModel.H"
|
#include "makeTurbulenceModel.H"
|
||||||
|
|
||||||
#include "laminar.H"
|
#include "laminarModel.H"
|
||||||
#include "RASModel.H"
|
#include "RASModel.H"
|
||||||
#include "LESModel.H"
|
#include "LESModel.H"
|
||||||
|
|
||||||
@ -53,6 +53,10 @@ makeBaseTurbulenceModel
|
|||||||
phaseModel
|
phaseModel
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#define makeLaminarModel(Type) \
|
||||||
|
makeTemplatedLaminarModel \
|
||||||
|
(phaseModelPhaseCompressibleTurbulenceModel, laminar, Type)
|
||||||
|
|
||||||
#define makeRASModel(Type) \
|
#define makeRASModel(Type) \
|
||||||
makeTemplatedTurbulenceModel \
|
makeTemplatedTurbulenceModel \
|
||||||
(phaseModelPhaseCompressibleTurbulenceModel, RAS, Type)
|
(phaseModelPhaseCompressibleTurbulenceModel, RAS, Type)
|
||||||
@ -61,6 +65,9 @@ makeBaseTurbulenceModel
|
|||||||
makeTemplatedTurbulenceModel \
|
makeTemplatedTurbulenceModel \
|
||||||
(phaseModelPhaseCompressibleTurbulenceModel, LES, Type)
|
(phaseModelPhaseCompressibleTurbulenceModel, LES, Type)
|
||||||
|
|
||||||
|
#include "Stokes.H"
|
||||||
|
makeLaminarModel(Stokes);
|
||||||
|
|
||||||
#include "kEpsilon.H"
|
#include "kEpsilon.H"
|
||||||
makeRASModel(kEpsilon);
|
makeRASModel(kEpsilon);
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ License
|
|||||||
#include "ThermalDiffusivity.H"
|
#include "ThermalDiffusivity.H"
|
||||||
#include "EddyDiffusivity.H"
|
#include "EddyDiffusivity.H"
|
||||||
|
|
||||||
#include "laminar.H"
|
#include "laminarModel.H"
|
||||||
#include "RASModel.H"
|
#include "RASModel.H"
|
||||||
#include "LESModel.H"
|
#include "LESModel.H"
|
||||||
|
|
||||||
@ -58,6 +58,10 @@ makeBaseTurbulenceModel
|
|||||||
phaseModel
|
phaseModel
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#define makeLaminarModel(Type) \
|
||||||
|
makeTemplatedLaminarModel \
|
||||||
|
(phaseModelPhaseCompressibleTurbulenceModel, laminar, Type)
|
||||||
|
|
||||||
#define makeRASModel(Type) \
|
#define makeRASModel(Type) \
|
||||||
makeTemplatedTurbulenceModel \
|
makeTemplatedTurbulenceModel \
|
||||||
(phaseModelPhaseCompressibleTurbulenceModel, RAS, Type)
|
(phaseModelPhaseCompressibleTurbulenceModel, RAS, Type)
|
||||||
@ -66,6 +70,9 @@ makeBaseTurbulenceModel
|
|||||||
makeTemplatedTurbulenceModel \
|
makeTemplatedTurbulenceModel \
|
||||||
(phaseModelPhaseCompressibleTurbulenceModel, LES, Type)
|
(phaseModelPhaseCompressibleTurbulenceModel, LES, Type)
|
||||||
|
|
||||||
|
#include "Stokes.H"
|
||||||
|
makeLaminarModel(Stokes);
|
||||||
|
|
||||||
#include "kEpsilon.H"
|
#include "kEpsilon.H"
|
||||||
makeRASModel(kEpsilon);
|
makeRASModel(kEpsilon);
|
||||||
|
|
||||||
|
|||||||
@ -86,6 +86,27 @@ int main(int argc, char *argv[])
|
|||||||
"specify alternative dictionary for the blockMesh description"
|
"specify alternative dictionary for the blockMesh description"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
argList::addNote
|
||||||
|
(
|
||||||
|
"Block description\n"
|
||||||
|
"\n"
|
||||||
|
" For a given block, the correspondence between the ordering of\n"
|
||||||
|
" vertex labels and face labels is shown below.\n"
|
||||||
|
" For vertex numbering in the sequence 0 to 7 (block, centre):\n"
|
||||||
|
" faces 0 (f0) and 1 are left and right, respectively;\n"
|
||||||
|
" faces 2 and 3 are bottom and top;\n"
|
||||||
|
" and faces 4 and 5 are front the back:\n"
|
||||||
|
"\n"
|
||||||
|
" 4 ---- 5\n"
|
||||||
|
" f3 |\\ |\\ f5\n"
|
||||||
|
" | | 7 ---- 6 \\\n"
|
||||||
|
" | 0 |--- 1 | \\\n"
|
||||||
|
" | \\| \\| f4\n"
|
||||||
|
" f2 3 ---- 2\n"
|
||||||
|
"\n"
|
||||||
|
" f0 ----- f1\n"
|
||||||
|
);
|
||||||
|
|
||||||
#include "addRegionOption.H"
|
#include "addRegionOption.H"
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|||||||
@ -6,7 +6,8 @@ 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)/TurbulenceModels/compressible/lnInclude \
|
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lbarotropicCompressibilityModel \
|
-lbarotropicCompressibilityModel \
|
||||||
|
|||||||
@ -42,7 +42,7 @@ Foam::lagrangianFieldDecomposer::lagrangianFieldDecomposer
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
procMesh_(procMesh),
|
procMesh_(procMesh),
|
||||||
positions_(procMesh, cloudName, false),
|
positions_(procMesh, cloudName, IDLList<passiveParticle>()),
|
||||||
particleIndices_(lagrangianPositions.size())
|
particleIndices_(lagrangianPositions.size())
|
||||||
{
|
{
|
||||||
label pi = 0;
|
label pi = 0;
|
||||||
|
|||||||
@ -101,7 +101,6 @@ public:
|
|||||||
const label cloudI,
|
const label cloudI,
|
||||||
const IOobjectList& lagrangianObjects,
|
const IOobjectList& lagrangianObjects,
|
||||||
PtrList<PtrList<IOField<Type>>>& lagrangianFields
|
PtrList<PtrList<IOField<Type>>>& lagrangianFields
|
||||||
// PtrList<IOField<Type>>& lagrangianFields
|
|
||||||
);
|
);
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
@ -113,7 +112,6 @@ public:
|
|||||||
<
|
<
|
||||||
PtrList<CompactIOField<Field<Type>, Type>>
|
PtrList<CompactIOField<Field<Type>, Type>>
|
||||||
>& lagrangianFields
|
>& lagrangianFields
|
||||||
// PtrList<CompactIOField<Field<Type>, Type >>& lagrangianFields
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,7 @@ for (label i=0; i < nTypes; i++)
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Cloud<passiveParticle> particles(mesh);
|
Cloud<passiveParticle> particles(mesh, cloud::defaultName);
|
||||||
|
|
||||||
IOobjectList objects(mesh, runTime.timeName(), cloud::prefix);
|
IOobjectList objects(mesh, runTime.timeName(), cloud::prefix);
|
||||||
|
|
||||||
|
|||||||
@ -73,7 +73,7 @@ int USERD_get_maxsize_info
|
|||||||
{
|
{
|
||||||
// Get the maximum number of spray parcels
|
// Get the maximum number of spray parcels
|
||||||
// and store it
|
// and store it
|
||||||
Cloud<passiveParticle> lagrangian(*meshPtr);
|
Cloud<passiveParticle> lagrangian(*meshPtr, cloud::defaultName);
|
||||||
|
|
||||||
if (lagrangian.size() > nMaxParcels)
|
if (lagrangian.size() > nMaxParcels)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -151,7 +151,7 @@ int USERD_set_filenames
|
|||||||
{
|
{
|
||||||
runTime.setTime(timeDirs[n+1], n+1);
|
runTime.setTime(timeDirs[n+1], n+1);
|
||||||
|
|
||||||
Cloud<passiveParticle> lagrangian(*meshPtr);
|
Cloud<passiveParticle> lagrangian(*meshPtr, cloud::defaultName);
|
||||||
|
|
||||||
n++;
|
n++;
|
||||||
if (lagrangian.size())
|
if (lagrangian.size())
|
||||||
@ -177,7 +177,7 @@ int USERD_set_filenames
|
|||||||
|
|
||||||
delete sprayPtr;
|
delete sprayPtr;
|
||||||
|
|
||||||
sprayPtr = new Cloud<passiveParticle>(*meshPtr);
|
sprayPtr = new Cloud<passiveParticle>(*meshPtr, cloud::defaultName);
|
||||||
|
|
||||||
IOobjectList objects(*meshPtr, runTime.timeName(), cloud::prefix);
|
IOobjectList objects(*meshPtr, runTime.timeName(), cloud::prefix);
|
||||||
|
|
||||||
|
|||||||
@ -49,9 +49,7 @@ void USERD_set_time_set_and_step
|
|||||||
if (Numparts_available > nPatches+1)
|
if (Numparts_available > nPatches+1)
|
||||||
{
|
{
|
||||||
delete sprayPtr;
|
delete sprayPtr;
|
||||||
sprayPtr = new Cloud<passiveParticle>(*meshPtr);
|
sprayPtr = new Cloud<passiveParticle>(*meshPtr, cloud::defaultName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,17 @@
|
|||||||
Info<< "\nCreate databases as time" << endl;
|
Info<< "\nCreate databases as time" << endl;
|
||||||
|
|
||||||
|
const auto caseDirOrig = getEnv("FOAM_CASE");
|
||||||
|
const auto caseNameOrig = getEnv("FOAM_CASE_NAME");
|
||||||
|
setEnv("FOAM_CASE", rootDirSource/caseDirSource, true);
|
||||||
|
setEnv("FOAM_CASE_NAME", caseDirSource, true);
|
||||||
Time runTimeSource
|
Time runTimeSource
|
||||||
(
|
(
|
||||||
Time::controlDictName,
|
Time::controlDictName,
|
||||||
rootDirSource,
|
rootDirSource,
|
||||||
caseDirSource
|
caseDirSource
|
||||||
);
|
);
|
||||||
|
setEnv("FOAM_CASE", caseDirOrig, true);
|
||||||
|
setEnv("FOAM_CASE_NAME", caseNameOrig, true);
|
||||||
|
|
||||||
Time runTimeTarget
|
Time runTimeTarget
|
||||||
(
|
(
|
||||||
|
|||||||
@ -292,8 +292,8 @@ int main(int argc, char *argv[])
|
|||||||
fileName rootDirTarget(args.rootPath());
|
fileName rootDirTarget(args.rootPath());
|
||||||
fileName caseDirTarget(args.globalCaseName());
|
fileName caseDirTarget(args.globalCaseName());
|
||||||
|
|
||||||
const fileName casePath = args[1];
|
fileName casePath = args[1];
|
||||||
const fileName rootDirSource = casePath.path();
|
const fileName rootDirSource = casePath.path().toAbsolute();
|
||||||
const fileName caseDirSource = casePath.name();
|
const fileName caseDirSource = casePath.name();
|
||||||
|
|
||||||
Info<< "Source: " << rootDirSource << " " << caseDirSource << endl;
|
Info<< "Source: " << rootDirSource << " " << caseDirSource << endl;
|
||||||
|
|||||||
@ -103,7 +103,7 @@ OpenFOAM-*) # standard naming convention OpenFOAM-<VERSION>
|
|||||||
version="${projectDirName##OpenFOAM-}"
|
version="${projectDirName##OpenFOAM-}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
openfoam[0-9]* | openfoamdev) # debian naming convention 'openfoam<VERSION>'
|
openfoam[0-9]* | openfoam-dev) # debian naming convention 'openfoam<VERSION>'
|
||||||
versionNum="${projectDirName##openfoam}"
|
versionNum="${projectDirName##openfoam}"
|
||||||
case "$versionNum" in
|
case "$versionNum" in
|
||||||
??) # convert 2 digit version number to decimal delineated
|
??) # convert 2 digit version number to decimal delineated
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -48,11 +48,14 @@
|
|||||||
# test the specified files/directories for standards conformance.
|
# test the specified files/directories for standards conformance.
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
hookName="pre-commit"
|
hookName="pre-commit"
|
||||||
|
headerSeparator="-----------------------------------"
|
||||||
|
|
||||||
die()
|
die()
|
||||||
{
|
{
|
||||||
echo "$hookName hook failure" 1>&2
|
echo "$hookName hook failure" 1>&2
|
||||||
echo '-----------------------------------' 1>&2
|
echo $headerSeparator 1>&2
|
||||||
echo '' 1>&2
|
echo '' 1>&2
|
||||||
echo "$@" 1>&2
|
echo "$@" 1>&2
|
||||||
echo '' 1>&2
|
echo '' 1>&2
|
||||||
@ -105,7 +108,7 @@ dieOnBadFiles()
|
|||||||
if [ -n "$badFiles" ]
|
if [ -n "$badFiles" ]
|
||||||
then
|
then
|
||||||
echo "$hookName hook failure" 1>&2
|
echo "$hookName hook failure" 1>&2
|
||||||
echo '-----------------------------------' 1>&2
|
echo $headerSeparator 1>&2
|
||||||
echo "$@" 1>&2
|
echo "$@" 1>&2
|
||||||
echo '' 1>&2
|
echo '' 1>&2
|
||||||
echo "File(s):" 1>&2
|
echo "File(s):" 1>&2
|
||||||
@ -267,6 +270,49 @@ checkLineLengthNonDirective()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# check for non-standard code patterns
|
||||||
|
#
|
||||||
|
checkNonStandardCodePatterns()
|
||||||
|
{
|
||||||
|
echo "$hookName: checking for non-standard code ..." 1>&2
|
||||||
|
|
||||||
|
scope=$(gitScope $@)
|
||||||
|
|
||||||
|
badFiles=$(
|
||||||
|
for f in $fileList
|
||||||
|
do
|
||||||
|
# limit to *.[CH] files
|
||||||
|
case "$f" in
|
||||||
|
(*.[CH])
|
||||||
|
# Directly report the incorrect markers
|
||||||
|
git grep -n --color \
|
||||||
|
-e '> >' -e '\bNULL\b' \
|
||||||
|
$scope"$f"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
)
|
||||||
|
|
||||||
|
dieOnBadFiles "$(cat<<MESSAGE
|
||||||
|
Please revise the files reported below for the following non-standard code:
|
||||||
|
|
||||||
|
1. Spaced ending of multi-level template parameters are not allowed, such as:
|
||||||
|
|
||||||
|
List<List<scalar> >
|
||||||
|
|
||||||
|
which instead should be:
|
||||||
|
|
||||||
|
List<List<scalar>>
|
||||||
|
|
||||||
|
2. The use of the 'NULL' macro should be replaced by 'nullptr'
|
||||||
|
|
||||||
|
$headerSeparator
|
||||||
|
MESSAGE
|
||||||
|
)"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# check that OpenFOAM Foundation copyright is current
|
# check that OpenFOAM Foundation copyright is current
|
||||||
#
|
#
|
||||||
@ -278,27 +324,27 @@ checkCopyright()
|
|||||||
badFiles=$(
|
badFiles=$(
|
||||||
for f in $fileList
|
for f in $fileList
|
||||||
do
|
do
|
||||||
startYear=`grep "Copyright.*OpenFOAM" $f | sed 's/[^0-9]*\([0-9]*\).*/\1/g'`
|
startYear=`grep "Copyright.*OpenCFD" $f | sed 's/[^0-9]*\([0-9]*\).*/\1/g'`
|
||||||
endYear=`grep "Copyright.*-.*OpenFOAM" $f | sed 's/[^-]*-\([0-9]*\).*/\1/g'`
|
endYear=`grep "Copyright.*-.*OpenCFD" $f | sed 's/[^-]*-\([0-9]*\).*/\1/g'`
|
||||||
#echo "startYear=$startYear endYear=$endYear"
|
#echo "startYear=$startYear endYear=$endYear"
|
||||||
if [ "$startYear" != "" ]
|
if [ "$startYear" != "" ]
|
||||||
then
|
then
|
||||||
if [ "$endYear" != "" ]
|
if [ "$endYear" != "" ]
|
||||||
then
|
then
|
||||||
# Date is of type 2011-2012 OpenFOAM Foundation
|
# Date is of type 2011-2012 OpenCFD Ltd.
|
||||||
if [ "$year" != "$endYear" ]
|
if [ "$year" != "$endYear" ]
|
||||||
then
|
then
|
||||||
echo "Updated copyright for: $f" 1>&2
|
echo "Updated copyright for: $f" 1>&2
|
||||||
echo "$f"
|
echo "$f"
|
||||||
sed -i -e "s/$startYear-$endYear OpenFOAM/$startYear-$year OpenFOAM/g" $f
|
sed -i -e "s/$startYear-$endYear OpenCFD/$startYear-$year OpenCFD/g" $f
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Date is of type 2011 OpenFOAM Foundation
|
# Date is of type 2011 OpenCFD Ltd.
|
||||||
if [ "$year" != "$startYear" ]
|
if [ "$year" != "$startYear" ]
|
||||||
then
|
then
|
||||||
echo "$f"
|
echo "$f"
|
||||||
echo "Updated copyright for: $f" 1>&2
|
echo "Updated copyright for: $f" 1>&2
|
||||||
sed -i -e "s/$startYear OpenFOAM/$startYear-$year OpenFOAM/g" $f
|
sed -i -e "s/$startYear OpenCFD/$startYear-$year OpenCFD/g" $f
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -322,6 +368,9 @@ checkIllegalCode
|
|||||||
# ensure code conforms to 80 columns max
|
# ensure code conforms to 80 columns max
|
||||||
checkLineLengthNonDirective
|
checkLineLengthNonDirective
|
||||||
|
|
||||||
|
# check for non-standard code patterns
|
||||||
|
checkNonStandardCodePatterns
|
||||||
|
|
||||||
checkCopyright
|
checkCopyright
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@ -104,7 +104,7 @@ ${typeName}FvOption${SourceType}
|
|||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
option(name, modelType, dict, mesh)
|
cellSetOption(name, modelType, dict, mesh)
|
||||||
{
|
{
|
||||||
if (${verbose:-false})
|
if (${verbose:-false})
|
||||||
{
|
{
|
||||||
|
|||||||
@ -105,7 +105,7 @@ SourceFiles
|
|||||||
#ifndef codedFvOptionTemplate_H
|
#ifndef codedFvOptionTemplate_H
|
||||||
#define codedFvOptionTemplate_H
|
#define codedFvOptionTemplate_H
|
||||||
|
|
||||||
#include "fvOption.H"
|
#include "cellSetOption.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ namespace fv
|
|||||||
|
|
||||||
class ${typeName}FvOption${SourceType}
|
class ${typeName}FvOption${SourceType}
|
||||||
:
|
:
|
||||||
public option
|
public cellSetOption
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@ -174,7 +174,8 @@ bool Foam::functionObjectList::readFunctionObject
|
|||||||
(
|
(
|
||||||
const string& funcNameArgs,
|
const string& funcNameArgs,
|
||||||
dictionary& functionsDict,
|
dictionary& functionsDict,
|
||||||
HashSet<word>& requiredFields
|
HashSet<word>& requiredFields,
|
||||||
|
const word& region
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Parse the optional functionObject arguments:
|
// Parse the optional functionObject arguments:
|
||||||
@ -314,6 +315,12 @@ bool Foam::functionObjectList::readFunctionObject
|
|||||||
funcDict.set(entry::New(entryStream).ptr());
|
funcDict.set(entry::New(entryStream).ptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Insert the region name if specified
|
||||||
|
if (region != word::null)
|
||||||
|
{
|
||||||
|
funcDict.set("region", region);
|
||||||
|
}
|
||||||
|
|
||||||
// Merge this functionObject dictionary into functionsDict
|
// Merge this functionObject dictionary into functionsDict
|
||||||
dictionary funcArgsDict;
|
dictionary funcArgsDict;
|
||||||
funcArgsDict.add(string::validate<word>(funcNameArgs), funcDict);
|
funcArgsDict.add(string::validate<word>(funcNameArgs), funcDict);
|
||||||
@ -377,6 +384,14 @@ Foam::autoPtr<Foam::functionObjectList> Foam::functionObjectList::New
|
|||||||
|
|
||||||
dictionary& functionsDict = controlDict.subDict("functions");
|
dictionary& functionsDict = controlDict.subDict("functions");
|
||||||
|
|
||||||
|
word region = word::null;
|
||||||
|
|
||||||
|
// Set the region name if specified
|
||||||
|
if (args.optionFound("region"))
|
||||||
|
{
|
||||||
|
region = args["region"];
|
||||||
|
}
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
args.optionFound("dict")
|
args.optionFound("dict")
|
||||||
@ -402,7 +417,13 @@ Foam::autoPtr<Foam::functionObjectList> Foam::functionObjectList::New
|
|||||||
|
|
||||||
if (args.optionFound("func"))
|
if (args.optionFound("func"))
|
||||||
{
|
{
|
||||||
readFunctionObject(args["func"], functionsDict, requiredFields);
|
readFunctionObject
|
||||||
|
(
|
||||||
|
args["func"],
|
||||||
|
functionsDict,
|
||||||
|
requiredFields,
|
||||||
|
region
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("funcs"))
|
if (args.optionFound("funcs"))
|
||||||
@ -411,7 +432,13 @@ Foam::autoPtr<Foam::functionObjectList> Foam::functionObjectList::New
|
|||||||
|
|
||||||
forAll(funcs, i)
|
forAll(funcs, i)
|
||||||
{
|
{
|
||||||
readFunctionObject(funcs[i], functionsDict, requiredFields);
|
readFunctionObject
|
||||||
|
(
|
||||||
|
funcs[i],
|
||||||
|
functionsDict,
|
||||||
|
requiredFields,
|
||||||
|
region
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -234,7 +234,8 @@ public:
|
|||||||
(
|
(
|
||||||
const string& funcNameArgs0,
|
const string& funcNameArgs0,
|
||||||
dictionary& functionsDict,
|
dictionary& functionsDict,
|
||||||
HashSet<word>& requiredFields
|
HashSet<word>& requiredFields,
|
||||||
|
const word& region = word::null
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Read and set the function objects if their data have changed
|
//- Read and set the function objects if their data have changed
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -30,10 +30,10 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(cloud, 0);
|
defineTypeNameAndDebug(cloud, 0);
|
||||||
|
|
||||||
const word cloud::prefix("lagrangian");
|
const word cloud::prefix("lagrangian");
|
||||||
word cloud::defaultName("defaultCloud");
|
word cloud::defaultName("defaultCloud");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ Foam::cloud::cloud(const objectRegistry& obr, const word& cloudName)
|
|||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
(cloudName.size() ? cloudName : defaultName),
|
cloudName,
|
||||||
obr.time().timeName(),
|
obr.time().timeName(),
|
||||||
prefix,
|
prefix,
|
||||||
obr,
|
obr,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -78,7 +78,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct for the given objectRegistry and named cloud instance
|
//- Construct for the given objectRegistry and named cloud instance
|
||||||
cloud(const objectRegistry&, const word& cloudName = "");
|
cloud(const objectRegistry&, const word& cloudName = defaultName);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
|
|||||||
@ -54,7 +54,7 @@ PatchToPatchInterpolation<FromPatch, ToPatch>::pointInterpolate
|
|||||||
new Field<Type>(toPatch_.nPoints(), Zero)
|
new Field<Type>(toPatch_.nPoints(), Zero)
|
||||||
);
|
);
|
||||||
|
|
||||||
Field<Type>& result = tresult();
|
Field<Type>& result = tresult.ref();
|
||||||
|
|
||||||
const List<typename FromPatch::FaceType>& fromPatchLocalFaces =
|
const List<typename FromPatch::FaceType>& fromPatchLocalFaces =
|
||||||
fromPatch_.localFaces();
|
fromPatch_.localFaces();
|
||||||
@ -118,7 +118,7 @@ PatchToPatchInterpolation<FromPatch, ToPatch>::faceInterpolate
|
|||||||
new Field<Type>(toPatch_.size(), Zero)
|
new Field<Type>(toPatch_.size(), Zero)
|
||||||
);
|
);
|
||||||
|
|
||||||
Field<Type>& result = tresult();
|
Field<Type>& result = tresult.ref();
|
||||||
|
|
||||||
const labelListList& fromPatchFaceFaces = fromPatch_.faceFaces();
|
const labelListList& fromPatchFaceFaces = fromPatch_.faceFaces();
|
||||||
|
|
||||||
|
|||||||
@ -211,9 +211,9 @@ bool Foam::GAMGAgglomeration::continueAgglomerating
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const label nTotalCoarseCells = returnReduce(nCoarseCells, sumOp<label>());
|
const label nTotalCoarseCells = returnReduce(nCoarseCells, sumOp<label>());
|
||||||
if (nTotalCoarseCells >= Pstream::nProcs()*nCellsInCoarsestLevel_)
|
if (nTotalCoarseCells < Pstream::nProcs()*nCellsInCoarsestLevel_)
|
||||||
{
|
{
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -42,7 +42,7 @@ Description
|
|||||||
- Coarse matrix scaling: performed by correction scaling, using steepest
|
- Coarse matrix scaling: performed by correction scaling, using steepest
|
||||||
descent optimisation.
|
descent optimisation.
|
||||||
- Type of cycle: V-cycle with optional pre-smoothing.
|
- Type of cycle: V-cycle with optional pre-smoothing.
|
||||||
- Coarsest-level matrix solved using PCG or PBiCG.
|
- Coarsest-level matrix solved using PCG or PBiCGStab.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
GAMGSolver.C
|
GAMGSolver.C
|
||||||
@ -303,9 +303,9 @@ class GAMGSolver
|
|||||||
const scalar relTol
|
const scalar relTol
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Create and return the dictionary to specify the PBiCG solver
|
//- Create and return the dictionary to specify the PBiCGStab solver
|
||||||
// to solve the coarsest level
|
// to solve the coarsest level
|
||||||
dictionary PBiCGsolverDict
|
dictionary PBiCGStabSolverDict
|
||||||
(
|
(
|
||||||
const scalar tol,
|
const scalar tol,
|
||||||
const scalar relTol
|
const scalar relTol
|
||||||
|
|||||||
@ -25,7 +25,7 @@ License
|
|||||||
|
|
||||||
#include "GAMGSolver.H"
|
#include "GAMGSolver.H"
|
||||||
#include "PCG.H"
|
#include "PCG.H"
|
||||||
#include "PBiCG.H"
|
#include "PBiCGStab.H"
|
||||||
#include "SubField.H"
|
#include "SubField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
@ -533,13 +533,13 @@ Foam::dictionary Foam::GAMGSolver::PCGsolverDict
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::dictionary Foam::GAMGSolver::PBiCGsolverDict
|
Foam::dictionary Foam::GAMGSolver::PBiCGStabSolverDict
|
||||||
(
|
(
|
||||||
const scalar tol,
|
const scalar tol,
|
||||||
const scalar relTol
|
const scalar relTol
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
dictionary dict(IStringStream("solver PBiCG; preconditioner DILU;")());
|
dictionary dict(IStringStream("solver PBiCGStab; preconditioner DILU;")());
|
||||||
dict.add("tolerance", tol);
|
dict.add("tolerance", tol);
|
||||||
dict.add("relTol", relTol);
|
dict.add("relTol", relTol);
|
||||||
|
|
||||||
@ -612,14 +612,14 @@ void Foam::GAMGSolver::solveCoarsestLevel
|
|||||||
//
|
//
|
||||||
// if (allMatrix.asymmetric())
|
// if (allMatrix.asymmetric())
|
||||||
// {
|
// {
|
||||||
// coarseSolverPerf = PBiCG
|
// coarseSolverPerf = PBiCGStab
|
||||||
// (
|
// (
|
||||||
// "coarsestLevelCorr",
|
// "coarsestLevelCorr",
|
||||||
// allMatrix,
|
// allMatrix,
|
||||||
// procInterfaceLevelsBouCoeffs_[coarsestLevel],
|
// procInterfaceLevelsBouCoeffs_[coarsestLevel],
|
||||||
// procInterfaceLevelsIntCoeffs_[coarsestLevel],
|
// procInterfaceLevelsIntCoeffs_[coarsestLevel],
|
||||||
// procInterfaceLevels_[coarsestLevel],
|
// procInterfaceLevels_[coarsestLevel],
|
||||||
// PBiCGsolverDict(tolerance_, relTol_)
|
// PBiCGStabSolverDict(tolerance_, relTol_)
|
||||||
// ).solve
|
// ).solve
|
||||||
// (
|
// (
|
||||||
// coarsestCorrField,
|
// coarsestCorrField,
|
||||||
@ -673,14 +673,14 @@ void Foam::GAMGSolver::solveCoarsestLevel
|
|||||||
|
|
||||||
if (matrixLevels_[coarsestLevel].asymmetric())
|
if (matrixLevels_[coarsestLevel].asymmetric())
|
||||||
{
|
{
|
||||||
coarseSolverPerf = PBiCG
|
coarseSolverPerf = PBiCGStab
|
||||||
(
|
(
|
||||||
"coarsestLevelCorr",
|
"coarsestLevelCorr",
|
||||||
matrixLevels_[coarsestLevel],
|
matrixLevels_[coarsestLevel],
|
||||||
interfaceLevelsBouCoeffs_[coarsestLevel],
|
interfaceLevelsBouCoeffs_[coarsestLevel],
|
||||||
interfaceLevelsIntCoeffs_[coarsestLevel],
|
interfaceLevelsIntCoeffs_[coarsestLevel],
|
||||||
interfaceLevels_[coarsestLevel],
|
interfaceLevels_[coarsestLevel],
|
||||||
PBiCGsolverDict(tolerance_, relTol_)
|
PBiCGStabSolverDict(tolerance_, relTol_)
|
||||||
).solve
|
).solve
|
||||||
(
|
(
|
||||||
coarsestCorrField,
|
coarsestCorrField,
|
||||||
|
|||||||
@ -24,19 +24,14 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "globalMeshData.H"
|
#include "globalMeshData.H"
|
||||||
#include "Time.H"
|
|
||||||
#include "Pstream.H"
|
#include "Pstream.H"
|
||||||
#include "PstreamCombineReduceOps.H"
|
#include "PstreamCombineReduceOps.H"
|
||||||
#include "processorPolyPatch.H"
|
#include "processorPolyPatch.H"
|
||||||
#include "demandDrivenData.H"
|
|
||||||
#include "globalPoints.H"
|
#include "globalPoints.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "mapDistribute.H"
|
#include "mapDistribute.H"
|
||||||
#include "labelIOList.H"
|
#include "labelIOList.H"
|
||||||
#include "PackedList.H"
|
|
||||||
#include "mergePoints.H"
|
#include "mergePoints.H"
|
||||||
#include "matchPoints.H"
|
|
||||||
#include "OFstream.H"
|
|
||||||
#include "globalIndexAndTransform.H"
|
#include "globalIndexAndTransform.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -577,7 +572,7 @@ void Foam::globalMeshData::calcPointConnectivity
|
|||||||
labelPairList myData(globalPointSlavesMap().constructSize());
|
labelPairList myData(globalPointSlavesMap().constructSize());
|
||||||
forAll(slaves, pointi)
|
forAll(slaves, pointi)
|
||||||
{
|
{
|
||||||
myData[pointi] = globalIndexAndTransform::encode
|
myData[pointi] = transforms.encode
|
||||||
(
|
(
|
||||||
Pstream::myProcNo(),
|
Pstream::myProcNo(),
|
||||||
pointi,
|
pointi,
|
||||||
@ -624,9 +619,9 @@ void Foam::globalMeshData::calcPointConnectivity
|
|||||||
);
|
);
|
||||||
// Add transform to connectivity
|
// Add transform to connectivity
|
||||||
const labelPair& n = myData[pTransformSlaves[i]];
|
const labelPair& n = myData[pTransformSlaves[i]];
|
||||||
label proci = globalIndexAndTransform::processor(n);
|
label proci = transforms.processor(n);
|
||||||
label index = globalIndexAndTransform::index(n);
|
label index = transforms.index(n);
|
||||||
pConnectivity[connI++] = globalIndexAndTransform::encode
|
pConnectivity[connI++] = transforms.encode
|
||||||
(
|
(
|
||||||
proci,
|
proci,
|
||||||
index,
|
index,
|
||||||
@ -678,6 +673,8 @@ void Foam::globalMeshData::calcGlobalPointEdges
|
|||||||
const globalIndex& globalEdgeNumbers = globalEdgeNumbering();
|
const globalIndex& globalEdgeNumbers = globalEdgeNumbering();
|
||||||
const labelListList& slaves = globalPointSlaves();
|
const labelListList& slaves = globalPointSlaves();
|
||||||
const labelListList& transformedSlaves = globalPointTransformedSlaves();
|
const labelListList& transformedSlaves = globalPointTransformedSlaves();
|
||||||
|
const globalIndexAndTransform& transforms = globalTransforms();
|
||||||
|
|
||||||
|
|
||||||
// Create local version
|
// Create local version
|
||||||
globalPointEdges.setSize(globalPointSlavesMap().constructSize());
|
globalPointEdges.setSize(globalPointSlavesMap().constructSize());
|
||||||
@ -697,11 +694,11 @@ void Foam::globalMeshData::calcGlobalPointEdges
|
|||||||
forAll(pEdges, i)
|
forAll(pEdges, i)
|
||||||
{
|
{
|
||||||
label otherPointi = edges[pEdges[i]].otherVertex(pointi);
|
label otherPointi = edges[pEdges[i]].otherVertex(pointi);
|
||||||
globalPPoints[i] = globalIndexAndTransform::encode
|
globalPPoints[i] = transforms.encode
|
||||||
(
|
(
|
||||||
Pstream::myProcNo(),
|
Pstream::myProcNo(),
|
||||||
otherPointi,
|
otherPointi,
|
||||||
globalTransforms().nullTransformIndex()
|
transforms.nullTransformIndex()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -790,9 +787,9 @@ void Foam::globalMeshData::calcGlobalPointEdges
|
|||||||
{
|
{
|
||||||
// Add transform to connectivity
|
// Add transform to connectivity
|
||||||
const labelPair& n = otherData[j];
|
const labelPair& n = otherData[j];
|
||||||
label proci = globalIndexAndTransform::processor(n);
|
label proci = transforms.processor(n);
|
||||||
label index = globalIndexAndTransform::index(n);
|
label index = transforms.index(n);
|
||||||
globalPPoints[sz++] = globalIndexAndTransform::encode
|
globalPPoints[sz++] = transforms.encode
|
||||||
(
|
(
|
||||||
proci,
|
proci,
|
||||||
index,
|
index,
|
||||||
@ -834,16 +831,18 @@ Foam::label Foam::globalMeshData::findTransform
|
|||||||
const label localPoint
|
const label localPoint
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const label remoteProci = globalIndexAndTransform::processor(remotePoint);
|
const globalIndexAndTransform& transforms = globalTransforms();
|
||||||
const label remoteIndex = globalIndexAndTransform::index(remotePoint);
|
|
||||||
|
const label remoteProci = transforms.processor(remotePoint);
|
||||||
|
const label remoteIndex = transforms.index(remotePoint);
|
||||||
|
|
||||||
label remoteTransformI = -1;
|
label remoteTransformI = -1;
|
||||||
label localTransformI = -1;
|
label localTransformI = -1;
|
||||||
forAll(info, i)
|
forAll(info, i)
|
||||||
{
|
{
|
||||||
label proci = globalIndexAndTransform::processor(info[i]);
|
label proci = transforms.processor(info[i]);
|
||||||
label pointi = globalIndexAndTransform::index(info[i]);
|
label pointi = transforms.index(info[i]);
|
||||||
label transformI = globalIndexAndTransform::transformIndex(info[i]);
|
label transformI = transforms.transformIndex(info[i]);
|
||||||
|
|
||||||
if (proci == Pstream::myProcNo() && pointi == localPoint)
|
if (proci == Pstream::myProcNo() && pointi == localPoint)
|
||||||
{
|
{
|
||||||
@ -875,7 +874,7 @@ Foam::label Foam::globalMeshData::findTransform
|
|||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
return globalTransforms().subtractTransformIndex
|
return transforms.subtractTransformIndex
|
||||||
(
|
(
|
||||||
remoteTransformI,
|
remoteTransformI,
|
||||||
localTransformI
|
localTransformI
|
||||||
@ -893,6 +892,7 @@ void Foam::globalMeshData::calcGlobalEdgeSlaves() const
|
|||||||
|
|
||||||
const edgeList& edges = coupledPatch().edges();
|
const edgeList& edges = coupledPatch().edges();
|
||||||
const globalIndex& globalEdgeNumbers = globalEdgeNumbering();
|
const globalIndex& globalEdgeNumbers = globalEdgeNumbering();
|
||||||
|
const globalIndexAndTransform& transforms = globalTransforms();
|
||||||
|
|
||||||
|
|
||||||
// The whole problem with deducting edge-connectivity from
|
// The whole problem with deducting edge-connectivity from
|
||||||
@ -941,11 +941,11 @@ void Foam::globalMeshData::calcGlobalEdgeSlaves() const
|
|||||||
// Append myself.
|
// Append myself.
|
||||||
eEdges.append
|
eEdges.append
|
||||||
(
|
(
|
||||||
globalIndexAndTransform::encode
|
transforms.encode
|
||||||
(
|
(
|
||||||
Pstream::myProcNo(),
|
Pstream::myProcNo(),
|
||||||
edgeI,
|
edgeI,
|
||||||
globalTransforms().nullTransformIndex()
|
transforms.nullTransformIndex()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -986,7 +986,7 @@ void Foam::globalMeshData::calcGlobalEdgeSlaves() const
|
|||||||
label proci = globalEdgeNumbers.whichProcID(pEdges0[i]);
|
label proci = globalEdgeNumbers.whichProcID(pEdges0[i]);
|
||||||
eEdges.append
|
eEdges.append
|
||||||
(
|
(
|
||||||
globalIndexAndTransform::encode
|
transforms.encode
|
||||||
(
|
(
|
||||||
proci,
|
proci,
|
||||||
globalEdgeNumbers.toLocal(proci, pEdges0[i]),
|
globalEdgeNumbers.toLocal(proci, pEdges0[i]),
|
||||||
@ -999,7 +999,11 @@ void Foam::globalMeshData::calcGlobalEdgeSlaves() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
allEdgeConnectivity[edgeI].transfer(eEdges);
|
allEdgeConnectivity[edgeI].transfer(eEdges);
|
||||||
sort(allEdgeConnectivity[edgeI], globalIndexAndTransform::less());
|
sort
|
||||||
|
(
|
||||||
|
allEdgeConnectivity[edgeI],
|
||||||
|
globalIndexAndTransform::less(transforms)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We now have - in allEdgeConnectivity - a list of edges which are shared
|
// We now have - in allEdgeConnectivity - a list of edges which are shared
|
||||||
@ -1020,10 +1024,10 @@ void Foam::globalMeshData::calcGlobalEdgeSlaves() const
|
|||||||
if
|
if
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
globalIndexAndTransform::processor(masterInfo)
|
transforms.processor(masterInfo)
|
||||||
== Pstream::myProcNo()
|
== Pstream::myProcNo()
|
||||||
)
|
)
|
||||||
&& (globalIndexAndTransform::index(masterInfo) == edgeI)
|
&& (transforms.index(masterInfo) == edgeI)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Sort into transformed and untransformed
|
// Sort into transformed and untransformed
|
||||||
@ -1039,14 +1043,14 @@ void Foam::globalMeshData::calcGlobalEdgeSlaves() const
|
|||||||
for (label i = 1; i < edgeInfo.size(); i++)
|
for (label i = 1; i < edgeInfo.size(); i++)
|
||||||
{
|
{
|
||||||
const labelPair& info = edgeInfo[i];
|
const labelPair& info = edgeInfo[i];
|
||||||
label proci = globalIndexAndTransform::processor(info);
|
label proci = transforms.processor(info);
|
||||||
label index = globalIndexAndTransform::index(info);
|
label index = transforms.index(info);
|
||||||
label transform = globalIndexAndTransform::transformIndex
|
label transform = transforms.transformIndex
|
||||||
(
|
(
|
||||||
info
|
info
|
||||||
);
|
);
|
||||||
|
|
||||||
if (transform == globalTransforms().nullTransformIndex())
|
if (transform == transforms.nullTransformIndex())
|
||||||
{
|
{
|
||||||
eEdges[nonTransformI++] = globalEdgeNumbers.toGlobal
|
eEdges[nonTransformI++] = globalEdgeNumbers.toGlobal
|
||||||
(
|
(
|
||||||
@ -1078,7 +1082,7 @@ void Foam::globalMeshData::calcGlobalEdgeSlaves() const
|
|||||||
globalEdgeNumbers,
|
globalEdgeNumbers,
|
||||||
globalEdgeSlaves,
|
globalEdgeSlaves,
|
||||||
|
|
||||||
globalTransforms(),
|
transforms,
|
||||||
transformedEdges,
|
transformedEdges,
|
||||||
globalEdgeTransformedSlavesPtr_(),
|
globalEdgeTransformedSlavesPtr_(),
|
||||||
|
|
||||||
@ -1351,6 +1355,7 @@ void Foam::globalMeshData::calcGlobalPointBoundaryFaces() const
|
|||||||
const labelListList& pointSlaves = globalPointSlaves();
|
const labelListList& pointSlaves = globalPointSlaves();
|
||||||
const labelListList& pointTransformSlaves =
|
const labelListList& pointTransformSlaves =
|
||||||
globalPointTransformedSlaves();
|
globalPointTransformedSlaves();
|
||||||
|
const globalIndexAndTransform& transforms = globalTransforms();
|
||||||
|
|
||||||
|
|
||||||
// Any faces coming in through transformation
|
// Any faces coming in through transformation
|
||||||
@ -1432,7 +1437,7 @@ void Foam::globalMeshData::calcGlobalPointBoundaryFaces() const
|
|||||||
label proci = globalIndices.whichProcID(slave);
|
label proci = globalIndices.whichProcID(slave);
|
||||||
label facei = globalIndices.toLocal(proci, slave);
|
label facei = globalIndices.toLocal(proci, slave);
|
||||||
|
|
||||||
myBFaces[n++] = globalIndexAndTransform::encode
|
myBFaces[n++] = transforms.encode
|
||||||
(
|
(
|
||||||
proci,
|
proci,
|
||||||
facei,
|
facei,
|
||||||
@ -1466,7 +1471,7 @@ void Foam::globalMeshData::calcGlobalPointBoundaryFaces() const
|
|||||||
globalIndices,
|
globalIndices,
|
||||||
globalPointBoundaryFaces,
|
globalPointBoundaryFaces,
|
||||||
|
|
||||||
globalTransforms(),
|
transforms,
|
||||||
transformedFaces,
|
transformedFaces,
|
||||||
globalPointTransformedBoundaryFacesPtr_(),
|
globalPointTransformedBoundaryFacesPtr_(),
|
||||||
|
|
||||||
@ -1581,6 +1586,7 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const
|
|||||||
const labelListList& pointSlaves = globalPointSlaves();
|
const labelListList& pointSlaves = globalPointSlaves();
|
||||||
const labelListList& pointTransformSlaves =
|
const labelListList& pointTransformSlaves =
|
||||||
globalPointTransformedSlaves();
|
globalPointTransformedSlaves();
|
||||||
|
const globalIndexAndTransform& transforms = globalTransforms();
|
||||||
|
|
||||||
List<labelPairList> transformedCells(pointSlaves.size());
|
List<labelPairList> transformedCells(pointSlaves.size());
|
||||||
|
|
||||||
@ -1660,7 +1666,7 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const
|
|||||||
{
|
{
|
||||||
label proci = globalIndices.whichProcID(slave);
|
label proci = globalIndices.whichProcID(slave);
|
||||||
label celli = globalIndices.toLocal(proci, slave);
|
label celli = globalIndices.toLocal(proci, slave);
|
||||||
myBCells[n++] = globalIndexAndTransform::encode
|
myBCells[n++] = transforms.encode
|
||||||
(
|
(
|
||||||
proci,
|
proci,
|
||||||
celli,
|
celli,
|
||||||
@ -1693,7 +1699,7 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const
|
|||||||
globalIndices,
|
globalIndices,
|
||||||
globalPointBoundaryCells,
|
globalPointBoundaryCells,
|
||||||
|
|
||||||
globalTransforms(),
|
transforms,
|
||||||
transformedCells,
|
transformedCells,
|
||||||
globalPointTransformedBoundaryCellsPtr_(),
|
globalPointTransformedBoundaryCellsPtr_(),
|
||||||
|
|
||||||
|
|||||||
@ -72,7 +72,6 @@ See also
|
|||||||
mapDistribute
|
mapDistribute
|
||||||
globalIndexAndTransform
|
globalIndexAndTransform
|
||||||
|
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
globalMeshData.C
|
globalMeshData.C
|
||||||
globalMeshDataTemplates.C
|
globalMeshDataTemplates.C
|
||||||
|
|||||||
@ -64,15 +64,15 @@ Foam::label Foam::globalPoints::findSamePoint
|
|||||||
const labelPair& info
|
const labelPair& info
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const label proci = globalIndexAndTransform::processor(info);
|
const label proci = globalTransforms_.processor(info);
|
||||||
const label index = globalIndexAndTransform::index(info);
|
const label index = globalTransforms_.index(info);
|
||||||
|
|
||||||
forAll(allInfo, i)
|
forAll(allInfo, i)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
globalIndexAndTransform::processor(allInfo[i]) == proci
|
globalTransforms_.processor(allInfo[i]) == proci
|
||||||
&& globalIndexAndTransform::index(allInfo[i]) == index
|
&& globalTransforms_.index(allInfo[i]) == index
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return i;
|
return i;
|
||||||
@ -98,21 +98,21 @@ Foam::labelPairList Foam::globalPoints::addSendTransform
|
|||||||
forAll(info, i)
|
forAll(info, i)
|
||||||
{
|
{
|
||||||
//Pout<< " adding send transform to" << nl
|
//Pout<< " adding send transform to" << nl
|
||||||
// << " proc:" << globalIndexAndTransform::processor(info[i])
|
// << " proc:" << globalTransforms_.processor(info[i])
|
||||||
// << nl
|
// << nl
|
||||||
// << " index:" << globalIndexAndTransform::index(info[i]) << nl
|
// << " index:" << globalTransforms_.index(info[i]) << nl
|
||||||
// << " trafo:"
|
// << " trafo:"
|
||||||
// << globalTransforms_.decodeTransformIndex
|
// << globalTransforms_.decodeTransformIndex
|
||||||
// (globalIndexAndTransform::transformIndex(info[i]))
|
// (globalTransforms_.transformIndex(info[i]))
|
||||||
// << endl;
|
// << endl;
|
||||||
|
|
||||||
sendInfo[i] = globalIndexAndTransform::encode
|
sendInfo[i] = globalTransforms_.encode
|
||||||
(
|
(
|
||||||
globalIndexAndTransform::processor(info[i]),
|
globalTransforms_.processor(info[i]),
|
||||||
globalIndexAndTransform::index(info[i]),
|
globalTransforms_.index(info[i]),
|
||||||
globalTransforms_.addToTransformIndex
|
globalTransforms_.addToTransformIndex
|
||||||
(
|
(
|
||||||
globalIndexAndTransform::transformIndex(info[i]),
|
globalTransforms_.transformIndex(info[i]),
|
||||||
patchi,
|
patchi,
|
||||||
true, // patchi is sending side
|
true, // patchi is sending side
|
||||||
tol // tolerance for comparison
|
tol // tolerance for comparison
|
||||||
@ -204,11 +204,11 @@ bool Foam::globalPoints::mergeInfo
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
label myTransform = globalIndexAndTransform::transformIndex
|
label myTransform = globalTransforms_.transformIndex
|
||||||
(
|
(
|
||||||
myInfo[index]
|
myInfo[index]
|
||||||
);
|
);
|
||||||
label nbrTransform = globalIndexAndTransform::transformIndex
|
label nbrTransform = globalTransforms_.transformIndex
|
||||||
(
|
(
|
||||||
nbrInfo[i]
|
nbrInfo[i]
|
||||||
);
|
);
|
||||||
@ -294,7 +294,7 @@ bool Foam::globalPoints::mergeInfo
|
|||||||
labelPairList knownInfo
|
labelPairList knownInfo
|
||||||
(
|
(
|
||||||
1,
|
1,
|
||||||
globalIndexAndTransform::encode
|
globalTransforms_.encode
|
||||||
(
|
(
|
||||||
Pstream::myProcNo(),
|
Pstream::myProcNo(),
|
||||||
localPointi,
|
localPointi,
|
||||||
@ -356,9 +356,9 @@ void Foam::globalPoints::printProcPoint
|
|||||||
const labelPair& pointInfo
|
const labelPair& pointInfo
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
label proci = globalIndexAndTransform::processor(pointInfo);
|
label proci = globalTransforms_.processor(pointInfo);
|
||||||
label index = globalIndexAndTransform::index(pointInfo);
|
label index = globalTransforms_.index(pointInfo);
|
||||||
label trafoI = globalIndexAndTransform::transformIndex(pointInfo);
|
label trafoI = globalTransforms_.transformIndex(pointInfo);
|
||||||
|
|
||||||
Pout<< " proc:" << proci;
|
Pout<< " proc:" << proci;
|
||||||
Pout<< " localpoint:";
|
Pout<< " localpoint:";
|
||||||
@ -421,7 +421,7 @@ void Foam::globalPoints::initOwnPoints
|
|||||||
labelPairList knownInfo
|
labelPairList knownInfo
|
||||||
(
|
(
|
||||||
1,
|
1,
|
||||||
globalIndexAndTransform::encode
|
globalTransforms_.encode
|
||||||
(
|
(
|
||||||
Pstream::myProcNo(),
|
Pstream::myProcNo(),
|
||||||
localPointi,
|
localPointi,
|
||||||
@ -457,7 +457,7 @@ void Foam::globalPoints::initOwnPoints
|
|||||||
labelPairList knownInfo
|
labelPairList knownInfo
|
||||||
(
|
(
|
||||||
1,
|
1,
|
||||||
globalIndexAndTransform::encode
|
globalTransforms_.encode
|
||||||
(
|
(
|
||||||
Pstream::myProcNo(),
|
Pstream::myProcNo(),
|
||||||
localPointi,
|
localPointi,
|
||||||
@ -750,8 +750,8 @@ void Foam::globalPoints::remove
|
|||||||
// is in it. This would be an ordinary connection and can be
|
// is in it. This would be an ordinary connection and can be
|
||||||
// handled by normal face-face connectivity.
|
// handled by normal face-face connectivity.
|
||||||
|
|
||||||
label proc0 = globalIndexAndTransform::processor(pointInfo[0]);
|
label proc0 = globalTransforms_.processor(pointInfo[0]);
|
||||||
label proc1 = globalIndexAndTransform::processor(pointInfo[1]);
|
label proc1 = globalTransforms_.processor(pointInfo[1]);
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
@ -759,14 +759,14 @@ void Foam::globalPoints::remove
|
|||||||
proc0 == Pstream::myProcNo()
|
proc0 == Pstream::myProcNo()
|
||||||
&& directNeighbours.found
|
&& directNeighbours.found
|
||||||
(
|
(
|
||||||
globalIndexAndTransform::index(pointInfo[0])
|
globalTransforms_.index(pointInfo[0])
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|| (
|
|| (
|
||||||
proc1 == Pstream::myProcNo()
|
proc1 == Pstream::myProcNo()
|
||||||
&& directNeighbours.found
|
&& directNeighbours.found
|
||||||
(
|
(
|
||||||
globalIndexAndTransform::index(pointInfo[1])
|
globalTransforms_.index(pointInfo[1])
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -776,14 +776,14 @@ void Foam::globalPoints::remove
|
|||||||
{
|
{
|
||||||
//Pout<< "Removing direct neighbour:"
|
//Pout<< "Removing direct neighbour:"
|
||||||
// << mesh_.points()
|
// << mesh_.points()
|
||||||
// [globalIndexAndTransform::index(pointInfo[0])]
|
// [globalTransforms_.index(pointInfo[0])]
|
||||||
// << endl;
|
// << endl;
|
||||||
}
|
}
|
||||||
else if (proc1 == Pstream::myProcNo())
|
else if (proc1 == Pstream::myProcNo())
|
||||||
{
|
{
|
||||||
//Pout<< "Removing direct neighbour:"
|
//Pout<< "Removing direct neighbour:"
|
||||||
// << mesh_.points()
|
// << mesh_.points()
|
||||||
// [globalIndexAndTransform::index(pointInfo[1])]
|
// [globalTransforms_.index(pointInfo[1])]
|
||||||
// << endl;
|
// << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -812,11 +812,11 @@ void Foam::globalPoints::remove
|
|||||||
// So this meshPoint will have info of size one only.
|
// So this meshPoint will have info of size one only.
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
globalIndexAndTransform::processor(pointInfo[0])
|
globalTransforms_.processor(pointInfo[0])
|
||||||
!= Pstream::myProcNo()
|
!= Pstream::myProcNo()
|
||||||
|| !directNeighbours.found
|
|| !directNeighbours.found
|
||||||
(
|
(
|
||||||
globalIndexAndTransform::index(pointInfo[0])
|
globalTransforms_.index(pointInfo[0])
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -995,7 +995,7 @@ void Foam::globalPoints::calculateSharedPoints
|
|||||||
forAllConstIter(Map<label>, meshToProcPoint_, iter)
|
forAllConstIter(Map<label>, meshToProcPoint_, iter)
|
||||||
{
|
{
|
||||||
labelPairList& pointInfo = procPoints_[iter()];
|
labelPairList& pointInfo = procPoints_[iter()];
|
||||||
sort(pointInfo, globalIndexAndTransform::less());
|
sort(pointInfo, globalIndexAndTransform::less(globalTransforms_));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1017,10 +1017,10 @@ void Foam::globalPoints::calculateSharedPoints
|
|||||||
if
|
if
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
globalIndexAndTransform::processor(masterInfo)
|
globalTransforms_.processor(masterInfo)
|
||||||
== Pstream::myProcNo()
|
== Pstream::myProcNo()
|
||||||
)
|
)
|
||||||
&& (globalIndexAndTransform::index(masterInfo) == iter.key())
|
&& (globalTransforms_.index(masterInfo) == iter.key())
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
labelList& pPoints = pointPoints_[iter.key()];
|
labelList& pPoints = pointPoints_[iter.key()];
|
||||||
@ -1035,9 +1035,9 @@ void Foam::globalPoints::calculateSharedPoints
|
|||||||
for (label i = 1; i < pointInfo.size(); i++)
|
for (label i = 1; i < pointInfo.size(); i++)
|
||||||
{
|
{
|
||||||
const labelPair& info = pointInfo[i];
|
const labelPair& info = pointInfo[i];
|
||||||
label proci = globalIndexAndTransform::processor(info);
|
label proci = globalTransforms_.processor(info);
|
||||||
label index = globalIndexAndTransform::index(info);
|
label index = globalTransforms_.index(info);
|
||||||
label transform = globalIndexAndTransform::transformIndex
|
label transform = globalTransforms_.transformIndex
|
||||||
(
|
(
|
||||||
info
|
info
|
||||||
);
|
);
|
||||||
|
|||||||
@ -271,10 +271,10 @@ Foam::mapDistribute::mapDistribute
|
|||||||
forAll(transformedElements, i)
|
forAll(transformedElements, i)
|
||||||
{
|
{
|
||||||
labelPair elem = transformedElements[i];
|
labelPair elem = transformedElements[i];
|
||||||
label proci = globalIndexAndTransform::processor(elem);
|
label proci = globalTransforms.processor(elem);
|
||||||
if (proci != Pstream::myProcNo())
|
if (proci != Pstream::myProcNo())
|
||||||
{
|
{
|
||||||
label index = globalIndexAndTransform::index(elem);
|
label index = globalTransforms.index(elem);
|
||||||
label nCompact = compactMap[proci].size();
|
label nCompact = compactMap[proci].size();
|
||||||
compactMap[proci].insert(index, nCompact);
|
compactMap[proci].insert(index, nCompact);
|
||||||
}
|
}
|
||||||
@ -302,7 +302,7 @@ Foam::mapDistribute::mapDistribute
|
|||||||
forAll(transformedElements, i)
|
forAll(transformedElements, i)
|
||||||
{
|
{
|
||||||
labelPair elem = transformedElements[i];
|
labelPair elem = transformedElements[i];
|
||||||
label trafoI = globalIndexAndTransform::transformIndex(elem);
|
label trafoI = globalTransforms.transformIndex(elem);
|
||||||
nPerTransform[trafoI]++;
|
nPerTransform[trafoI]++;
|
||||||
}
|
}
|
||||||
// Offset per transformIndex
|
// Offset per transformIndex
|
||||||
@ -322,9 +322,9 @@ Foam::mapDistribute::mapDistribute
|
|||||||
forAll(transformedElements, i)
|
forAll(transformedElements, i)
|
||||||
{
|
{
|
||||||
labelPair elem = transformedElements[i];
|
labelPair elem = transformedElements[i];
|
||||||
label proci = globalIndexAndTransform::processor(elem);
|
label proci = globalTransforms.processor(elem);
|
||||||
label index = globalIndexAndTransform::index(elem);
|
label index = globalTransforms.index(elem);
|
||||||
label trafoI = globalIndexAndTransform::transformIndex(elem);
|
label trafoI = globalTransforms.transformIndex(elem);
|
||||||
|
|
||||||
// Get compact index for untransformed element
|
// Get compact index for untransformed element
|
||||||
label rawElemI =
|
label rawElemI =
|
||||||
@ -379,10 +379,10 @@ Foam::mapDistribute::mapDistribute
|
|||||||
|
|
||||||
forAll(elems, i)
|
forAll(elems, i)
|
||||||
{
|
{
|
||||||
label proci = globalIndexAndTransform::processor(elems[i]);
|
label proci = globalTransforms.processor(elems[i]);
|
||||||
if (proci != Pstream::myProcNo())
|
if (proci != Pstream::myProcNo())
|
||||||
{
|
{
|
||||||
label index = globalIndexAndTransform::index(elems[i]);
|
label index = globalTransforms.index(elems[i]);
|
||||||
label nCompact = compactMap[proci].size();
|
label nCompact = compactMap[proci].size();
|
||||||
compactMap[proci].insert(index, nCompact);
|
compactMap[proci].insert(index, nCompact);
|
||||||
}
|
}
|
||||||
@ -414,7 +414,7 @@ Foam::mapDistribute::mapDistribute
|
|||||||
|
|
||||||
forAll(elems, i)
|
forAll(elems, i)
|
||||||
{
|
{
|
||||||
label trafoI = globalIndexAndTransform::transformIndex(elems[i]);
|
label trafoI = globalTransforms.transformIndex(elems[i]);
|
||||||
nPerTransform[trafoI]++;
|
nPerTransform[trafoI]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -439,9 +439,9 @@ Foam::mapDistribute::mapDistribute
|
|||||||
|
|
||||||
forAll(elems, i)
|
forAll(elems, i)
|
||||||
{
|
{
|
||||||
label proci = globalIndexAndTransform::processor(elems[i]);
|
label proci = globalTransforms.processor(elems[i]);
|
||||||
label index = globalIndexAndTransform::index(elems[i]);
|
label index = globalTransforms.index(elems[i]);
|
||||||
label trafoI = globalIndexAndTransform::transformIndex(elems[i]);
|
label trafoI = globalTransforms.transformIndex(elems[i]);
|
||||||
|
|
||||||
// Get compact index for untransformed element
|
// Get compact index for untransformed element
|
||||||
label rawElemI =
|
label rawElemI =
|
||||||
|
|||||||
@ -25,13 +25,14 @@ License
|
|||||||
|
|
||||||
#include "globalIndexAndTransform.H"
|
#include "globalIndexAndTransform.H"
|
||||||
#include "cyclicPolyPatch.H"
|
#include "cyclicPolyPatch.H"
|
||||||
|
#include "DynamicField.H"
|
||||||
|
#include "globalMeshData.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * Private Static Data Members * * * * * * * * * * * //
|
// * * * * * * * * * * * * Private Static Data Members * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(globalIndexAndTransform, 0);
|
defineTypeNameAndDebug(globalIndexAndTransform, 0);
|
||||||
const label globalIndexAndTransform::base_ = 32;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -127,10 +128,8 @@ void Foam::globalIndexAndTransform::determineTransforms()
|
|||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||||
|
|
||||||
transforms_ = List<vectorTensorTransform>(6);
|
DynamicList<vectorTensorTransform> localTransforms;
|
||||||
scalarField maxTol(6);
|
DynamicField<scalar> localTols;
|
||||||
|
|
||||||
label nextTrans = 0;
|
|
||||||
|
|
||||||
label dummyMatch = -1;
|
label dummyMatch = -1;
|
||||||
|
|
||||||
@ -170,7 +169,7 @@ void Foam::globalIndexAndTransform::determineTransforms()
|
|||||||
(
|
(
|
||||||
matchTransform
|
matchTransform
|
||||||
(
|
(
|
||||||
transforms_,
|
localTransforms,
|
||||||
dummyMatch,
|
dummyMatch,
|
||||||
transform,
|
transform,
|
||||||
cpp.matchTolerance(),
|
cpp.matchTolerance(),
|
||||||
@ -178,15 +177,8 @@ void Foam::globalIndexAndTransform::determineTransforms()
|
|||||||
) == 0
|
) == 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (nextTrans == 6)
|
localTransforms.append(transform);
|
||||||
{
|
localTols.append(cpp.matchTolerance());
|
||||||
FatalErrorInFunction
|
|
||||||
<< "More than six unsigned transforms"
|
|
||||||
<< " detected:" << nl << transforms_
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
transforms_[nextTrans] = transform;
|
|
||||||
maxTol[nextTrans++] = cpp.matchTolerance();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -207,7 +199,7 @@ void Foam::globalIndexAndTransform::determineTransforms()
|
|||||||
(
|
(
|
||||||
matchTransform
|
matchTransform
|
||||||
(
|
(
|
||||||
transforms_,
|
localTransforms,
|
||||||
dummyMatch,
|
dummyMatch,
|
||||||
transform,
|
transform,
|
||||||
cpp.matchTolerance(),
|
cpp.matchTolerance(),
|
||||||
@ -215,15 +207,8 @@ void Foam::globalIndexAndTransform::determineTransforms()
|
|||||||
) == 0
|
) == 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (nextTrans == 6)
|
localTransforms.append(transform);
|
||||||
{
|
localTols.append(cpp.matchTolerance());
|
||||||
FatalErrorInFunction
|
|
||||||
<< "More than six unsigned transforms"
|
|
||||||
<< " detected:" << nl << transforms_
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
transforms_[nextTrans] = transform;
|
|
||||||
maxTol[nextTrans++] = cpp.matchTolerance();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -233,21 +218,18 @@ void Foam::globalIndexAndTransform::determineTransforms()
|
|||||||
|
|
||||||
|
|
||||||
// Collect transforms on master
|
// Collect transforms on master
|
||||||
|
|
||||||
List<List<vectorTensorTransform>> allTransforms(Pstream::nProcs());
|
List<List<vectorTensorTransform>> allTransforms(Pstream::nProcs());
|
||||||
allTransforms[Pstream::myProcNo()] = transforms_;
|
allTransforms[Pstream::myProcNo()] = localTransforms;
|
||||||
Pstream::gatherList(allTransforms);
|
Pstream::gatherList(allTransforms);
|
||||||
|
|
||||||
// Collect matching tolerance on master
|
// Collect matching tolerance on master
|
||||||
List<scalarField> allTols(Pstream::nProcs());
|
List<scalarField> allTols(Pstream::nProcs());
|
||||||
allTols[Pstream::myProcNo()] = maxTol;
|
allTols[Pstream::myProcNo()] = localTols;
|
||||||
Pstream::gatherList(allTols);
|
Pstream::gatherList(allTols);
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
transforms_ = List<vectorTensorTransform>(3);
|
localTransforms.clear();
|
||||||
|
|
||||||
label nextTrans = 0;
|
|
||||||
|
|
||||||
forAll(allTransforms, proci)
|
forAll(allTransforms, proci)
|
||||||
{
|
{
|
||||||
@ -264,45 +246,23 @@ void Foam::globalIndexAndTransform::determineTransforms()
|
|||||||
(
|
(
|
||||||
matchTransform
|
matchTransform
|
||||||
(
|
(
|
||||||
transforms_,
|
localTransforms,
|
||||||
dummyMatch,
|
dummyMatch,
|
||||||
transform,
|
transform,
|
||||||
allTols[proci][pSVI],
|
allTols[proci][pSVI],
|
||||||
true
|
true
|
||||||
) == 0
|
) == 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
transforms_[nextTrans++] = transform;
|
localTransforms.append(transform);
|
||||||
}
|
|
||||||
|
|
||||||
if (nextTrans > 3)
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "More than three independent basic "
|
|
||||||
<< "transforms detected:" << nl
|
|
||||||
<< allTransforms
|
|
||||||
<< transforms_
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
transforms_.setSize(nextTrans);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
transforms_.transfer(localTransforms);
|
||||||
Pstream::scatter(transforms_);
|
Pstream::scatter(transforms_);
|
||||||
|
|
||||||
if (transforms_.size() > 3)
|
|
||||||
{
|
|
||||||
WarningInFunction
|
|
||||||
<< "More than three independent basic "
|
|
||||||
<< "transforms detected:" << nl
|
|
||||||
<< transforms_ << nl
|
|
||||||
<< "This is not a space filling tiling and will probably"
|
|
||||||
<< " give problems for e.g. lagrangian tracking or interpolation"
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -351,16 +311,12 @@ void Foam::globalIndexAndTransform::determinePatchTransformSign()
|
|||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||||
|
|
||||||
patchTransformSign_.setSize(patches.size(), Pair<label>(-1, 0));
|
patchTransformSign_.setSize(patches.size(), labelPair(-1, 0));
|
||||||
|
|
||||||
label matchTransI = -1;
|
|
||||||
|
|
||||||
forAll(patches, patchi)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchi];
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
// Pout<< nl << patchi << " " << pp.name() << endl;
|
|
||||||
|
|
||||||
// Note: special check for unordered cyclics. These are in fact
|
// Note: special check for unordered cyclics. These are in fact
|
||||||
// transform bcs and should probably be split off.
|
// transform bcs and should probably be split off.
|
||||||
if
|
if
|
||||||
@ -375,15 +331,12 @@ void Foam::globalIndexAndTransform::determinePatchTransformSign()
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const coupledPolyPatch& cpp =
|
const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>(pp);
|
||||||
refCast<const coupledPolyPatch>(pp);
|
|
||||||
|
|
||||||
if (cpp.separated())
|
if (cpp.separated())
|
||||||
{
|
{
|
||||||
const vectorField& sepVecs = cpp.separation();
|
const vectorField& sepVecs = cpp.separation();
|
||||||
|
|
||||||
// Pout<< "sepVecs " << sepVecs << endl;
|
|
||||||
|
|
||||||
// This loop is implicitly expecting only a single
|
// This loop is implicitly expecting only a single
|
||||||
// value for separation()
|
// value for separation()
|
||||||
forAll(sepVecs, sVI)
|
forAll(sepVecs, sVI)
|
||||||
@ -394,6 +347,7 @@ void Foam::globalIndexAndTransform::determinePatchTransformSign()
|
|||||||
{
|
{
|
||||||
vectorTensorTransform t(sepVec);
|
vectorTensorTransform t(sepVec);
|
||||||
|
|
||||||
|
label matchTransI;
|
||||||
label sign = matchTransform
|
label sign = matchTransform
|
||||||
(
|
(
|
||||||
transforms_,
|
transforms_,
|
||||||
@ -402,22 +356,8 @@ void Foam::globalIndexAndTransform::determinePatchTransformSign()
|
|||||||
cpp.matchTolerance(),
|
cpp.matchTolerance(),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
// Pout<< sign << " " << matchTransI << endl;
|
|
||||||
|
|
||||||
// List<label> permutation(transforms_.size(), 0);
|
|
||||||
|
|
||||||
// permutation[matchTransI] = sign;
|
|
||||||
|
|
||||||
// Pout<< encodeTransformIndex(permutation) << nl
|
|
||||||
// << transformPermutations_
|
|
||||||
// [
|
|
||||||
// encodeTransformIndex(permutation)
|
|
||||||
// ]
|
|
||||||
// << endl;
|
|
||||||
|
|
||||||
patchTransformSign_[patchi] =
|
patchTransformSign_[patchi] =
|
||||||
Pair<label>(matchTransI, sign);
|
labelPair(matchTransI, sign);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -426,8 +366,6 @@ void Foam::globalIndexAndTransform::determinePatchTransformSign()
|
|||||||
{
|
{
|
||||||
const tensorField& transTensors = cpp.reverseT();
|
const tensorField& transTensors = cpp.reverseT();
|
||||||
|
|
||||||
// Pout<< "transTensors " << transTensors << endl;
|
|
||||||
|
|
||||||
// This loop is implicitly expecting only a single
|
// This loop is implicitly expecting only a single
|
||||||
// value for reverseT()
|
// value for reverseT()
|
||||||
forAll(transTensors, tTI)
|
forAll(transTensors, tTI)
|
||||||
@ -438,6 +376,7 @@ void Foam::globalIndexAndTransform::determinePatchTransformSign()
|
|||||||
{
|
{
|
||||||
vectorTensorTransform t(transT);
|
vectorTensorTransform t(transT);
|
||||||
|
|
||||||
|
label matchTransI;
|
||||||
label sign = matchTransform
|
label sign = matchTransform
|
||||||
(
|
(
|
||||||
transforms_,
|
transforms_,
|
||||||
@ -447,37 +386,65 @@ void Foam::globalIndexAndTransform::determinePatchTransformSign()
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
// Pout<< sign << " " << matchTransI << endl;
|
|
||||||
|
|
||||||
// List<label> permutation(transforms_.size(), 0);
|
|
||||||
|
|
||||||
// permutation[matchTransI] = sign;
|
|
||||||
|
|
||||||
// Pout<< encodeTransformIndex(permutation) << nl
|
|
||||||
// << transformPermutations_
|
|
||||||
// [
|
|
||||||
// encodeTransformIndex(permutation)
|
|
||||||
// ]
|
|
||||||
// << endl;
|
|
||||||
|
|
||||||
patchTransformSign_[patchi] =
|
patchTransformSign_[patchi] =
|
||||||
Pair<label>(matchTransI, sign);
|
labelPair(matchTransI, sign);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Pout<< patchTransformSign_ << endl;
|
|
||||||
|
bool Foam::globalIndexAndTransform::uniqueTransform
|
||||||
|
(
|
||||||
|
const point& pt,
|
||||||
|
labelPairList& trafos,
|
||||||
|
const label patchi,
|
||||||
|
const labelPair& patchTrafo
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
if (findIndex(trafos, patchTrafo) == -1)
|
||||||
|
{
|
||||||
|
// New transform. Check if already have 3
|
||||||
|
if (trafos.size() == 3)
|
||||||
|
{
|
||||||
|
if (patchi > -1)
|
||||||
|
{
|
||||||
|
WarningInFunction
|
||||||
|
<< "Point " << pt
|
||||||
|
<< " is on patch " << mesh_.boundaryMesh()[patchi].name();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
WarningInFunction
|
||||||
|
<< "Point " << pt << " is on a coupled patch";
|
||||||
|
}
|
||||||
|
Warning
|
||||||
|
<< " with transformation " << patchTrafo
|
||||||
|
<< " but also on 3 other patches with transforms "
|
||||||
|
<< trafos << nl
|
||||||
|
<< "This is not a space filling tiling and might"
|
||||||
|
<< " indicate a setup problem and give problems"
|
||||||
|
<< " for e.g. lagrangian tracking or interpolation" << endl;
|
||||||
|
|
||||||
|
// Already warned so no need to extend more
|
||||||
|
trafos.clear();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::globalIndexAndTransform::globalIndexAndTransform
|
Foam::globalIndexAndTransform::globalIndexAndTransform(const polyMesh& mesh)
|
||||||
(
|
|
||||||
const polyMesh& mesh
|
|
||||||
)
|
|
||||||
:
|
:
|
||||||
mesh_(mesh),
|
mesh_(mesh),
|
||||||
transforms_(),
|
transforms_(),
|
||||||
@ -546,13 +513,102 @@ Foam::globalIndexAndTransform::globalIndexAndTransform
|
|||||||
Info<< "nullTransformIndex:" << nullTransformIndex() << endl
|
Info<< "nullTransformIndex:" << nullTransformIndex() << endl
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (transforms_.size() > 0)
|
||||||
|
{
|
||||||
|
// Check that the transforms are space filling : any point
|
||||||
|
// can only use up to three transforms
|
||||||
|
|
||||||
|
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||||
|
|
||||||
|
|
||||||
|
// 1. Collect transform&sign per point and do local check
|
||||||
|
|
||||||
|
List<labelPairList> pointToTrafos(mesh_.nPoints());
|
||||||
|
|
||||||
|
forAll(patches, patchi)
|
||||||
|
{
|
||||||
|
const polyPatch& pp = patches[patchi];
|
||||||
|
|
||||||
|
const labelPair& transSign = patchTransformSign_[patchi];
|
||||||
|
|
||||||
|
if (transSign.first() > -1)
|
||||||
|
{
|
||||||
|
const labelList& mp = pp.meshPoints();
|
||||||
|
forAll(mp, i)
|
||||||
|
{
|
||||||
|
labelPairList& trafos = pointToTrafos[mp[i]];
|
||||||
|
|
||||||
|
bool newTransform = uniqueTransform
|
||||||
|
(
|
||||||
|
mesh_.points()[mp[i]],
|
||||||
|
trafos,
|
||||||
|
patchi,
|
||||||
|
transSign
|
||||||
|
);
|
||||||
|
|
||||||
|
if (newTransform)
|
||||||
|
{
|
||||||
|
trafos.append(transSign);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Synchronise across collocated (= untransformed) points
|
||||||
|
// TBD: there is a big problem in that globalMeshData uses
|
||||||
|
// globalIndexAndTransform. Triggers recursion.
|
||||||
|
if (false)
|
||||||
|
{
|
||||||
|
const globalMeshData& gmd = mesh_.globalData();
|
||||||
|
const indirectPrimitivePatch& cpp = gmd.coupledPatch();
|
||||||
|
const labelList& meshPoints = cpp.meshPoints();
|
||||||
|
const mapDistribute& slavesMap = gmd.globalCoPointSlavesMap();
|
||||||
|
const labelListList& slaves = gmd.globalCoPointSlaves();
|
||||||
|
|
||||||
|
List<labelPairList> elems(slavesMap.constructSize());
|
||||||
|
forAll(meshPoints, i)
|
||||||
|
{
|
||||||
|
elems[i] = pointToTrafos[meshPoints[i]];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pull slave data onto master. No need to update transformed slots.
|
||||||
|
slavesMap.distribute(elems, false);
|
||||||
|
|
||||||
|
// Combine master data with slave data
|
||||||
|
forAll(slaves, i)
|
||||||
|
{
|
||||||
|
labelPairList& trafos = elems[i];
|
||||||
|
|
||||||
|
const labelList& slavePoints = slaves[i];
|
||||||
|
|
||||||
|
// Combine master with untransformed slave data
|
||||||
|
forAll(slavePoints, j)
|
||||||
|
{
|
||||||
|
const labelPairList& slaveTrafos = elems[slavePoints[j]];
|
||||||
|
|
||||||
|
forAll(slaveTrafos, slaveI)
|
||||||
|
{
|
||||||
|
bool newTransform = uniqueTransform
|
||||||
|
(
|
||||||
|
mesh_.points()[meshPoints[i]],
|
||||||
|
trafos,
|
||||||
|
-1,
|
||||||
|
slaveTrafos[slaveI]
|
||||||
|
);
|
||||||
|
|
||||||
|
if (newTransform)
|
||||||
|
{
|
||||||
|
trafos.append(slaveTrafos[slaveI]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::globalIndexAndTransform::~globalIndexAndTransform()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -28,7 +28,9 @@ Description
|
|||||||
Determination and storage of the possible independent transforms
|
Determination and storage of the possible independent transforms
|
||||||
introduced by coupledPolyPatches, as well as all of the possible
|
introduced by coupledPolyPatches, as well as all of the possible
|
||||||
permutations of these transforms generated by the presence of
|
permutations of these transforms generated by the presence of
|
||||||
multiple coupledPolyPatches, i.e. more than one cyclic boundary.
|
multiple coupledPolyPatches, i.e. more than one cyclic boundary. Note that
|
||||||
|
any given point can be on maximum 3 transforms only (and these transforms
|
||||||
|
have to be perpendicular)
|
||||||
|
|
||||||
Also provides global index encoding and decoding for entity
|
Also provides global index encoding and decoding for entity
|
||||||
(i.e. cell) index, processor index and transform index (0 or
|
(i.e. cell) index, processor index and transform index (0 or
|
||||||
@ -71,8 +73,15 @@ public:
|
|||||||
// - transform
|
// - transform
|
||||||
class less
|
class less
|
||||||
{
|
{
|
||||||
|
const globalIndexAndTransform& gi_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
less(const globalIndexAndTransform& gi)
|
||||||
|
:
|
||||||
|
gi_(gi)
|
||||||
|
{}
|
||||||
|
|
||||||
inline bool operator()(const labelPair&, const labelPair&) const;
|
inline bool operator()(const labelPair&, const labelPair&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -87,10 +96,8 @@ private:
|
|||||||
//- The possible independent (non-permuted) transforms of the
|
//- The possible independent (non-permuted) transforms of the
|
||||||
// geometry, i.e. for a geometry with two cyclics, this
|
// geometry, i.e. for a geometry with two cyclics, this
|
||||||
// stores the two transforms, not the eight permutations.
|
// stores the two transforms, not the eight permutations.
|
||||||
// There may not be more than three transforms in the range
|
// Any point can not be on more than three transforms but overall
|
||||||
// of coupledPolyPatch geometries (separated XOR
|
// the mesh can have more than three.
|
||||||
// non-parallel) and symmetries (cuboid periodicity only)
|
|
||||||
// supported.
|
|
||||||
List<vectorTensorTransform> transforms_;
|
List<vectorTensorTransform> transforms_;
|
||||||
|
|
||||||
//- The permutations of the transforms, stored for lookup
|
//- The permutations of the transforms, stored for lookup
|
||||||
@ -105,13 +112,7 @@ private:
|
|||||||
//- Mapping from patch index to which transform it matches (or
|
//- Mapping from patch index to which transform it matches (or
|
||||||
// -1 for none) (.first()) and what sign to use for it,
|
// -1 for none) (.first()) and what sign to use for it,
|
||||||
// i.e. +/- 1 (.second()).
|
// i.e. +/- 1 (.second()).
|
||||||
List<Pair<label>> patchTransformSign_;
|
List<labelPair> patchTransformSign_;
|
||||||
|
|
||||||
|
|
||||||
// Private static data
|
|
||||||
|
|
||||||
//- Number of spaces to reserve for transform encoding
|
|
||||||
static const label base_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
@ -124,7 +125,7 @@ private:
|
|||||||
void determineTransformPermutations();
|
void determineTransformPermutations();
|
||||||
|
|
||||||
//- Determine which patch uses which transform (if any) and which
|
//- Determine which patch uses which transform (if any) and which
|
||||||
//- Sign to use
|
// sign to use
|
||||||
void determinePatchTransformSign();
|
void determinePatchTransformSign();
|
||||||
|
|
||||||
//- Test a list of reference transforms to see if the test
|
//- Test a list of reference transforms to see if the test
|
||||||
@ -139,16 +140,14 @@ private:
|
|||||||
bool checkBothSigns
|
bool checkBothSigns
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Encode transform index. Hardcoded to 3 independent transforms max.
|
//- Return true if transform is not yet present in trafos. Issues
|
||||||
inline label encodeTransformIndex
|
// warning if too many transforms
|
||||||
|
bool uniqueTransform
|
||||||
(
|
(
|
||||||
const FixedList<Foam::label, 3>& permutationIndices
|
const point& pt,
|
||||||
) const;
|
labelPairList& trafos,
|
||||||
|
const label patchi,
|
||||||
//- Decode transform index. Hardcoded to 3 independent transforms max.
|
const labelPair& patchTrafo
|
||||||
inline FixedList<label, 3> decodeTransformIndex
|
|
||||||
(
|
|
||||||
const label transformIndex
|
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
@ -160,10 +159,6 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Declare friendship with the entry class for IO
|
|
||||||
friend class globalPoints;
|
|
||||||
|
|
||||||
|
|
||||||
// Declare name of the class and its debug switch
|
// Declare name of the class and its debug switch
|
||||||
ClassName("globalIndexAndTransform");
|
ClassName("globalIndexAndTransform");
|
||||||
|
|
||||||
@ -174,10 +169,6 @@ public:
|
|||||||
globalIndexAndTransform(const polyMesh& mesh);
|
globalIndexAndTransform(const polyMesh& mesh);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
~globalIndexAndTransform();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Generate a transform index from the permutation indices of
|
//- Generate a transform index from the permutation indices of
|
||||||
@ -185,9 +176,12 @@ public:
|
|||||||
// only be -1, 0 or +1.
|
// only be -1, 0 or +1.
|
||||||
inline label encodeTransformIndex
|
inline label encodeTransformIndex
|
||||||
(
|
(
|
||||||
const List<label>& permutationIndices
|
const labelList& permutationIndices
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Decode transform index
|
||||||
|
inline labelList decodeTransformIndex(const label transformIndex) const;
|
||||||
|
|
||||||
//- Add patch transformation to transformIndex. Return new
|
//- Add patch transformation to transformIndex. Return new
|
||||||
// transformIndex. (by default the patch is the sending, not the
|
// transformIndex. (by default the patch is the sending, not the
|
||||||
// receiving, patch)
|
// receiving, patch)
|
||||||
@ -221,74 +215,71 @@ public:
|
|||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Encode index and bare index as components on own processor
|
//- Encode index and bare index as components on own processor
|
||||||
inline static labelPair encode
|
inline labelPair encode
|
||||||
(
|
(
|
||||||
const label index,
|
const label index,
|
||||||
const label transformIndex
|
const label transformIndex
|
||||||
);
|
) const;
|
||||||
|
|
||||||
//- Encode index and bare index as components on given processor
|
//- Encode index and bare index as components on given processor
|
||||||
inline static labelPair encode
|
inline labelPair encode
|
||||||
(
|
(
|
||||||
const label proci,
|
const label proci,
|
||||||
const label index,
|
const label index,
|
||||||
const label transformIndex
|
const label transformIndex
|
||||||
);
|
) const;
|
||||||
|
|
||||||
//- Index carried by the object
|
//- Index carried by the object
|
||||||
inline static label index(const labelPair& globalIAndTransform);
|
inline label index(const labelPair& globalIAndTransform) const;
|
||||||
|
|
||||||
//- Which processor does this come from?
|
//- Which processor does this come from?
|
||||||
inline static label processor(const labelPair& globalIAndTransform);
|
inline label processor(const labelPair& globalIAndTransform) const;
|
||||||
|
|
||||||
//- Transform carried by the object
|
//- Transform carried by the object
|
||||||
inline static label transformIndex
|
inline label transformIndex(const labelPair& globalIAndTransform) const;
|
||||||
|
|
||||||
|
//- Return the number of independent transforms
|
||||||
|
inline label nIndependentTransforms() const;
|
||||||
|
|
||||||
|
//- Return access to the stored independent transforms
|
||||||
|
inline const List<vectorTensorTransform>& transforms() const;
|
||||||
|
|
||||||
|
//- Return access to the permuted transforms
|
||||||
|
inline const List<vectorTensorTransform>&
|
||||||
|
transformPermutations() const;
|
||||||
|
|
||||||
|
//- Return the transformIndex (index in transformPermutations)
|
||||||
|
// of the identity transform
|
||||||
|
inline label nullTransformIndex() const;
|
||||||
|
|
||||||
|
//- Return access to the per-patch transform-sign pairs
|
||||||
|
inline const List<labelPair>& patchTransformSign() const;
|
||||||
|
|
||||||
|
//- Access the overall (permuted) transform corresponding
|
||||||
|
// to the transformIndex
|
||||||
|
inline const vectorTensorTransform& transform
|
||||||
(
|
(
|
||||||
const labelPair& globalIAndTransform
|
label transformIndex
|
||||||
);
|
) const;
|
||||||
|
|
||||||
// Access
|
//- Access the all of the indices of the transform
|
||||||
|
// permutations corresponding the transforms of the
|
||||||
|
// listed patch indices. This only allows a maximum of three
|
||||||
|
// transformations (since routine is used to transform points and
|
||||||
|
// any given point can only be on 3 or less transforms)
|
||||||
|
inline labelList transformIndicesForPatches
|
||||||
|
(
|
||||||
|
const labelHashSet& patchIs
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Return the number of independent transforms
|
//- Apply all of the transform permutations
|
||||||
inline label nIndependentTransforms() const;
|
// corresponding the transforms of the listed patch
|
||||||
|
// indices to the supplied point
|
||||||
//- Return access to the stored independent transforms
|
inline pointField transformPatches
|
||||||
inline const List<vectorTensorTransform>& transforms() const;
|
(
|
||||||
|
const labelHashSet& patchIs,
|
||||||
//- Return access to the permuted transforms
|
const point& pt
|
||||||
inline const List<vectorTensorTransform>&
|
) const;
|
||||||
transformPermutations() const;
|
|
||||||
|
|
||||||
//- Return the transformIndex (index in transformPermutations)
|
|
||||||
// of the identity transform
|
|
||||||
inline label nullTransformIndex() const;
|
|
||||||
|
|
||||||
//- Return access to the per-patch transform-sign pairs
|
|
||||||
inline const List<Pair<label>>& patchTransformSign() const;
|
|
||||||
|
|
||||||
//- Access the overall (permuted) transform corresponding
|
|
||||||
// to the transformIndex
|
|
||||||
inline const vectorTensorTransform& transform
|
|
||||||
(
|
|
||||||
label transformIndex
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Access the all of the indices of the transform
|
|
||||||
// permutations corresponding the transforms of the
|
|
||||||
// listed patch indices
|
|
||||||
inline labelList transformIndicesForPatches
|
|
||||||
(
|
|
||||||
const labelHashSet& patchIs
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Apply all of the transform permutations
|
|
||||||
// corresponding the transforms of the listed patch
|
|
||||||
// indices to the supplied point
|
|
||||||
inline pointField transformPatches
|
|
||||||
(
|
|
||||||
const labelHashSet& patchIs,
|
|
||||||
const point& pt
|
|
||||||
) const;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -33,8 +33,8 @@ bool Foam::globalIndexAndTransform::less::operator()
|
|||||||
const labelPair& b
|
const labelPair& b
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
label procA = globalIndexAndTransform::processor(a);
|
label procA = gi_.processor(a);
|
||||||
label procB = globalIndexAndTransform::processor(b);
|
label procB = gi_.processor(b);
|
||||||
|
|
||||||
if (procA < procB)
|
if (procA < procB)
|
||||||
{
|
{
|
||||||
@ -47,8 +47,8 @@ bool Foam::globalIndexAndTransform::less::operator()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Equal proc.
|
// Equal proc.
|
||||||
label indexA = globalIndexAndTransform::index(a);
|
label indexA = gi_.index(a);
|
||||||
label indexB = globalIndexAndTransform::index(b);
|
label indexB = gi_.index(b);
|
||||||
|
|
||||||
if (indexA < indexB)
|
if (indexA < indexB)
|
||||||
{
|
{
|
||||||
@ -61,8 +61,8 @@ bool Foam::globalIndexAndTransform::less::operator()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Equal index
|
// Equal index
|
||||||
label transformA = globalIndexAndTransform::transformIndex(a);
|
label transformA = gi_.transformIndex(a);
|
||||||
label transformB = globalIndexAndTransform::transformIndex(b);
|
label transformB = gi_.transformIndex(b);
|
||||||
|
|
||||||
return transformA < transformB;
|
return transformA < transformB;
|
||||||
}
|
}
|
||||||
@ -72,7 +72,7 @@ bool Foam::globalIndexAndTransform::less::operator()
|
|||||||
|
|
||||||
Foam::label Foam::globalIndexAndTransform::encodeTransformIndex
|
Foam::label Foam::globalIndexAndTransform::encodeTransformIndex
|
||||||
(
|
(
|
||||||
const List<label>& permutationIndices
|
const labelList& permutationIndices
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (permutationIndices.size() != transforms_.size())
|
if (permutationIndices.size() != transforms_.size())
|
||||||
@ -106,68 +106,20 @@ Foam::label Foam::globalIndexAndTransform::encodeTransformIndex
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::globalIndexAndTransform::encodeTransformIndex
|
Foam::labelList Foam::globalIndexAndTransform::decodeTransformIndex
|
||||||
(
|
|
||||||
const FixedList<Foam::label, 3>& permutation
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (nIndependentTransforms() == 0)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (nIndependentTransforms() == 1)
|
|
||||||
{
|
|
||||||
return permutation[0]+1;
|
|
||||||
}
|
|
||||||
else if (nIndependentTransforms() == 2)
|
|
||||||
{
|
|
||||||
return (permutation[1]+1)*3 + (permutation[0]+1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return
|
|
||||||
(permutation[2]+1)*9
|
|
||||||
+ (permutation[1]+1)*3
|
|
||||||
+ (permutation[0]+1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::FixedList<Foam::label, 3>
|
|
||||||
Foam::globalIndexAndTransform::decodeTransformIndex
|
|
||||||
(
|
(
|
||||||
const label transformIndex
|
const label transformIndex
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
FixedList<label, 3> permutation(label(0));
|
labelList permutation(transforms_.size(), 0);
|
||||||
|
|
||||||
label t = transformIndex;
|
label t = transformIndex;
|
||||||
if (nIndependentTransforms() > 0)
|
forAll(permutation, i)
|
||||||
{
|
{
|
||||||
permutation[0] = (t%3)-1;
|
permutation[i] = (t%3)-1;
|
||||||
if (nIndependentTransforms() > 1)
|
t /= 3;
|
||||||
{
|
|
||||||
t /= 3;
|
|
||||||
permutation[1] = (t%3)-1;
|
|
||||||
if (nIndependentTransforms() > 2)
|
|
||||||
{
|
|
||||||
t /= 3;
|
|
||||||
permutation[2] = (t%3)-1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FULLDEBUG
|
|
||||||
t /= 3;
|
|
||||||
if (t != 0)
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "transformIndex : " << transformIndex
|
|
||||||
<< " has more than 3 fields."
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return permutation;
|
return permutation;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,15 +132,28 @@ Foam::label Foam::globalIndexAndTransform::addToTransformIndex
|
|||||||
const scalar tol
|
const scalar tol
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const Pair<label>& transSign = patchTransformSign_[patchi];
|
const labelPair& transSign = patchTransformSign_[patchi];
|
||||||
|
|
||||||
label matchTransI = transSign.first();
|
label matchTransI = transSign.first();
|
||||||
|
|
||||||
// Hardcoded for max 3 transforms only!
|
if (matchTransI >= transforms_.size())
|
||||||
|
|
||||||
if (matchTransI > -1 && matchTransI < 3)
|
|
||||||
{
|
{
|
||||||
FixedList<label, 3> permutation = decodeTransformIndex(transformIndex);
|
FatalErrorInFunction
|
||||||
|
<< "patch:" << mesh_.boundaryMesh()[patchi].name()
|
||||||
|
<< " transform:" << matchTransI
|
||||||
|
<< " out of possible transforms:" << transforms_
|
||||||
|
<< exit(FatalError);
|
||||||
|
return labelMin;
|
||||||
|
}
|
||||||
|
else if (matchTransI == -1)
|
||||||
|
{
|
||||||
|
// No additional transformation for this patch
|
||||||
|
return transformIndex;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Decode current set of transforms
|
||||||
|
labelList permutation(decodeTransformIndex(transformIndex));
|
||||||
|
|
||||||
|
|
||||||
// Add patch transform
|
// Add patch transform
|
||||||
@ -267,10 +232,6 @@ Foam::label Foam::globalIndexAndTransform::addToTransformIndex
|
|||||||
|
|
||||||
return encodeTransformIndex(permutation);
|
return encodeTransformIndex(permutation);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return transformIndex;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -287,7 +248,7 @@ Foam::label Foam::globalIndexAndTransform::minimumTransformIndex
|
|||||||
|
|
||||||
|
|
||||||
// Count number of transforms
|
// Count number of transforms
|
||||||
FixedList<label, 3> permutation0 = decodeTransformIndex(transformIndex0);
|
labelList permutation0(decodeTransformIndex(transformIndex0));
|
||||||
label n0 = 0;
|
label n0 = 0;
|
||||||
forAll(permutation0, i)
|
forAll(permutation0, i)
|
||||||
{
|
{
|
||||||
@ -297,7 +258,7 @@ Foam::label Foam::globalIndexAndTransform::minimumTransformIndex
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FixedList<label, 3> permutation1 = decodeTransformIndex(transformIndex1);
|
labelList permutation1(decodeTransformIndex(transformIndex1));
|
||||||
label n1 = 0;
|
label n1 = 0;
|
||||||
forAll(permutation1, i)
|
forAll(permutation1, i)
|
||||||
{
|
{
|
||||||
@ -324,8 +285,8 @@ Foam::label Foam::globalIndexAndTransform::subtractTransformIndex
|
|||||||
const label transformIndex1
|
const label transformIndex1
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
FixedList<label, 3> permutation0 = decodeTransformIndex(transformIndex0);
|
labelList permutation0(decodeTransformIndex(transformIndex0));
|
||||||
FixedList<label, 3> permutation1 = decodeTransformIndex(transformIndex1);
|
labelList permutation1(decodeTransformIndex(transformIndex1));
|
||||||
|
|
||||||
forAll(permutation0, i)
|
forAll(permutation0, i)
|
||||||
{
|
{
|
||||||
@ -340,7 +301,7 @@ Foam::labelPair Foam::globalIndexAndTransform::encode
|
|||||||
(
|
(
|
||||||
const label index,
|
const label index,
|
||||||
const label transformIndex
|
const label transformIndex
|
||||||
)
|
) const
|
||||||
{
|
{
|
||||||
return encode(Pstream::myProcNo(), index, transformIndex);
|
return encode(Pstream::myProcNo(), index, transformIndex);
|
||||||
}
|
}
|
||||||
@ -351,21 +312,22 @@ Foam::labelPair Foam::globalIndexAndTransform::encode
|
|||||||
const label proci,
|
const label proci,
|
||||||
const label index,
|
const label index,
|
||||||
const label transformIndex
|
const label transformIndex
|
||||||
)
|
) const
|
||||||
{
|
{
|
||||||
if (transformIndex < 0 || transformIndex >= base_)
|
if (transformIndex < 0 || transformIndex >= transformPermutations_.size())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "TransformIndex " << transformIndex
|
<< "TransformIndex " << transformIndex
|
||||||
<< " is outside allowed range of 0 to "
|
<< " is outside allowed range of 0 to "
|
||||||
<< base_ - 1
|
<< transformPermutations_.size() - 1
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (proci > labelMax/base_)
|
if (proci > labelMax/transformPermutations_.size())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Overflow : encoding processor " << proci << " in base " << base_
|
<< "Overflow : encoding processor " << proci
|
||||||
|
<< " in base " << transformPermutations_.size()
|
||||||
<< " exceeds capability of label (" << labelMax
|
<< " exceeds capability of label (" << labelMax
|
||||||
<< "). Please recompile with larger datatype for label."
|
<< "). Please recompile with larger datatype for label."
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
@ -374,7 +336,7 @@ Foam::labelPair Foam::globalIndexAndTransform::encode
|
|||||||
return labelPair
|
return labelPair
|
||||||
(
|
(
|
||||||
index,
|
index,
|
||||||
transformIndex + proci*base_
|
transformIndex + proci*transformPermutations_.size()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -382,7 +344,7 @@ Foam::labelPair Foam::globalIndexAndTransform::encode
|
|||||||
Foam::label Foam::globalIndexAndTransform::index
|
Foam::label Foam::globalIndexAndTransform::index
|
||||||
(
|
(
|
||||||
const labelPair& globalIAndTransform
|
const labelPair& globalIAndTransform
|
||||||
)
|
) const
|
||||||
{
|
{
|
||||||
return globalIAndTransform.first();
|
return globalIAndTransform.first();
|
||||||
}
|
}
|
||||||
@ -391,18 +353,18 @@ Foam::label Foam::globalIndexAndTransform::index
|
|||||||
Foam::label Foam::globalIndexAndTransform::processor
|
Foam::label Foam::globalIndexAndTransform::processor
|
||||||
(
|
(
|
||||||
const labelPair& globalIAndTransform
|
const labelPair& globalIAndTransform
|
||||||
)
|
) const
|
||||||
{
|
{
|
||||||
return globalIAndTransform.second()/base_;
|
return globalIAndTransform.second()/transformPermutations_.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::globalIndexAndTransform::transformIndex
|
Foam::label Foam::globalIndexAndTransform::transformIndex
|
||||||
(
|
(
|
||||||
const labelPair& globalIAndTransform
|
const labelPair& globalIAndTransform
|
||||||
)
|
) const
|
||||||
{
|
{
|
||||||
return globalIAndTransform.second() % base_;
|
return globalIAndTransform.second()%transformPermutations_.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -432,7 +394,7 @@ Foam::label Foam::globalIndexAndTransform::nullTransformIndex() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const Foam::List<Foam::Pair<Foam::label>>&
|
const Foam::labelPairList&
|
||||||
Foam::globalIndexAndTransform::patchTransformSign() const
|
Foam::globalIndexAndTransform::patchTransformSign() const
|
||||||
{
|
{
|
||||||
return patchTransformSign_;
|
return patchTransformSign_;
|
||||||
@ -453,7 +415,7 @@ Foam::labelList Foam::globalIndexAndTransform::transformIndicesForPatches
|
|||||||
const labelHashSet& patchis
|
const labelHashSet& patchis
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
List<label> permutation(transforms_.size(), 0);
|
labelList permutation(transforms_.size(), 0);
|
||||||
|
|
||||||
labelList selectedTransformIs(0);
|
labelList selectedTransformIs(0);
|
||||||
|
|
||||||
@ -466,7 +428,7 @@ Foam::labelList Foam::globalIndexAndTransform::transformIndicesForPatches
|
|||||||
{
|
{
|
||||||
label patchi = iter.key();
|
label patchi = iter.key();
|
||||||
|
|
||||||
const Pair<label>& transSign = patchTransformSign_[patchi];
|
const labelPair& transSign = patchTransformSign_[patchi];
|
||||||
|
|
||||||
label matchTransI = transSign.first();
|
label matchTransI = transSign.first();
|
||||||
|
|
||||||
@ -520,7 +482,7 @@ Foam::labelList Foam::globalIndexAndTransform::transformIndicesForPatches
|
|||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
List<label> tempPermutation = permutation;
|
labelList tempPermutation = permutation;
|
||||||
|
|
||||||
label a = 0;
|
label a = 0;
|
||||||
label b = 1;
|
label b = 1;
|
||||||
@ -565,7 +527,7 @@ Foam::labelList Foam::globalIndexAndTransform::transformIndicesForPatches
|
|||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
List<label> tempPermutation = permutation;
|
labelList tempPermutation = permutation;
|
||||||
|
|
||||||
tempPermutation[0] = 0;
|
tempPermutation[0] = 0;
|
||||||
tempPermutation[1] = 0;
|
tempPermutation[1] = 0;
|
||||||
|
|||||||
@ -34,7 +34,8 @@ License
|
|||||||
{ \
|
{ \
|
||||||
typedef TDModel<BaseModel<Transport>> \
|
typedef TDModel<BaseModel<Transport>> \
|
||||||
Transport##BaseModel; \
|
Transport##BaseModel; \
|
||||||
typedef laminar<Transport##BaseModel> Laminar##Transport##BaseModel; \
|
typedef laminarModel<Transport##BaseModel> \
|
||||||
|
laminar##Transport##BaseModel; \
|
||||||
typedef RASModel<EddyDiffusivity<Transport##BaseModel>> \
|
typedef RASModel<EddyDiffusivity<Transport##BaseModel>> \
|
||||||
RAS##Transport##BaseModel; \
|
RAS##Transport##BaseModel; \
|
||||||
typedef LESModel<EddyDiffusivity<Transport##BaseModel>> \
|
typedef LESModel<EddyDiffusivity<Transport##BaseModel>> \
|
||||||
@ -65,14 +66,18 @@ License
|
|||||||
Transport##BaseModel; \
|
Transport##BaseModel; \
|
||||||
\
|
\
|
||||||
\
|
\
|
||||||
typedef laminar<Transport##BaseModel> Laminar##Transport##BaseModel; \
|
typedef laminarModel<Transport##BaseModel> \
|
||||||
|
laminar##Transport##BaseModel; \
|
||||||
\
|
\
|
||||||
defineNamedTemplateTypeNameAndDebug(Laminar##Transport##BaseModel, 0); \
|
defineNamedTemplateTypeNameAndDebug(laminar##Transport##BaseModel, 0); \
|
||||||
|
\
|
||||||
|
defineTemplateRunTimeSelectionTable \
|
||||||
|
(laminar##Transport##BaseModel, dictionary); \
|
||||||
\
|
\
|
||||||
addToRunTimeSelectionTable \
|
addToRunTimeSelectionTable \
|
||||||
( \
|
( \
|
||||||
Transport##baseModel, \
|
Transport##baseModel, \
|
||||||
Laminar##Transport##BaseModel, \
|
laminar##Transport##BaseModel, \
|
||||||
dictionary \
|
dictionary \
|
||||||
); \
|
); \
|
||||||
\
|
\
|
||||||
@ -110,6 +115,27 @@ License
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#define makeTemplatedLaminarModel(BaseModel, SType, Type) \
|
||||||
|
typedef Foam::SType##Models::Type<Foam::BaseModel> \
|
||||||
|
Type##SType##BaseModel; \
|
||||||
|
defineNamedTemplateTypeNameAndDebug(Type##SType##BaseModel, 0); \
|
||||||
|
\
|
||||||
|
namespace Foam \
|
||||||
|
{ \
|
||||||
|
namespace SType##Models \
|
||||||
|
{ \
|
||||||
|
typedef Type<BaseModel> Type##SType##BaseModel; \
|
||||||
|
\
|
||||||
|
addToRunTimeSelectionTable \
|
||||||
|
( \
|
||||||
|
SType##BaseModel, \
|
||||||
|
Type##SType##BaseModel, \
|
||||||
|
dictionary \
|
||||||
|
); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#define makeTemplatedTurbulenceModel(BaseModel, SType, Type) \
|
#define makeTemplatedTurbulenceModel(BaseModel, SType, Type) \
|
||||||
typedef Foam::SType##Models::Type<Foam::EddyDiffusivity<Foam::BaseModel>> \
|
typedef Foam::SType##Models::Type<Foam::EddyDiffusivity<Foam::BaseModel>> \
|
||||||
Type##SType##BaseModel; \
|
Type##SType##BaseModel; \
|
||||||
|
|||||||
@ -46,6 +46,7 @@ SourceFiles
|
|||||||
#include "CompressibleTurbulenceModel.H"
|
#include "CompressibleTurbulenceModel.H"
|
||||||
#include "ThermalDiffusivity.H"
|
#include "ThermalDiffusivity.H"
|
||||||
#include "EddyDiffusivity.H"
|
#include "EddyDiffusivity.H"
|
||||||
|
#include "laminarModel.H"
|
||||||
#include "RASModel.H"
|
#include "RASModel.H"
|
||||||
#include "LESModel.H"
|
#include "LESModel.H"
|
||||||
#include "fluidThermo.H"
|
#include "fluidThermo.H"
|
||||||
@ -59,6 +60,7 @@ namespace Foam
|
|||||||
typedef ThermalDiffusivity<CompressibleTurbulenceModel<fluidThermo>>
|
typedef ThermalDiffusivity<CompressibleTurbulenceModel<fluidThermo>>
|
||||||
turbulenceModel;
|
turbulenceModel;
|
||||||
|
|
||||||
|
typedef laminarModel<turbulenceModel> laminarModel;
|
||||||
typedef RASModel<EddyDiffusivity<turbulenceModel>> RASModel;
|
typedef RASModel<EddyDiffusivity<turbulenceModel>> RASModel;
|
||||||
typedef LESModel<EddyDiffusivity<turbulenceModel>> LESModel;
|
typedef LESModel<EddyDiffusivity<turbulenceModel>> LESModel;
|
||||||
|
|
||||||
|
|||||||
@ -37,6 +37,18 @@ makeBaseTurbulenceModel
|
|||||||
fluidThermo
|
fluidThermo
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------------- //
|
||||||
|
// Laminar models
|
||||||
|
// -------------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
#include "Stokes.H"
|
||||||
|
makeLaminarModel(Stokes);
|
||||||
|
|
||||||
|
#include "Maxwell.H"
|
||||||
|
makeLaminarModel(Maxwell);
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// RAS models
|
// RAS models
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
|
|||||||
@ -32,7 +32,7 @@ License
|
|||||||
#include "ThermalDiffusivity.H"
|
#include "ThermalDiffusivity.H"
|
||||||
#include "EddyDiffusivity.H"
|
#include "EddyDiffusivity.H"
|
||||||
|
|
||||||
#include "laminar.H"
|
#include "laminarModel.H"
|
||||||
#include "RASModel.H"
|
#include "RASModel.H"
|
||||||
#include "LESModel.H"
|
#include "LESModel.H"
|
||||||
|
|
||||||
@ -48,6 +48,10 @@ makeTurbulenceModelTypes
|
|||||||
fluidThermo
|
fluidThermo
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#define makeLaminarModel(Type) \
|
||||||
|
makeTemplatedLaminarModel \
|
||||||
|
(fluidThermoCompressibleTurbulenceModel, laminar, Type)
|
||||||
|
|
||||||
#define makeRASModel(Type) \
|
#define makeRASModel(Type) \
|
||||||
makeTemplatedTurbulenceModel \
|
makeTemplatedTurbulenceModel \
|
||||||
(fluidThermoCompressibleTurbulenceModel, RAS, Type)
|
(fluidThermoCompressibleTurbulenceModel, RAS, Type)
|
||||||
|
|||||||
@ -44,6 +44,7 @@ SourceFiles
|
|||||||
#define turbulentTransportModel_H
|
#define turbulentTransportModel_H
|
||||||
|
|
||||||
#include "IncompressibleTurbulenceModel.H"
|
#include "IncompressibleTurbulenceModel.H"
|
||||||
|
#include "laminarModel.H"
|
||||||
#include "RASModel.H"
|
#include "RASModel.H"
|
||||||
#include "LESModel.H"
|
#include "LESModel.H"
|
||||||
#include "incompressible/transportModel/transportModel.H"
|
#include "incompressible/transportModel/transportModel.H"
|
||||||
@ -56,6 +57,7 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
typedef IncompressibleTurbulenceModel<transportModel> turbulenceModel;
|
typedef IncompressibleTurbulenceModel<transportModel> turbulenceModel;
|
||||||
|
|
||||||
|
typedef laminarModel<turbulenceModel> laminarModel;
|
||||||
typedef RASModel<turbulenceModel> RASModel;
|
typedef RASModel<turbulenceModel> RASModel;
|
||||||
typedef LESModel<turbulenceModel> LESModel;
|
typedef LESModel<turbulenceModel> LESModel;
|
||||||
|
|
||||||
|
|||||||
@ -36,6 +36,18 @@ makeBaseTurbulenceModel
|
|||||||
transportModel
|
transportModel
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------------- //
|
||||||
|
// Laminar models
|
||||||
|
// -------------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
#include "Stokes.H"
|
||||||
|
makeLaminarModel(Stokes);
|
||||||
|
|
||||||
|
#include "Maxwell.H"
|
||||||
|
makeLaminarModel(Maxwell);
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// RAS models
|
// RAS models
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
|
|||||||
@ -28,7 +28,7 @@ License
|
|||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "makeTurbulenceModel.H"
|
#include "makeTurbulenceModel.H"
|
||||||
|
|
||||||
#include "laminar.H"
|
#include "laminarModel.H"
|
||||||
#include "RASModel.H"
|
#include "RASModel.H"
|
||||||
#include "LESModel.H"
|
#include "LESModel.H"
|
||||||
|
|
||||||
@ -43,6 +43,10 @@ makeTurbulenceModelTypes
|
|||||||
transportModel
|
transportModel
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#define makeLaminarModel(Type) \
|
||||||
|
makeTemplatedTurbulenceModel \
|
||||||
|
(transportModelIncompressibleTurbulenceModel, laminar, Type)
|
||||||
|
|
||||||
#define makeRASModel(Type) \
|
#define makeRASModel(Type) \
|
||||||
makeTemplatedTurbulenceModel \
|
makeTemplatedTurbulenceModel \
|
||||||
(transportModelIncompressibleTurbulenceModel, RAS, Type)
|
(transportModelIncompressibleTurbulenceModel, RAS, Type)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -56,7 +56,7 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(p, iF),
|
fixedValueFvPatchScalarField(p, iF, dict, false),
|
||||||
atmBoundaryLayer(patch().Cf(), dict)
|
atmBoundaryLayer(patch().Cf(), dict)
|
||||||
{
|
{
|
||||||
scalarField::operator=(epsilon(patch().Cf()));
|
scalarField::operator=(epsilon(patch().Cf()));
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -56,7 +56,7 @@ atmBoundaryLayerInletKFvPatchScalarField
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(p, iF),
|
fixedValueFvPatchScalarField(p, iF, dict, false),
|
||||||
atmBoundaryLayer(patch().Cf(), dict)
|
atmBoundaryLayer(patch().Cf(), dict)
|
||||||
{
|
{
|
||||||
scalarField::operator=(k(patch().Cf()));
|
scalarField::operator=(k(patch().Cf()));
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -56,7 +56,7 @@ atmBoundaryLayerInletVelocityFvPatchVectorField
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchVectorField(p, iF),
|
fixedValueFvPatchVectorField(p, iF, dict, false),
|
||||||
atmBoundaryLayer(patch().Cf(), dict)
|
atmBoundaryLayer(patch().Cf(), dict)
|
||||||
{
|
{
|
||||||
vectorField::operator=(U(patch().Cf()));
|
vectorField::operator=(U(patch().Cf()));
|
||||||
|
|||||||
@ -50,7 +50,7 @@ Foam::fixedShearStressFvPatchVectorField::fixedShearStressFvPatchVectorField
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchVectorField(p, iF),
|
fixedValueFvPatchVectorField(p, iF, dict, false),
|
||||||
tau0_(dict.lookupOrDefault<vector>("tau", Zero))
|
tau0_(dict.lookupOrDefault<vector>("tau", Zero))
|
||||||
{
|
{
|
||||||
fvPatchField<vector>::operator=(patchInternalField());
|
fvPatchField<vector>::operator=(patchInternalField());
|
||||||
|
|||||||
240
src/TurbulenceModels/turbulenceModels/laminar/Maxwell/Maxwell.C
Normal file
240
src/TurbulenceModels/turbulenceModels/laminar/Maxwell/Maxwell.C
Normal file
@ -0,0 +1,240 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "Maxwell.H"
|
||||||
|
#include "fvOptions.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace laminarModels
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
Maxwell<BasicTurbulenceModel>::Maxwell
|
||||||
|
(
|
||||||
|
const alphaField& alpha,
|
||||||
|
const rhoField& rho,
|
||||||
|
const volVectorField& U,
|
||||||
|
const surfaceScalarField& alphaRhoPhi,
|
||||||
|
const surfaceScalarField& phi,
|
||||||
|
const transportModel& transport,
|
||||||
|
const word& propertiesName,
|
||||||
|
const word& type
|
||||||
|
)
|
||||||
|
:
|
||||||
|
laminarModel<BasicTurbulenceModel>
|
||||||
|
(
|
||||||
|
type,
|
||||||
|
alpha,
|
||||||
|
rho,
|
||||||
|
U,
|
||||||
|
alphaRhoPhi,
|
||||||
|
phi,
|
||||||
|
transport,
|
||||||
|
propertiesName
|
||||||
|
),
|
||||||
|
|
||||||
|
nuM_
|
||||||
|
(
|
||||||
|
dimensioned<scalar>
|
||||||
|
(
|
||||||
|
"nuM",
|
||||||
|
dimViscosity,
|
||||||
|
this->coeffDict_.lookup("nuM")
|
||||||
|
)
|
||||||
|
),
|
||||||
|
|
||||||
|
lambda_
|
||||||
|
(
|
||||||
|
dimensioned<scalar>
|
||||||
|
(
|
||||||
|
"lambda",
|
||||||
|
dimTime,
|
||||||
|
this->coeffDict_.lookup("lambda")
|
||||||
|
)
|
||||||
|
),
|
||||||
|
|
||||||
|
sigma_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
IOobject::groupName("sigma", U.group()),
|
||||||
|
this->runTime_.timeName(),
|
||||||
|
this->mesh_,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
this->mesh_
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (type == typeName)
|
||||||
|
{
|
||||||
|
this->printCoeffs(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
bool Maxwell<BasicTurbulenceModel>::read()
|
||||||
|
{
|
||||||
|
if (laminarModel<BasicTurbulenceModel>::read())
|
||||||
|
{
|
||||||
|
nuM_.readIfPresent(this->coeffDict());
|
||||||
|
lambda_.readIfPresent(this->coeffDict());
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
tmp<Foam::volSymmTensorField>
|
||||||
|
Maxwell<BasicTurbulenceModel>::R() const
|
||||||
|
{
|
||||||
|
return sigma_;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
tmp<Foam::volSymmTensorField>
|
||||||
|
Maxwell<BasicTurbulenceModel>::devRhoReff() const
|
||||||
|
{
|
||||||
|
return tmp<volSymmTensorField>
|
||||||
|
(
|
||||||
|
new volSymmTensorField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
IOobject::groupName("devRhoReff", this->U_.group()),
|
||||||
|
this->runTime_.timeName(),
|
||||||
|
this->mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
this->alpha_*this->rho_*sigma_
|
||||||
|
- (this->alpha_*this->rho_*this->nu())
|
||||||
|
*dev(twoSymm(fvc::grad(this->U_)))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
tmp<Foam::fvVectorMatrix>
|
||||||
|
Maxwell<BasicTurbulenceModel>::divDevRhoReff
|
||||||
|
(
|
||||||
|
volVectorField& U
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
(
|
||||||
|
fvc::div
|
||||||
|
(
|
||||||
|
this->alpha_*this->rho_*this->nuM_*fvc::grad(U)
|
||||||
|
)
|
||||||
|
+ fvc::div(this->alpha_*this->rho_*sigma_)
|
||||||
|
- fvc::div(this->alpha_*this->rho_*this->nu()*dev2(T(fvc::grad(U))))
|
||||||
|
- fvm::laplacian(this->alpha_*this->rho_*nu0(), U)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
tmp<Foam::fvVectorMatrix>
|
||||||
|
Maxwell<BasicTurbulenceModel>::divDevRhoReff
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
volVectorField& U
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
(
|
||||||
|
fvc::div
|
||||||
|
(
|
||||||
|
this->alpha_*rho*this->nuM_*fvc::grad(U)
|
||||||
|
)
|
||||||
|
+ fvc::div(this->alpha_*rho*sigma_)
|
||||||
|
- fvc::div(this->alpha_*rho*this->nu()*dev2(T(fvc::grad(U))))
|
||||||
|
- fvm::laplacian(this->alpha_*rho*nu0(), U)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
void Maxwell<BasicTurbulenceModel>::correct()
|
||||||
|
{
|
||||||
|
// Local references
|
||||||
|
const alphaField& alpha = this->alpha_;
|
||||||
|
const rhoField& rho = this->rho_;
|
||||||
|
const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_;
|
||||||
|
const volVectorField& U = this->U_;
|
||||||
|
volSymmTensorField& sigma = this->sigma_;
|
||||||
|
fv::options& fvOptions(fv::options::New(this->mesh_));
|
||||||
|
|
||||||
|
laminarModel<BasicTurbulenceModel>::correct();
|
||||||
|
|
||||||
|
tmp<volTensorField> tgradU(fvc::grad(U));
|
||||||
|
const volTensorField& gradU = tgradU();
|
||||||
|
dimensionedScalar rLambda = 1.0/(lambda_);
|
||||||
|
|
||||||
|
// Note sigma is positive on lhs of momentum eqn
|
||||||
|
volSymmTensorField P
|
||||||
|
(
|
||||||
|
twoSymm(sigma & gradU)
|
||||||
|
- nuM_*rLambda*twoSymm(gradU)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Viscoelastic stress equation
|
||||||
|
tmp<fvSymmTensorMatrix> sigmaEqn
|
||||||
|
(
|
||||||
|
fvm::ddt(alpha, rho, sigma)
|
||||||
|
+ fvm::div(alphaRhoPhi, sigma)
|
||||||
|
+ fvm::Sp(alpha*rho*rLambda, sigma)
|
||||||
|
==
|
||||||
|
alpha*rho*P
|
||||||
|
+ fvOptions(alpha, rho, sigma)
|
||||||
|
);
|
||||||
|
|
||||||
|
sigmaEqn.ref().relax();
|
||||||
|
fvOptions.constrain(sigmaEqn.ref());
|
||||||
|
solve(sigmaEqn);
|
||||||
|
fvOptions.correct(sigma_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace laminarModels
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
174
src/TurbulenceModels/turbulenceModels/laminar/Maxwell/Maxwell.H
Normal file
174
src/TurbulenceModels/turbulenceModels/laminar/Maxwell/Maxwell.H
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::laminarModels::Maxwell
|
||||||
|
|
||||||
|
Group
|
||||||
|
grpLaminar
|
||||||
|
|
||||||
|
Description
|
||||||
|
Maxwell model for viscoelasticity using the upper-convected time
|
||||||
|
derivative of the stress tensor.
|
||||||
|
See http://en.wikipedia.org/wiki/Upper-convected_Maxwell_model
|
||||||
|
|
||||||
|
The model includes an additional viscosity (nu) from the transport
|
||||||
|
model from which it is instantiated, which makes it equivalent to
|
||||||
|
the Oldroyd-B model for the case of an incompressible transport
|
||||||
|
model (where nu is non-zero).
|
||||||
|
See https://en.wikipedia.org/wiki/Oldroyd-B_model
|
||||||
|
|
||||||
|
Reference:
|
||||||
|
\verbatim
|
||||||
|
Amoreira, L. J., & Oliveira, P. J. (2010).
|
||||||
|
Comparison of different formulations for the numerical calculation
|
||||||
|
of unsteady incompressible viscoelastic fluid flow.
|
||||||
|
Adv. Appl. Math. Mech, 4, 483-502.
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
Maxwell.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef Maxwell_H
|
||||||
|
#define Maxwell_H
|
||||||
|
|
||||||
|
#include "laminarModel.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace laminarModels
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class Maxwell Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
class Maxwell
|
||||||
|
:
|
||||||
|
public laminarModel<BasicTurbulenceModel>
|
||||||
|
{
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
// Model coefficients
|
||||||
|
|
||||||
|
dimensionedScalar nuM_;
|
||||||
|
dimensionedScalar lambda_;
|
||||||
|
|
||||||
|
|
||||||
|
// Fields
|
||||||
|
|
||||||
|
volSymmTensorField sigma_;
|
||||||
|
|
||||||
|
|
||||||
|
// Protected Member Functions
|
||||||
|
|
||||||
|
//- Return the turbulence viscosity
|
||||||
|
tmp<volScalarField> nu0() const
|
||||||
|
{
|
||||||
|
return this->nu() + nuM_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
typedef typename BasicTurbulenceModel::alphaField alphaField;
|
||||||
|
typedef typename BasicTurbulenceModel::rhoField rhoField;
|
||||||
|
typedef typename BasicTurbulenceModel::transportModel transportModel;
|
||||||
|
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("Maxwell");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
Maxwell
|
||||||
|
(
|
||||||
|
const alphaField& alpha,
|
||||||
|
const rhoField& rho,
|
||||||
|
const volVectorField& U,
|
||||||
|
const surfaceScalarField& alphaRhoPhi,
|
||||||
|
const surfaceScalarField& phi,
|
||||||
|
const transportModel& transport,
|
||||||
|
const word& propertiesName = turbulenceModel::propertiesName,
|
||||||
|
const word& type = typeName
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~Maxwell()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Read model coefficients if they have changed
|
||||||
|
virtual bool read();
|
||||||
|
|
||||||
|
//- Return the Reynolds stress tensor
|
||||||
|
virtual tmp<volSymmTensorField> R() const;
|
||||||
|
|
||||||
|
//- Return the effective stress tensor
|
||||||
|
virtual tmp<volSymmTensorField> devRhoReff() const;
|
||||||
|
|
||||||
|
//- Return the source term for the momentum equation
|
||||||
|
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
|
||||||
|
|
||||||
|
//- Return the source term for the momentum equation
|
||||||
|
virtual tmp<fvVectorMatrix> divDevRhoReff
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
volVectorField& U
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Solve the turbulence equations and correct eddy-Viscosity and
|
||||||
|
// related properties
|
||||||
|
virtual void correct();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace laminarModels
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
#include "Maxwell.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -23,17 +23,24 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "laminar.H"
|
#include "Stokes.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "surfaceFields.H"
|
#include "surfaceFields.H"
|
||||||
#include "fvcGrad.H"
|
#include "fvcGrad.H"
|
||||||
#include "fvcDiv.H"
|
#include "fvcDiv.H"
|
||||||
#include "fvmLaplacian.H"
|
#include "fvmLaplacian.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace laminarModels
|
||||||
|
{
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
Foam::laminar<BasicTurbulenceModel>::laminar
|
Stokes<BasicTurbulenceModel>::Stokes
|
||||||
(
|
(
|
||||||
const alphaField& alpha,
|
const alphaField& alpha,
|
||||||
const rhoField& rho,
|
const rhoField& rho,
|
||||||
@ -44,7 +51,7 @@ Foam::laminar<BasicTurbulenceModel>::laminar
|
|||||||
const word& propertiesName
|
const word& propertiesName
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
linearViscousStress<BasicTurbulenceModel>
|
linearViscousStress<laminarModel<BasicTurbulenceModel>>
|
||||||
(
|
(
|
||||||
typeName,
|
typeName,
|
||||||
alpha,
|
alpha,
|
||||||
@ -58,57 +65,26 @@ Foam::laminar<BasicTurbulenceModel>::laminar
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class BasicTurbulenceModel>
|
|
||||||
Foam::autoPtr<Foam::laminar<BasicTurbulenceModel>>
|
|
||||||
Foam::laminar<BasicTurbulenceModel>::New
|
|
||||||
(
|
|
||||||
const alphaField& alpha,
|
|
||||||
const rhoField& rho,
|
|
||||||
const volVectorField& U,
|
|
||||||
const surfaceScalarField& alphaRhoPhi,
|
|
||||||
const surfaceScalarField& phi,
|
|
||||||
const transportModel& transport,
|
|
||||||
const word& propertiesName
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return autoPtr<laminar>
|
|
||||||
(
|
|
||||||
new laminar
|
|
||||||
(
|
|
||||||
alpha,
|
|
||||||
rho,
|
|
||||||
U,
|
|
||||||
alphaRhoPhi,
|
|
||||||
phi,
|
|
||||||
transport,
|
|
||||||
propertiesName
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
const Foam::dictionary&
|
const dictionary&
|
||||||
Foam::laminar<BasicTurbulenceModel>::coeffDict() const
|
Stokes<BasicTurbulenceModel>::coeffDict() const
|
||||||
{
|
{
|
||||||
return dictionary::null;
|
return dictionary::null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
bool Foam::laminar<BasicTurbulenceModel>::read()
|
bool Stokes<BasicTurbulenceModel>::read()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
Foam::tmp<Foam::volScalarField>
|
tmp<volScalarField>
|
||||||
Foam::laminar<BasicTurbulenceModel>::nut() const
|
Stokes<BasicTurbulenceModel>::nut() const
|
||||||
{
|
{
|
||||||
return tmp<volScalarField>
|
return tmp<volScalarField>
|
||||||
(
|
(
|
||||||
@ -131,8 +107,8 @@ Foam::laminar<BasicTurbulenceModel>::nut() const
|
|||||||
|
|
||||||
|
|
||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
Foam::tmp<Foam::scalarField>
|
tmp<scalarField>
|
||||||
Foam::laminar<BasicTurbulenceModel>::nut
|
Stokes<BasicTurbulenceModel>::nut
|
||||||
(
|
(
|
||||||
const label patchi
|
const label patchi
|
||||||
) const
|
) const
|
||||||
@ -145,8 +121,8 @@ Foam::laminar<BasicTurbulenceModel>::nut
|
|||||||
|
|
||||||
|
|
||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
Foam::tmp<Foam::volScalarField>
|
tmp<volScalarField>
|
||||||
Foam::laminar<BasicTurbulenceModel>::nuEff() const
|
Stokes<BasicTurbulenceModel>::nuEff() const
|
||||||
{
|
{
|
||||||
return tmp<volScalarField>
|
return tmp<volScalarField>
|
||||||
(
|
(
|
||||||
@ -159,8 +135,8 @@ Foam::laminar<BasicTurbulenceModel>::nuEff() const
|
|||||||
|
|
||||||
|
|
||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
Foam::tmp<Foam::scalarField>
|
tmp<scalarField>
|
||||||
Foam::laminar<BasicTurbulenceModel>::nuEff
|
Stokes<BasicTurbulenceModel>::nuEff
|
||||||
(
|
(
|
||||||
const label patchi
|
const label patchi
|
||||||
) const
|
) const
|
||||||
@ -170,8 +146,8 @@ Foam::laminar<BasicTurbulenceModel>::nuEff
|
|||||||
|
|
||||||
|
|
||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
Foam::tmp<Foam::volScalarField>
|
tmp<volScalarField>
|
||||||
Foam::laminar<BasicTurbulenceModel>::k() const
|
Stokes<BasicTurbulenceModel>::k() const
|
||||||
{
|
{
|
||||||
return tmp<volScalarField>
|
return tmp<volScalarField>
|
||||||
(
|
(
|
||||||
@ -194,8 +170,8 @@ Foam::laminar<BasicTurbulenceModel>::k() const
|
|||||||
|
|
||||||
|
|
||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
Foam::tmp<Foam::volScalarField>
|
tmp<volScalarField>
|
||||||
Foam::laminar<BasicTurbulenceModel>::epsilon() const
|
Stokes<BasicTurbulenceModel>::epsilon() const
|
||||||
{
|
{
|
||||||
return tmp<volScalarField>
|
return tmp<volScalarField>
|
||||||
(
|
(
|
||||||
@ -221,8 +197,8 @@ Foam::laminar<BasicTurbulenceModel>::epsilon() const
|
|||||||
|
|
||||||
|
|
||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
Foam::tmp<Foam::volSymmTensorField>
|
tmp<volSymmTensorField>
|
||||||
Foam::laminar<BasicTurbulenceModel>::R() const
|
Stokes<BasicTurbulenceModel>::R() const
|
||||||
{
|
{
|
||||||
return tmp<volSymmTensorField>
|
return tmp<volSymmTensorField>
|
||||||
(
|
(
|
||||||
@ -248,10 +224,15 @@ Foam::laminar<BasicTurbulenceModel>::R() const
|
|||||||
|
|
||||||
|
|
||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
void Foam::laminar<BasicTurbulenceModel>::correct()
|
void Stokes<BasicTurbulenceModel>::correct()
|
||||||
{
|
{
|
||||||
BasicTurbulenceModel::correct();
|
laminarModel<BasicTurbulenceModel>::correct();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace laminarModels
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -22,34 +22,37 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::laminar
|
Foam::Stokes
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Turbulence model for laminar flow.
|
Turbulence model for Stokes flow.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
laminar.C
|
Stokes.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef laminar_H
|
#ifndef Stokes_H
|
||||||
#define laminar_H
|
#define Stokes_H
|
||||||
|
|
||||||
|
#include "laminarModel.H"
|
||||||
#include "linearViscousStress.H"
|
#include "linearViscousStress.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
namespace laminarModels
|
||||||
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------* \
|
/*---------------------------------------------------------------------------* \
|
||||||
Class laminar Declaration
|
Class Stokes Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
class laminar
|
class Stokes
|
||||||
:
|
:
|
||||||
public linearViscousStress<BasicTurbulenceModel>
|
public linearViscousStress<laminarModel<BasicTurbulenceModel>>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -60,13 +63,13 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("laminar");
|
TypeName("Stokes");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
laminar
|
Stokes
|
||||||
(
|
(
|
||||||
const alphaField& alpha,
|
const alphaField& alpha,
|
||||||
const rhoField& rho,
|
const rhoField& rho,
|
||||||
@ -81,7 +84,7 @@ public:
|
|||||||
// Selectors
|
// Selectors
|
||||||
|
|
||||||
//- Return a reference to the selected turbulence model
|
//- Return a reference to the selected turbulence model
|
||||||
static autoPtr<laminar> New
|
static autoPtr<Stokes> New
|
||||||
(
|
(
|
||||||
const alphaField& alpha,
|
const alphaField& alpha,
|
||||||
const rhoField& rho,
|
const rhoField& rho,
|
||||||
@ -94,7 +97,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~laminar()
|
virtual ~Stokes()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -106,41 +109,42 @@ public:
|
|||||||
//- Read turbulenceProperties dictionary
|
//- Read turbulenceProperties dictionary
|
||||||
virtual bool read();
|
virtual bool read();
|
||||||
|
|
||||||
//- Return the turbulence viscosity, i.e. 0 for laminar flow
|
//- Return the turbulence viscosity, i.e. 0 for Stokes flow
|
||||||
virtual tmp<volScalarField> nut() const;
|
virtual tmp<volScalarField> nut() const;
|
||||||
|
|
||||||
//- Return the turbulence viscosity on patch
|
//- Return the turbulence viscosity on patch
|
||||||
virtual tmp<scalarField> nut(const label patchi) const;
|
virtual tmp<scalarField> nut(const label patchi) const;
|
||||||
|
|
||||||
//- Return the effective viscosity, i.e. the laminar viscosity
|
//- Return the effective viscosity, i.e. the Stokes viscosity
|
||||||
virtual tmp<volScalarField> nuEff() const;
|
virtual tmp<volScalarField> nuEff() const;
|
||||||
|
|
||||||
//- Return the effective viscosity on patch
|
//- Return the effective viscosity on patch
|
||||||
virtual tmp<scalarField> nuEff(const label patchi) const;
|
virtual tmp<scalarField> nuEff(const label patchi) const;
|
||||||
|
|
||||||
//- Return the turbulence kinetic energy, i.e. 0 for laminar flow
|
//- Return the turbulence kinetic energy, i.e. 0 for Stokes flow
|
||||||
virtual tmp<volScalarField> k() const;
|
virtual tmp<volScalarField> k() const;
|
||||||
|
|
||||||
//- Return the turbulence kinetic energy dissipation rate,
|
//- Return the turbulence kinetic energy dissipation rate,
|
||||||
// i.e. 0 for laminar flow
|
// i.e. 0 for Stokes flow
|
||||||
virtual tmp<volScalarField> epsilon() const;
|
virtual tmp<volScalarField> epsilon() const;
|
||||||
|
|
||||||
//- Return the Reynolds stress tensor, i.e. 0 for laminar flow
|
//- Return the Reynolds stress tensor, i.e. 0 for Stokes flow
|
||||||
virtual tmp<volSymmTensorField> R() const;
|
virtual tmp<volSymmTensorField> R() const;
|
||||||
|
|
||||||
//- Correct the laminar viscosity
|
//- Correct the Stokes viscosity
|
||||||
virtual void correct();
|
virtual void correct();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace laminarModels
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#ifdef NoRepository
|
#ifdef NoRepository
|
||||||
#include "laminar.C"
|
#include "Stokes.C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -0,0 +1,339 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "laminarModel.H"
|
||||||
|
#include "Stokes.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
void Foam::laminarModel<BasicTurbulenceModel>::printCoeffs(const word& type)
|
||||||
|
{
|
||||||
|
if (printCoeffs_)
|
||||||
|
{
|
||||||
|
Info<< type << "Coeffs" << coeffDict_ << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
Foam::laminarModel<BasicTurbulenceModel>::laminarModel
|
||||||
|
(
|
||||||
|
const word& type,
|
||||||
|
const alphaField& alpha,
|
||||||
|
const rhoField& rho,
|
||||||
|
const volVectorField& U,
|
||||||
|
const surfaceScalarField& alphaRhoPhi,
|
||||||
|
const surfaceScalarField& phi,
|
||||||
|
const transportModel& transport,
|
||||||
|
const word& propertiesName
|
||||||
|
)
|
||||||
|
:
|
||||||
|
BasicTurbulenceModel
|
||||||
|
(
|
||||||
|
type,
|
||||||
|
alpha,
|
||||||
|
rho,
|
||||||
|
U,
|
||||||
|
alphaRhoPhi,
|
||||||
|
phi,
|
||||||
|
transport,
|
||||||
|
propertiesName
|
||||||
|
),
|
||||||
|
|
||||||
|
laminarDict_(this->subOrEmptyDict("laminar")),
|
||||||
|
printCoeffs_(laminarDict_.lookupOrDefault<Switch>("printCoeffs", false)),
|
||||||
|
coeffDict_(laminarDict_.subOrEmptyDict(type + "Coeffs"))
|
||||||
|
{
|
||||||
|
// Force the construction of the mesh deltaCoeffs which may be needed
|
||||||
|
// for the construction of the derived models and BCs
|
||||||
|
this->mesh_.deltaCoeffs();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
Foam::autoPtr<Foam::laminarModel<BasicTurbulenceModel>>
|
||||||
|
Foam::laminarModel<BasicTurbulenceModel>::New
|
||||||
|
(
|
||||||
|
const alphaField& alpha,
|
||||||
|
const rhoField& rho,
|
||||||
|
const volVectorField& U,
|
||||||
|
const surfaceScalarField& alphaRhoPhi,
|
||||||
|
const surfaceScalarField& phi,
|
||||||
|
const transportModel& transport,
|
||||||
|
const word& propertiesName
|
||||||
|
)
|
||||||
|
{
|
||||||
|
IOdictionary modelDict
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
IOobject::groupName(propertiesName, U.group()),
|
||||||
|
U.time().constant(),
|
||||||
|
U.db(),
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (modelDict.found("laminar"))
|
||||||
|
{
|
||||||
|
// get model name, but do not register the dictionary
|
||||||
|
// otherwise it is registered in the database twice
|
||||||
|
const word modelType
|
||||||
|
(
|
||||||
|
modelDict.subDict("laminar").lookup("laminarModel")
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< "Selecting laminar stress model " << modelType << endl;
|
||||||
|
|
||||||
|
typename dictionaryConstructorTable::iterator cstrIter =
|
||||||
|
dictionaryConstructorTablePtr_->find(modelType);
|
||||||
|
|
||||||
|
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Unknown laminarModel type "
|
||||||
|
<< modelType << nl << nl
|
||||||
|
<< "Valid laminarModel types:" << endl
|
||||||
|
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return autoPtr<laminarModel>
|
||||||
|
(
|
||||||
|
cstrIter()
|
||||||
|
(
|
||||||
|
alpha,
|
||||||
|
rho,
|
||||||
|
U,
|
||||||
|
alphaRhoPhi,
|
||||||
|
phi,
|
||||||
|
transport, propertiesName)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info<< "Selecting laminar stress model "
|
||||||
|
<< laminarModels::Stokes<BasicTurbulenceModel>::typeName << endl;
|
||||||
|
|
||||||
|
return autoPtr<laminarModel>
|
||||||
|
(
|
||||||
|
new laminarModels::Stokes<BasicTurbulenceModel>
|
||||||
|
(
|
||||||
|
alpha,
|
||||||
|
rho,
|
||||||
|
U,
|
||||||
|
alphaRhoPhi,
|
||||||
|
phi,
|
||||||
|
transport,
|
||||||
|
propertiesName
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
bool Foam::laminarModel<BasicTurbulenceModel>::read()
|
||||||
|
{
|
||||||
|
if (BasicTurbulenceModel::read())
|
||||||
|
{
|
||||||
|
laminarDict_ <<= this->subDict("laminar");
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
const dictionary* dictPtr =
|
||||||
|
laminarDict_.subDictPtr(type() + "Coeffs")
|
||||||
|
)
|
||||||
|
{
|
||||||
|
coeffDict_ <<= *dictPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::laminarModel<BasicTurbulenceModel>::nut() const
|
||||||
|
{
|
||||||
|
return tmp<volScalarField>
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
IOobject::groupName("nut", this->U_.group()),
|
||||||
|
this->runTime_.timeName(),
|
||||||
|
this->mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
this->mesh_,
|
||||||
|
dimensionedScalar("nut", dimViscosity, 0.0)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::laminarModel<BasicTurbulenceModel>::nut
|
||||||
|
(
|
||||||
|
const label patchi
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>
|
||||||
|
(
|
||||||
|
new scalarField(this->mesh_.boundary()[patchi].size(), 0.0)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::laminarModel<BasicTurbulenceModel>::nuEff() const
|
||||||
|
{
|
||||||
|
return tmp<volScalarField>
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject::groupName("nuEff", this->U_.group()), this->nu()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::laminarModel<BasicTurbulenceModel>::nuEff
|
||||||
|
(
|
||||||
|
const label patchi
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return this->nu(patchi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::laminarModel<BasicTurbulenceModel>::k() const
|
||||||
|
{
|
||||||
|
return tmp<volScalarField>
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
IOobject::groupName("k", this->U_.group()),
|
||||||
|
this->runTime_.timeName(),
|
||||||
|
this->mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
this->mesh_,
|
||||||
|
dimensionedScalar("k", sqr(this->U_.dimensions()), 0.0)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::laminarModel<BasicTurbulenceModel>::epsilon() const
|
||||||
|
{
|
||||||
|
return tmp<volScalarField>
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
IOobject::groupName("epsilon", this->U_.group()),
|
||||||
|
this->runTime_.timeName(),
|
||||||
|
this->mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
this->mesh_,
|
||||||
|
dimensionedScalar
|
||||||
|
(
|
||||||
|
"epsilon", sqr(this->U_.dimensions())/dimTime, 0.0
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
Foam::tmp<Foam::volSymmTensorField>
|
||||||
|
Foam::laminarModel<BasicTurbulenceModel>::R() const
|
||||||
|
{
|
||||||
|
return tmp<volSymmTensorField>
|
||||||
|
(
|
||||||
|
new volSymmTensorField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
IOobject::groupName("R", this->U_.group()),
|
||||||
|
this->runTime_.timeName(),
|
||||||
|
this->mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
this->mesh_,
|
||||||
|
dimensionedSymmTensor
|
||||||
|
(
|
||||||
|
"R", sqr(this->U_.dimensions()), Zero
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
void Foam::laminarModel<BasicTurbulenceModel>::correct()
|
||||||
|
{
|
||||||
|
BasicTurbulenceModel::correct();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,208 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::laminarModel
|
||||||
|
|
||||||
|
Description
|
||||||
|
Templated abstract base class for laminar transport models
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
laminarModel.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef laminarModel_H
|
||||||
|
#define laminarModel_H
|
||||||
|
|
||||||
|
#include "TurbulenceModel.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class laminarModel Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class BasicTurbulenceModel>
|
||||||
|
class laminarModel
|
||||||
|
:
|
||||||
|
public BasicTurbulenceModel
|
||||||
|
{
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
//- laminar coefficients dictionary
|
||||||
|
dictionary laminarDict_;
|
||||||
|
|
||||||
|
//- Flag to print the model coeffs at run-time
|
||||||
|
Switch printCoeffs_;
|
||||||
|
|
||||||
|
//- Model coefficients dictionary
|
||||||
|
dictionary coeffDict_;
|
||||||
|
|
||||||
|
|
||||||
|
// Protected Member Functions
|
||||||
|
|
||||||
|
//- Print model coefficients
|
||||||
|
virtual void printCoeffs(const word& type);
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
laminarModel(const laminarModel&);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const laminarModel&);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
typedef typename BasicTurbulenceModel::alphaField alphaField;
|
||||||
|
typedef typename BasicTurbulenceModel::rhoField rhoField;
|
||||||
|
typedef typename BasicTurbulenceModel::transportModel transportModel;
|
||||||
|
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("laminar");
|
||||||
|
|
||||||
|
|
||||||
|
// Declare run-time constructor selection table
|
||||||
|
|
||||||
|
declareRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
autoPtr,
|
||||||
|
laminarModel,
|
||||||
|
dictionary,
|
||||||
|
(
|
||||||
|
const alphaField& alpha,
|
||||||
|
const rhoField& rho,
|
||||||
|
const volVectorField& U,
|
||||||
|
const surfaceScalarField& alphaRhoPhi,
|
||||||
|
const surfaceScalarField& phi,
|
||||||
|
const transportModel& transport,
|
||||||
|
const word& propertiesName
|
||||||
|
),
|
||||||
|
(alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
laminarModel
|
||||||
|
(
|
||||||
|
const word& type,
|
||||||
|
const alphaField& alpha,
|
||||||
|
const rhoField& rho,
|
||||||
|
const volVectorField& U,
|
||||||
|
const surfaceScalarField& alphaRhoPhi,
|
||||||
|
const surfaceScalarField& phi,
|
||||||
|
const transportModel& transport,
|
||||||
|
const word& propertiesName
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Selectors
|
||||||
|
|
||||||
|
//- Return a reference to the selected laminar model
|
||||||
|
static autoPtr<laminarModel> New
|
||||||
|
(
|
||||||
|
const alphaField& alpha,
|
||||||
|
const rhoField& rho,
|
||||||
|
const volVectorField& U,
|
||||||
|
const surfaceScalarField& alphaRhoPhi,
|
||||||
|
const surfaceScalarField& phi,
|
||||||
|
const transportModel& transport,
|
||||||
|
const word& propertiesName = turbulenceModel::propertiesName
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~laminarModel()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Read model coefficients if they have changed
|
||||||
|
virtual bool read();
|
||||||
|
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Const access to the coefficients dictionary
|
||||||
|
virtual const dictionary& coeffDict() const
|
||||||
|
{
|
||||||
|
return coeffDict_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return the turbulence viscosity, i.e. 0 for laminar flow
|
||||||
|
virtual tmp<volScalarField> nut() const;
|
||||||
|
|
||||||
|
//- Return the turbulence viscosity on patch
|
||||||
|
virtual tmp<scalarField> nut(const label patchi) const;
|
||||||
|
|
||||||
|
//- Return the effective viscosity, i.e. the laminar viscosity
|
||||||
|
virtual tmp<volScalarField> nuEff() const;
|
||||||
|
|
||||||
|
//- Return the effective viscosity on patch
|
||||||
|
virtual tmp<scalarField> nuEff(const label patchi) const;
|
||||||
|
|
||||||
|
//- Return the turbulence kinetic energy, i.e. 0 for laminar flow
|
||||||
|
virtual tmp<volScalarField> k() const;
|
||||||
|
|
||||||
|
//- Return the turbulence kinetic energy dissipation rate,
|
||||||
|
// i.e. 0 for laminar flow
|
||||||
|
virtual tmp<volScalarField> epsilon() const;
|
||||||
|
|
||||||
|
//- Return the Reynolds stress tensor, i.e. 0 for laminar flow
|
||||||
|
virtual tmp<volSymmTensorField> R() const;
|
||||||
|
|
||||||
|
//- Correct the laminar transport
|
||||||
|
virtual void correct();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
#include "laminarModel.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
\defgroup grpLaminar laminar transport model
|
||||||
|
@{
|
||||||
|
\ingroup grpTurbulence
|
||||||
|
This group contains laminar models.
|
||||||
|
@}
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -28,7 +28,8 @@ License
|
|||||||
namespace Foam \
|
namespace Foam \
|
||||||
{ \
|
{ \
|
||||||
typedef BaseModel<Transport> Transport##BaseModel; \
|
typedef BaseModel<Transport> Transport##BaseModel; \
|
||||||
typedef laminar<Transport##BaseModel> Laminar##Transport##BaseModel; \
|
typedef laminarModel<Transport##BaseModel> \
|
||||||
|
laminar##Transport##BaseModel; \
|
||||||
typedef RASModel<Transport##BaseModel> RAS##Transport##BaseModel; \
|
typedef RASModel<Transport##BaseModel> RAS##Transport##BaseModel; \
|
||||||
typedef LESModel<Transport##BaseModel> LES##Transport##BaseModel; \
|
typedef LESModel<Transport##BaseModel> LES##Transport##BaseModel; \
|
||||||
}
|
}
|
||||||
@ -53,12 +54,15 @@ License
|
|||||||
); \
|
); \
|
||||||
\
|
\
|
||||||
\
|
\
|
||||||
defineNamedTemplateTypeNameAndDebug(Laminar##Transport##BaseModel, 0); \
|
defineNamedTemplateTypeNameAndDebug(laminar##Transport##BaseModel, 0); \
|
||||||
|
\
|
||||||
|
defineTemplateRunTimeSelectionTable \
|
||||||
|
(laminar##Transport##BaseModel, dictionary); \
|
||||||
\
|
\
|
||||||
addToRunTimeSelectionTable \
|
addToRunTimeSelectionTable \
|
||||||
( \
|
( \
|
||||||
Transport##baseModel, \
|
Transport##baseModel, \
|
||||||
Laminar##Transport##BaseModel, \
|
laminar##Transport##BaseModel, \
|
||||||
dictionary \
|
dictionary \
|
||||||
); \
|
); \
|
||||||
\
|
\
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -36,32 +36,6 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::reactionRateFlameArea::reactionRateFlameArea
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const combustionModel& combModel
|
|
||||||
)
|
|
||||||
:
|
|
||||||
coeffDict_(dictionary::null),
|
|
||||||
mesh_(mesh),
|
|
||||||
combModel_(combModel),
|
|
||||||
fuel_(dict.lookup("fuel")),
|
|
||||||
omega_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"omega",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh_
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::reactionRateFlameArea::reactionRateFlameArea
|
Foam::reactionRateFlameArea::reactionRateFlameArea
|
||||||
(
|
(
|
||||||
const word& modelType,
|
const word& modelType,
|
||||||
@ -78,7 +52,7 @@ Foam::reactionRateFlameArea::reactionRateFlameArea
|
|||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"omega",
|
"FSDomega",
|
||||||
mesh_.time().timeName(),
|
mesh_.time().timeName(),
|
||||||
mesh_,
|
mesh_,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -111,14 +111,6 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from dictionary and psiReactionThermo
|
|
||||||
reactionRateFlameArea
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const combustionModel& combModel
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
reactionRateFlameArea
|
reactionRateFlameArea
|
||||||
(
|
(
|
||||||
@ -160,7 +152,6 @@ public:
|
|||||||
|
|
||||||
//- Update from dictionary
|
//- Update from dictionary
|
||||||
virtual bool read(const dictionary& dictProperties);
|
virtual bool read(const dictionary& dictProperties);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -123,20 +123,21 @@ void Foam::reactionRateFlameAreaModels::relaxation::correct
|
|||||||
/(sqr(omega0 - omegaInf) + sqr(omegaMin))
|
/(sqr(omega0 - omegaInf) + sqr(omegaMin))
|
||||||
);
|
);
|
||||||
|
|
||||||
tmp<surfaceScalarField> phi(combModel_.phi());
|
const volScalarField& rho = combModel_.rho();
|
||||||
|
const tmp<surfaceScalarField> tphi = combModel_.phi();
|
||||||
|
const surfaceScalarField& phi = tphi();
|
||||||
|
|
||||||
solve
|
solve
|
||||||
(
|
(
|
||||||
fvm::ddt(omega_)
|
fvm::ddt(rho, omega_)
|
||||||
+ fvm::div(phi, omega_, "div(phi,omega)")
|
+ fvm::div(phi, omega_)
|
||||||
==
|
==
|
||||||
Rc*omega0
|
rho*Rc*omega0
|
||||||
- fvm::SuSp((tau + Rc), omega_)
|
- fvm::SuSp(rho*(tau + Rc), omega_)
|
||||||
);
|
);
|
||||||
|
|
||||||
omega_.min(omega0);
|
omega_.min(omega0);
|
||||||
omega_.max(0.0);
|
omega_.max(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -114,20 +114,17 @@ public:
|
|||||||
//- Return const access to the mesh database
|
//- Return const access to the mesh database
|
||||||
inline const fvMesh& mesh() const;
|
inline const fvMesh& mesh() const;
|
||||||
|
|
||||||
//- Return const access to phi
|
//- Set turbulence
|
||||||
inline tmp<surfaceScalarField> phi() const;
|
inline void setTurbulence(compressibleTurbulenceModel& turbModel);
|
||||||
|
|
||||||
//- Returns rho
|
|
||||||
virtual tmp<volScalarField> rho() const = 0;
|
|
||||||
|
|
||||||
//- Return access to turbulence
|
//- Return access to turbulence
|
||||||
inline const compressibleTurbulenceModel& turbulence() const;
|
inline const compressibleTurbulenceModel& turbulence() const;
|
||||||
|
|
||||||
//- Set turbulence
|
//- Return const access to rho
|
||||||
inline void setTurbulence
|
inline const volScalarField& rho() const;
|
||||||
(
|
|
||||||
compressibleTurbulenceModel& turbModel
|
//- Return const access to phi
|
||||||
);
|
inline tmp<surfaceScalarField> phi() const;
|
||||||
|
|
||||||
//- Is combustion active?
|
//- Is combustion active?
|
||||||
inline const Switch& active() const;
|
inline const Switch& active() const;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -31,42 +31,31 @@ inline const Foam::fvMesh& Foam::combustionModel::mesh() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::tmp<Foam::surfaceScalarField> Foam::combustionModel::phi() const
|
inline const Foam::compressibleTurbulenceModel&
|
||||||
|
Foam::combustionModel::turbulence() const
|
||||||
{
|
{
|
||||||
if (turbulencePtr_)
|
if (!turbulencePtr_)
|
||||||
{
|
|
||||||
return turbulencePtr_->phi();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "turbulencePtr_ is empty. Please use "
|
<< "turbulencePtr_ is empty. Please use "
|
||||||
<< "combustionModel::setTurbulence "
|
<< "combustionModel::setTurbulence "
|
||||||
<< "(compressibleTurbulenceModel&)"
|
<< "(compressibleTurbulenceModel&)"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
|
|
||||||
return turbulencePtr_->phi();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return *turbulencePtr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::compressibleTurbulenceModel&
|
inline const Foam::volScalarField& Foam::combustionModel::rho() const
|
||||||
Foam::combustionModel::turbulence() const
|
|
||||||
{
|
{
|
||||||
if (turbulencePtr_)
|
return turbulence().rho();
|
||||||
{
|
}
|
||||||
return *turbulencePtr_;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "turbulencePtr_ is empty. Please use "
|
|
||||||
<< "combustionModel::setTurbulence "
|
|
||||||
<< "(compressibleTurbulenceModel& )"
|
|
||||||
<< abort(FatalError);
|
|
||||||
|
|
||||||
return *turbulencePtr_;
|
|
||||||
}
|
inline Foam::tmp<Foam::surfaceScalarField> Foam::combustionModel::phi() const
|
||||||
|
{
|
||||||
|
return turbulence().alphaRhoPhi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -61,11 +61,4 @@ Foam::combustionModels::psiChemistryCombustion::thermo() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::combustionModels::psiChemistryCombustion::rho() const
|
|
||||||
{
|
|
||||||
return chemistryPtr_->thermo().rho();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -95,9 +95,6 @@ public:
|
|||||||
|
|
||||||
//- Return const access to the thermo package
|
//- Return const access to the thermo package
|
||||||
virtual const psiReactionThermo& thermo() const;
|
virtual const psiReactionThermo& thermo() const;
|
||||||
|
|
||||||
//- Return const access to the density field
|
|
||||||
virtual tmp<volScalarField> rho() const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -120,9 +120,6 @@ public:
|
|||||||
//- Return const access to the thermo package
|
//- Return const access to the thermo package
|
||||||
virtual const psiReactionThermo& thermo() const = 0;
|
virtual const psiReactionThermo& thermo() const = 0;
|
||||||
|
|
||||||
//- Return tmp of rho
|
|
||||||
virtual tmp<volScalarField> rho() const = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// IO
|
// IO
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -61,11 +61,4 @@ Foam::combustionModels::psiThermoCombustion::thermo() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::combustionModels::psiThermoCombustion::rho() const
|
|
||||||
{
|
|
||||||
return thermoPtr_->rho();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -95,9 +95,6 @@ public:
|
|||||||
|
|
||||||
//- Return const access to the thermo package
|
//- Return const access to the thermo package
|
||||||
virtual const psiReactionThermo& thermo() const;
|
virtual const psiReactionThermo& thermo() const;
|
||||||
|
|
||||||
//- Return const access to the density field
|
|
||||||
virtual tmp<volScalarField> rho() const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -61,11 +61,4 @@ Foam::combustionModels::rhoChemistryCombustion::thermo() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::combustionModels::rhoChemistryCombustion::rho() const
|
|
||||||
{
|
|
||||||
return chemistryPtr_->thermo().rho();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user