Compare commits
2 Commits
OpenFOAM-v
...
feature-sp
| Author | SHA1 | Date | |
|---|---|---|---|
| 0503f66c90 | |||
| 25ff1d7d6f |
@ -49,7 +49,7 @@
|
||||
|
||||
<!--
|
||||
Providing details of your set-up can help us identify any issues, e.g.
|
||||
OpenFOAM version : v2206|v2112|v2106|v2012|v2006 etc
|
||||
OpenFOAM version : v2112|v2106|v2012|v2006|v1912|v1906 etc
|
||||
Operating system : ubuntu|openSUSE|centos etc
|
||||
Hardware info : any info that may help?
|
||||
Compiler : gcc|intel|clang etc
|
||||
|
||||
2
Allwmake
2
Allwmake
@ -37,7 +37,7 @@ echo
|
||||
echo ========================================
|
||||
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
|
||||
echo "Starting compile ${WM_PROJECT_DIR##*/} ${0##*/}"
|
||||
echo " $WM_COMPILER ${WM_COMPILER_TYPE:-system} compiler [${WM_COMPILE_CONTROL}]"
|
||||
echo " $WM_COMPILER ${WM_COMPILER_TYPE:-system} compiler"
|
||||
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
|
||||
echo ========================================
|
||||
echo
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
api=2206
|
||||
api=2112
|
||||
patch=0
|
||||
|
||||
16
README.md
16
README.md
@ -40,9 +40,9 @@ Violations of the Trademark are monitored, and will be duly prosecuted.
|
||||
|
||||
If OpenFOAM has already been compiled on your system, simply source
|
||||
the appropriate `etc/bashrc` or `etc/cshrc` file and get started.
|
||||
For example, for the OpenFOAM-v2206 version:
|
||||
For example, for the OpenFOAM-v2112 version:
|
||||
```
|
||||
source /installation/path/OpenFOAM-v2206/etc/bashrc
|
||||
source /installation/path/OpenFOAM-v2112/etc/bashrc
|
||||
```
|
||||
|
||||
## Compiling OpenFOAM
|
||||
@ -127,8 +127,8 @@ These 3rd-party sources are normally located in a directory parallel
|
||||
to the OpenFOAM directory. For example,
|
||||
```
|
||||
/path/parent
|
||||
|-- OpenFOAM-v2206
|
||||
\-- ThirdParty-v2206
|
||||
|-- OpenFOAM-v2112
|
||||
\-- ThirdParty-v2112
|
||||
```
|
||||
There are, however, many cases where this simple convention is inadequate:
|
||||
|
||||
@ -136,7 +136,7 @@ There are, however, many cases where this simple convention is inadequate:
|
||||
operating system or cluster installation provides it)
|
||||
|
||||
* When we have changed the OpenFOAM directory name to some arbitrary
|
||||
directory name, e.g. openfoam-sandbox2206, etc..
|
||||
directory name, e.g. openfoam-sandbox2112, etc..
|
||||
|
||||
* When we would like any additional 3rd party software to be located
|
||||
inside of the OpenFOAM directory to ensure that the installation is
|
||||
@ -156,9 +156,9 @@ when locating the ThirdParty directory with the following precedence:
|
||||
2. PREFIX/ThirdParty-VERSION
|
||||
* this corresponds to the traditional approach
|
||||
3. PREFIX/ThirdParty-vAPI
|
||||
* allows for an updated value of VERSION, *eg*, `v2206-myCustom`,
|
||||
* allows for an updated value of VERSION, *eg*, `v2112-myCustom`,
|
||||
without requiring a renamed ThirdParty. The API value would still
|
||||
be `2206` and the original `ThirdParty-v2206/` would be found.
|
||||
be `2112` and the original `ThirdParty-v2112/` would be found.
|
||||
4. PREFIX/ThirdParty-API
|
||||
* same as the previous example, but using an unadorned API value.
|
||||
5. PREFIX/ThirdParty-common
|
||||
@ -213,4 +213,4 @@ ThirdParty directory will contain either an `Allwmake` file or a
|
||||
- [Governance](http://www.openfoam.com/governance/), [Governance Projects](https://www.openfoam.com/governance/projects)
|
||||
- [Contacting OpenCFD](http://www.openfoam.com/contact/)
|
||||
|
||||
Copyright 2016-2022 OpenCFD Ltd
|
||||
Copyright 2016-2021 OpenCFD Ltd
|
||||
|
||||
@ -21,10 +21,10 @@ echo ========================================
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake -all $targetType utilities
|
||||
wmake -all $targetType solvers
|
||||
wmake -all $targetType utilities
|
||||
|
||||
# Extra tools (optional)
|
||||
# Optional
|
||||
## wmake -all $targetType tools
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -25,7 +25,6 @@ EXE_LIBS = \
|
||||
-lengine \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lreactionThermophysicalModels \
|
||||
|
||||
@ -19,7 +19,6 @@ EXE_LIBS = \
|
||||
-lengine \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lreactionThermophysicalModels \
|
||||
|
||||
@ -26,7 +26,6 @@ EXE_LIBS = \
|
||||
-lengine \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lreactionThermophysicalModels \
|
||||
|
||||
@ -20,7 +20,6 @@ EXE_LIBS = \
|
||||
-lengine \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lreactionThermophysicalModels \
|
||||
|
||||
@ -20,7 +20,6 @@ EXE_LIBS = \
|
||||
-lengine \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lspecie
|
||||
|
||||
@ -34,7 +34,6 @@ EXE_LIBS = \
|
||||
-lsampling \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lspecie \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
const volScalarField& psi = thermo.psi();
|
||||
const volScalarField& T = thermo.T();
|
||||
regionModels::surfaceFilmModel& surfaceFilm = tsurfaceFilm();
|
||||
const label inertIndex(composition.species().find(inertSpecie));
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
|
||||
@ -19,7 +19,6 @@ EXE_LIBS = \
|
||||
-lsampling \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lreactionThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleTransportModels \
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
const volScalarField& psi = thermo.psi();
|
||||
const volScalarField& T = thermo.T();
|
||||
const label inertIndex(composition.species().find(inertSpecie));
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
|
||||
@ -20,7 +20,6 @@ EXE_LIBS = \
|
||||
-lsampling \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lreactionThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleTransportModels \
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
const volScalarField& psi = thermo.psi();
|
||||
const volScalarField& T = thermo.T();
|
||||
const label inertIndex(composition.species().find(inertSpecie));
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
|
||||
@ -20,7 +20,6 @@ EXE_LIBS = \
|
||||
-lsampling \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lreactionThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleTransportModels \
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
const volScalarField& psi = thermo.psi();
|
||||
const volScalarField& T = thermo.T();
|
||||
const label inertIndex(composition.species().find(inertSpecie));
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
|
||||
@ -19,6 +19,5 @@ EXE_LIBS = \
|
||||
-lrhoCentralFoam \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-ldynamicFvMesh \
|
||||
-ltopoChangerFvMesh
|
||||
|
||||
@ -6,7 +6,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
@ -17,5 +17,4 @@ EXE_LIBS = \
|
||||
-lfluidThermophysicalModels \
|
||||
-lspecie \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools
|
||||
-lcompressibleTurbulenceModels
|
||||
|
||||
@ -20,7 +20,6 @@ EXE_LIBS = \
|
||||
-lspecie \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-ldynamicMesh \
|
||||
-ldynamicFvMesh \
|
||||
-ltopoChangerFvMesh \
|
||||
|
||||
@ -21,7 +21,6 @@ EXE_LIBS = \
|
||||
-lspecie \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-ldynamicFvMesh \
|
||||
-ltopoChangerFvMesh \
|
||||
-loverset
|
||||
|
||||
@ -19,6 +19,5 @@ EXE_LIBS = \
|
||||
-lspecie \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-latmosphericModels \
|
||||
-lregionFaModels
|
||||
|
||||
@ -21,7 +21,6 @@ EXE_LIBS = \
|
||||
-lspecie \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-ldynamicFvMesh \
|
||||
-ltopoChangerFvMesh \
|
||||
-lsampling \
|
||||
|
||||
@ -1,52 +1,22 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
Info<< "Create dynamic mesh for time = "
|
||||
<< runTime.timeName() << nl << endl;
|
||||
|
||||
Description
|
||||
Create a dynamicFvMesh, with init()
|
||||
|
||||
Required Variables
|
||||
- runTime [Time]
|
||||
|
||||
Provided Variables
|
||||
- mesh [dynamicFvMesh], meshPtr
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
Foam::autoPtr<Foam::dynamicFvMesh> meshPtr;
|
||||
|
||||
{
|
||||
Foam::Info << "Create dynamic mesh for time = "
|
||||
<< runTime.timeName() << Foam::nl;
|
||||
|
||||
meshPtr = dynamicFvMesh::New
|
||||
autoPtr<dynamicFvMesh> meshPtr
|
||||
(
|
||||
IOobject
|
||||
dynamicFvMesh::New
|
||||
(
|
||||
polyMesh::defaultRegion,
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
IOobject
|
||||
(
|
||||
polyMesh::defaultRegion,
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
dynamicFvMesh& mesh = meshPtr();
|
||||
|
||||
dynamicFvMesh& mesh = meshPtr();
|
||||
|
||||
// Calculate initial mesh-to-mesh mapping. Note that this should be
|
||||
// done under the hood, e.g. as a MeshObject
|
||||
mesh.update();
|
||||
|
||||
Foam::Info << Foam::endl;
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
// Calculate initial mesh-to-mesh mapping. Note that this should be
|
||||
// done under the hood, e.g. as a MeshObject
|
||||
mesh.update();
|
||||
|
||||
@ -18,5 +18,4 @@ EXE_LIBS = \
|
||||
-lfluidThermophysicalModels \
|
||||
-lspecie \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools
|
||||
-lcompressibleTurbulenceModels
|
||||
|
||||
@ -16,5 +16,4 @@ EXE_LIBS = \
|
||||
-lfluidThermophysicalModels \
|
||||
-lspecie \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools
|
||||
-lcompressibleTurbulenceModels
|
||||
|
||||
@ -21,7 +21,6 @@ EXE_LIBS = \
|
||||
-lspecie \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-ldynamicMesh \
|
||||
-ldynamicFvMesh \
|
||||
-ltopoChangerFvMesh \
|
||||
|
||||
@ -23,7 +23,6 @@ EXE_LIBS = \
|
||||
-lspecie \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-latmosphericModels \
|
||||
-ldynamicMesh \
|
||||
-ldynamicFvMesh \
|
||||
|
||||
@ -24,7 +24,6 @@ EXE_LIBS = \
|
||||
-lspecie \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-latmosphericModels \
|
||||
-loverset \
|
||||
-ldynamicFvMesh \
|
||||
|
||||
@ -20,6 +20,5 @@ EXE_LIBS = \
|
||||
-lradiationModels \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-latmosphericModels \
|
||||
-lregionFaModels
|
||||
|
||||
@ -37,7 +37,6 @@ EXE_LIBS = \
|
||||
-lcombustionModels \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lradiationModels \
|
||||
-lregionModels \
|
||||
-lregionFaModels
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2019,2022 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -70,7 +70,6 @@ int main(int argc, char *argv[])
|
||||
#define CREATE_MESH createMeshesPostProcess.H
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "addCheckCaseOptions.H"
|
||||
#include "setRootCaseLists.H"
|
||||
#include "createTime.H"
|
||||
#include "createMeshes.H"
|
||||
|
||||
@ -30,7 +30,6 @@ EXE_LIBS = \
|
||||
-lspecie \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lradiationModels \
|
||||
-lfvOptions \
|
||||
-lfaOptions \
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2019,2022 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -62,7 +62,6 @@ int main(int argc, char *argv[])
|
||||
#define CREATE_MESH createMeshesPostProcess.H
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "addCheckCaseOptions.H"
|
||||
#include "setRootCaseLists.H"
|
||||
#include "createTime.H"
|
||||
#include "createMeshes.H"
|
||||
|
||||
@ -4,61 +4,21 @@
|
||||
|
||||
forAll(fluidNames, i)
|
||||
{
|
||||
if (args.dryRun() || args.found("dry-run-write"))
|
||||
{
|
||||
Info
|
||||
<< "Operating in 'dry-run' mode:"
|
||||
<< " case will run for 1 time step. "
|
||||
<< "All checks assumed OK on a clean exit" << endl;
|
||||
Info<< "Create fluid mesh for region " << fluidNames[i]
|
||||
<< " for time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
FieldBase::allowConstructFromLargerSize = true;
|
||||
|
||||
// Create a simplified 1D mesh and attempt to re-create boundary
|
||||
// conditions
|
||||
fluidRegions.set
|
||||
fluidRegions.set
|
||||
(
|
||||
i,
|
||||
new fvMesh
|
||||
(
|
||||
i,
|
||||
new simplifiedMeshes::columnFvMesh(runTime, fluidNames[i])
|
||||
);
|
||||
|
||||
// Stop after 1 iteration of the simplified mesh
|
||||
|
||||
if (args.found("dry-run-write"))
|
||||
{
|
||||
// Using saWriteNow triggers function objects execute(), write()
|
||||
runTime.stopAt(Time::saWriteNow);
|
||||
|
||||
// Make sure mesh gets output to the current time (since
|
||||
// instance no longer constant)
|
||||
fluidRegions[i].setInstance(runTime.timeName());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Using saNoWriteNow triggers function objects execute(),
|
||||
// but not write()
|
||||
runTime.stopAt(Time::saNoWriteNow);
|
||||
}
|
||||
|
||||
functionObject::outputPrefix = "postProcessing-dry-run";
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Create fluid mesh for region " << fluidNames[i]
|
||||
<< " for time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
fluidRegions.set
|
||||
(
|
||||
i,
|
||||
new fvMesh
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
fluidNames[i],
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
fluidNames[i],
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
);
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -67,7 +67,6 @@ int main(int argc, char *argv[])
|
||||
#define CREATE_MESH createMeshesPostProcess.H
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "addCheckCaseOptions.H"
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMeshes.H"
|
||||
|
||||
@ -4,61 +4,21 @@
|
||||
|
||||
forAll(fluidNames, i)
|
||||
{
|
||||
if (args.dryRun() || args.found("dry-run-write"))
|
||||
{
|
||||
Info
|
||||
<< "Operating in 'dry-run' mode:"
|
||||
<< " case will run for 1 time step. "
|
||||
<< "All checks assumed OK on a clean exit" << endl;
|
||||
Info<< "Create fluid mesh for region " << fluidNames[i]
|
||||
<< " for time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
FieldBase::allowConstructFromLargerSize = true;
|
||||
|
||||
// Create a simplified 1D mesh and attempt to re-create boundary
|
||||
// conditions
|
||||
fluidRegions.set
|
||||
fluidRegions.set
|
||||
(
|
||||
i,
|
||||
new fvMesh
|
||||
(
|
||||
i,
|
||||
new simplifiedMeshes::columnFvMesh(runTime, fluidNames[i])
|
||||
);
|
||||
|
||||
// Stop after 1 iteration of the simplified mesh
|
||||
|
||||
if (args.found("dry-run-write"))
|
||||
{
|
||||
// Using saWriteNow triggers function objects execute(), write()
|
||||
runTime.stopAt(Time::saWriteNow);
|
||||
|
||||
// Make sure mesh gets output to the current time (since
|
||||
// instance no longer constant)
|
||||
fluidRegions[i].setInstance(runTime.timeName());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Using saNoWriteNow triggers function objects execute(),
|
||||
// but not write()
|
||||
runTime.stopAt(Time::saNoWriteNow);
|
||||
}
|
||||
|
||||
functionObject::outputPrefix = "postProcessing-dry-run";
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Create fluid mesh for region " << fluidNames[i]
|
||||
<< " for time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
fluidRegions.set
|
||||
(
|
||||
i,
|
||||
new fvMesh
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
fluidNames[i],
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
fluidNames[i],
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
);
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -12,15 +12,15 @@
|
||||
if (Y.size())
|
||||
{
|
||||
const word inertSpecie(thermo.get<word>("inertSpecie"));
|
||||
inertIndex = composition.species().find(inertSpecie);
|
||||
if (inertIndex < 0)
|
||||
if (!composition.species().found(inertSpecie))
|
||||
{
|
||||
FatalIOErrorIn(args.executable().c_str(), thermo)
|
||||
<< "Inert specie " << inertSpecie
|
||||
<< " not found in available species "
|
||||
<< flatOutput(composition.species())
|
||||
<< composition.species()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
inertIndex = composition.species()[inertSpecie];
|
||||
}
|
||||
|
||||
volScalarField& rho = rhoFluid[i];
|
||||
|
||||
@ -4,67 +4,26 @@
|
||||
|
||||
forAll(solidNames, i)
|
||||
{
|
||||
if (args.dryRun() || args.found("dry-run-write"))
|
||||
{
|
||||
Info
|
||||
<< "Operating in 'dry-run' mode:"
|
||||
<< " case will run for 1 time step. "
|
||||
<< "All checks assumed OK on a clean exit" << endl;
|
||||
Info<< "Create solid mesh for region " << solidNames[i]
|
||||
<< " for time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
FieldBase::allowConstructFromLargerSize = true;
|
||||
|
||||
// Create a simplified 1D mesh and attempt to re-create boundary
|
||||
// conditions
|
||||
solidRegions.set
|
||||
solidRegions.set
|
||||
(
|
||||
i,
|
||||
new fvMesh
|
||||
(
|
||||
i,
|
||||
new simplifiedMeshes::columnFvMesh(runTime, solidNames[i])
|
||||
);
|
||||
|
||||
// Stop after 1 iteration of the simplified mesh
|
||||
|
||||
if (args.found("dry-run-write"))
|
||||
{
|
||||
// Using saWriteNow triggers function objects execute(), write()
|
||||
runTime.stopAt(Time::saWriteNow);
|
||||
|
||||
// Make sure mesh gets output to the current time (since
|
||||
// instance no longer constant)
|
||||
solidRegions[i].setInstance(runTime.timeName());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Using saNoWriteNow triggers function objects execute(),
|
||||
// but not write()
|
||||
runTime.stopAt(Time::saNoWriteNow);
|
||||
}
|
||||
|
||||
functionObject::outputPrefix = "postProcessing-dry-run";
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Create solid mesh for region " << solidNames[i]
|
||||
<< " for time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
solidRegions.set
|
||||
(
|
||||
i,
|
||||
new fvMesh
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
solidNames[i],
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
solidNames[i],
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
);
|
||||
)
|
||||
);
|
||||
|
||||
// Force calculation of geometric properties to prevent it being
|
||||
// done
|
||||
// later in e.g. some boundary evaluation
|
||||
//(void)solidRegions[i].weights();
|
||||
//(void)solidRegions[i].deltaCoeffs();
|
||||
}
|
||||
// Force calculation of geometric properties to prevent it being done
|
||||
// later in e.g. some boundary evaluation
|
||||
//(void)solidRegions[i].weights();
|
||||
//(void)solidRegions[i].deltaCoeffs();
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
solidRegionDiffNo.C
|
||||
solidFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/solidFoam
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
EXE_INC = \
|
||||
-I../chtMultiRegionFoam/include \
|
||||
-I../chtMultiRegionFoam/solid \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
@ -23,5 +21,4 @@ EXE_LIBS = \
|
||||
-lfluidThermophysicalModels \
|
||||
-lsolidThermo \
|
||||
-lradiationModels \
|
||||
-lspecie \
|
||||
-lthermoTools
|
||||
-lspecie
|
||||
|
||||
@ -1,31 +0,0 @@
|
||||
scalar DiNum = -GREAT;
|
||||
|
||||
{
|
||||
tmp<volScalarField> magKappa;
|
||||
if (thermo.isotropic())
|
||||
{
|
||||
magKappa = thermo.kappa();
|
||||
}
|
||||
else
|
||||
{
|
||||
magKappa = mag(thermo.Kappa());
|
||||
}
|
||||
|
||||
tmp<volScalarField> tcp = thermo.Cp();
|
||||
const volScalarField& cp = tcp();
|
||||
|
||||
tmp<volScalarField> trho = thermo.rho();
|
||||
const volScalarField& rho = trho();
|
||||
|
||||
DiNum = max
|
||||
(
|
||||
solidRegionDiffNo
|
||||
(
|
||||
mesh,
|
||||
runTime,
|
||||
rho*cp,
|
||||
magKappa()
|
||||
),
|
||||
DiNum
|
||||
);
|
||||
}
|
||||
@ -41,8 +41,6 @@ Description
|
||||
#include "fvOptions.H"
|
||||
#include "simpleControl.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "dummyCourantNo.H"
|
||||
#include "solidRegionDiffNo.H"
|
||||
#include "coordinateSystem.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -90,31 +88,17 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
#include "createDyMControls.H"
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readDyMControls.H"
|
||||
#include "readSolidTimeControls.H"
|
||||
|
||||
#include "solidDiffusionNo.H"
|
||||
#include "setMultiRegionDeltaT.H"
|
||||
|
||||
++runTime;
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
while (pimple.loop())
|
||||
{
|
||||
if (pimple.firstIter() || moveMeshOuterCorrectors)
|
||||
if (pimple.firstIter())
|
||||
{
|
||||
// Do any mesh changes
|
||||
mesh.controlledUpdate();
|
||||
|
||||
if (mesh.changing() && checkMeshCourantNo)
|
||||
{
|
||||
#include "meshCourantNo.H"
|
||||
}
|
||||
mesh.update();
|
||||
}
|
||||
|
||||
while (pimple.correct())
|
||||
|
||||
@ -1 +0,0 @@
|
||||
../chtMultiRegionFoam/solid/solidRegionDiffNo.C
|
||||
@ -1 +0,0 @@
|
||||
../chtMultiRegionFoam/solid/solidRegionDiffNo.H
|
||||
@ -18,5 +18,4 @@ EXE_LIBS = \
|
||||
-lradiationModels \
|
||||
-lspecie \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools
|
||||
-lcompressibleTurbulenceModels
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2007-2021 PCOpt/NTUA
|
||||
Copyright (C) 2013-2021 FOSS GP
|
||||
Copyright (C) 2007-2019 PCOpt/NTUA
|
||||
Copyright (C) 2013-2019 FOSS GP
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -71,6 +71,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Solve all adjoint equations
|
||||
om.solveAdjointEquations();
|
||||
|
||||
// Compute all sensitivities
|
||||
om.computeSensitivities();
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
@ -20,7 +20,7 @@ volScalarField h0
|
||||
IOobject
|
||||
(
|
||||
"h0",
|
||||
runTime.findInstance(polyMesh::meshSubDir, "points"),
|
||||
runTime.findInstance("polyMesh", "points"),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT
|
||||
),
|
||||
|
||||
@ -1,52 +1,22 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
Info<< "Create dynamic mesh for time = "
|
||||
<< runTime.timeName() << nl << endl;
|
||||
|
||||
Description
|
||||
Create a dynamicFvMesh, with init()
|
||||
|
||||
Required Variables
|
||||
- runTime [Time]
|
||||
|
||||
Provided Variables
|
||||
- mesh [dynamicFvMesh], meshPtr
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
Foam::autoPtr<Foam::dynamicFvMesh> meshPtr;
|
||||
|
||||
{
|
||||
Foam::Info << "Create dynamic mesh for time = "
|
||||
<< runTime.timeName() << Foam::nl;
|
||||
|
||||
meshPtr = dynamicFvMesh::New
|
||||
autoPtr<dynamicFvMesh> meshPtr
|
||||
(
|
||||
IOobject
|
||||
dynamicFvMesh::New
|
||||
(
|
||||
polyMesh::defaultRegion,
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
IOobject
|
||||
(
|
||||
polyMesh::defaultRegion,
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
dynamicFvMesh& mesh = meshPtr();
|
||||
|
||||
dynamicFvMesh& mesh = meshPtr();
|
||||
|
||||
// Calculate initial mesh-to-mesh mapping. Note that this should be
|
||||
// done under the hood, e.g. as a MeshObject
|
||||
mesh.update();
|
||||
|
||||
Foam::Info << Foam::endl;
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
// Calculate initial mesh-to-mesh mapping. Note that this should be
|
||||
// done under the hood, e.g. as a MeshObject
|
||||
mesh.update();
|
||||
|
||||
@ -31,7 +31,6 @@ EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-llagrangian \
|
||||
-llagrangianIntermediate \
|
||||
-llagrangianTurbulence \
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
const volScalarField& T = thermo.T();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
|
||||
const label inertIndex(composition.species().find(inertSpecie));
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
|
||||
@ -36,7 +36,6 @@ EXE_LIBS = \
|
||||
-lsampling \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lspecie \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
const label inertIndex(composition.species().find(inertSpecie));
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
|
||||
const volScalarField& T = thermo.T();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
|
||||
@ -1,35 +1,27 @@
|
||||
#include "createMesh.H"
|
||||
|
||||
dictionary filmDict;
|
||||
|
||||
IOobject io
|
||||
IOdictionary filmDict
|
||||
(
|
||||
"surfaceFilmProperties",
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
IOobject
|
||||
(
|
||||
"surfaceFilmProperties",
|
||||
runTime.constant(),
|
||||
runTime,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
if (io.typeHeaderOk<IOdictionary>())
|
||||
{
|
||||
IOdictionary propDict(io);
|
||||
const word filmRegionName = filmDict.get<word>("region");
|
||||
|
||||
filmDict = std::move(propDict);
|
||||
|
||||
const word filmRegionName = filmDict.get<word>("region");
|
||||
|
||||
fvMesh filmMesh
|
||||
fvMesh filmMesh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
filmRegionName,
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
filmRegionName,
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
);
|
||||
|
||||
@ -36,7 +36,6 @@ EXE_LIBS = \
|
||||
-ldynamicFvMesh \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lspecie \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
|
||||
@ -31,7 +31,6 @@ EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-llagrangian \
|
||||
-llagrangianIntermediate \
|
||||
-llagrangianTurbulence \
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
const volScalarField& psi = thermo.psi();
|
||||
const volScalarField& T = thermo.T();
|
||||
const label inertIndex(composition.species().find(inertSpecie));
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
|
||||
@ -31,7 +31,6 @@ EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-llagrangian \
|
||||
-llagrangianIntermediate \
|
||||
-llagrangianTurbulence \
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
const volScalarField& psi = thermo.psi();
|
||||
const volScalarField& T = thermo.T();
|
||||
const label inertIndex(composition.species().find(inertSpecie));
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
|
||||
@ -31,7 +31,6 @@ EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-llagrangian \
|
||||
-llagrangianIntermediate \
|
||||
-llagrangianTurbulence \
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
const volScalarField& T = thermo.T();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
const label inertIndex(composition.species().find(inertSpecie));
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
|
||||
@ -35,7 +35,6 @@ EXE_LIBS = \
|
||||
-lsampling \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-llagrangian \
|
||||
-llagrangianIntermediate \
|
||||
-llagrangianTurbulence \
|
||||
|
||||
@ -31,7 +31,6 @@ EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-llagrangian \
|
||||
-llagrangianIntermediate \
|
||||
-llagrangianSpray \
|
||||
|
||||
@ -36,7 +36,6 @@ EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-llagrangian \
|
||||
-llagrangianIntermediate \
|
||||
-llagrangianTurbulence \
|
||||
|
||||
@ -29,7 +29,6 @@ EXE_LIBS = \
|
||||
-lradiationModels \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lregionModels \
|
||||
-lsurfaceFilmModels \
|
||||
-lregionFaModels \
|
||||
|
||||
@ -32,7 +32,6 @@ EXE_LIBS = \
|
||||
-lradiationModels \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lregionModels \
|
||||
-lsurfaceFilmModels \
|
||||
-ldynamicMesh \
|
||||
|
||||
@ -35,11 +35,10 @@ EXE_LIBS = \
|
||||
-lspecie \
|
||||
-lincompressibleTransportModels \
|
||||
-limmiscibleIncompressibleTwoPhaseMixture \
|
||||
-ltwoPhaseProperties \
|
||||
-linterfaceProperties \
|
||||
-lturbulenceModels \
|
||||
-lsampling \
|
||||
-lregionModels \
|
||||
-lregionFaModels \
|
||||
-lsurfaceFilmModels \
|
||||
-lcompressibleTwoPhaseMixtureTurbulenceModels
|
||||
|
||||
|
||||
@ -19,9 +19,7 @@ LIB_LIBS = \
|
||||
-lmeshTools \
|
||||
-lincompressibleTransportModels \
|
||||
-limmiscibleIncompressibleTwoPhaseMixture \
|
||||
-ltwoPhaseProperties \
|
||||
-linterfaceProperties \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools
|
||||
-lcompressibleTurbulenceModels
|
||||
|
||||
@ -26,5 +26,4 @@ EXE_LIBS = \
|
||||
-linterfaceProperties \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lVoFphaseCompressibleTurbulenceModels
|
||||
|
||||
@ -1,18 +1,16 @@
|
||||
EXE_INC = \
|
||||
-I../twoPhaseMixtureThermo \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude
|
||||
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-ltwoPhaseMixtureThermo \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
@ -22,5 +20,6 @@ LIB_LIBS = \
|
||||
-linterfaceProperties \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lincompressibleTransportModels
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
|
||||
@ -29,7 +29,6 @@ EXE_LIBS = \
|
||||
-linterfaceProperties \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lVoFphaseCompressibleTurbulenceModels \
|
||||
-ldynamicMesh \
|
||||
-ldynamicFvMesh
|
||||
|
||||
@ -36,7 +36,6 @@ EXE_LIBS = \
|
||||
-linterfaceProperties \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lVoFphaseCompressibleTurbulenceModels \
|
||||
-lSLGThermo \
|
||||
-lsurfaceFilmModels \
|
||||
|
||||
@ -26,7 +26,6 @@ EXE_LIBS = \
|
||||
-ldynamicMesh \
|
||||
-ldynamicFvMesh \
|
||||
-ltwoPhaseMixtureThermo \
|
||||
-ltwoPhaseProperties \
|
||||
-ltwoPhaseSurfaceTension \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
@ -36,6 +35,5 @@ EXE_LIBS = \
|
||||
-linterfaceProperties \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lVoFphaseCompressibleTurbulenceModels \
|
||||
-lgeometricVoF
|
||||
|
||||
@ -32,7 +32,6 @@ EXE_LIBS = \
|
||||
-linterfaceProperties \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lVoFphaseCompressibleTurbulenceModels \
|
||||
-ldynamicMesh \
|
||||
-ldynamicFvMesh \
|
||||
|
||||
@ -21,5 +21,4 @@ EXE_LIBS = \
|
||||
-lspecie \
|
||||
-linterfaceProperties \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools
|
||||
-lcompressibleTurbulenceModels
|
||||
|
||||
@ -22,5 +22,4 @@ EXE_LIBS = \
|
||||
-ldriftFluxTransportModels \
|
||||
-ldriftFluxRelativeVelocityModels \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools
|
||||
-lcompressibleTurbulenceModels
|
||||
|
||||
@ -25,7 +25,6 @@ EXE_LIBS = \
|
||||
-ldynamicFvMesh \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lcompressibleTransportModels \
|
||||
-lradiationModels \
|
||||
-lfluidThermophysicalModels \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
for (multiphaseInter::phaseModel& phase : fluid.phases())
|
||||
for (phaseModel& phase : fluid.phases())
|
||||
{
|
||||
PtrList<volScalarField>& Y = phase.Y();
|
||||
|
||||
|
||||
@ -63,10 +63,9 @@
|
||||
|
||||
|
||||
Info<< "Creating multiphaseSystem\n" << endl;
|
||||
autoPtr<multiphaseInter::multiphaseSystem> fluidPtr =
|
||||
multiphaseInter::multiphaseSystem::New(mesh);
|
||||
autoPtr<multiphaseSystem> fluidPtr = multiphaseSystem::New(mesh);
|
||||
|
||||
multiphaseInter::multiphaseSystem& fluid = fluidPtr();
|
||||
multiphaseSystem& fluid = fluidPtr();
|
||||
|
||||
if (!fluid.incompressible())
|
||||
{
|
||||
@ -119,12 +118,9 @@
|
||||
surfaceScalarField& rhoPhi = fluid.rhoPhi();
|
||||
|
||||
// Construct incompressible turbulence model
|
||||
autoPtr
|
||||
<
|
||||
CompressibleTurbulenceModel<multiphaseInter::multiphaseSystem>
|
||||
> turbulence
|
||||
autoPtr<CompressibleTurbulenceModel<multiphaseSystem>> turbulence
|
||||
(
|
||||
CompressibleTurbulenceModel<multiphaseInter::multiphaseSystem>::New
|
||||
CompressibleTurbulenceModel<multiphaseSystem>::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
@ -133,8 +129,6 @@
|
||||
)
|
||||
);
|
||||
|
||||
fluid.setTurbulence(turbulence());
|
||||
|
||||
// Creating radiation model
|
||||
autoPtr<radiation::radiationModel> radiation
|
||||
(
|
||||
|
||||
@ -106,6 +106,7 @@ bool Foam::DTRMParticle::move
|
||||
//Cache old data of particle to use for reflected particle
|
||||
const point pos0 = position();
|
||||
const label cell1 = cell();
|
||||
const tetIndices tetIs = this->currentTetIndices();
|
||||
|
||||
scalar f = 1 - stepFraction();
|
||||
const vector s = p1() - p0() - deviationFromMeshCentre();
|
||||
|
||||
@ -3,14 +3,12 @@ phaseSystem = $(LIB_SRC)/phaseSystemModels/multiphaseInter
|
||||
EXE_INC = \
|
||||
-I${phaseSystem}/phasesSystem/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/fileFormats/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lfileFormats \
|
||||
-lmeshTools \
|
||||
-llagrangian \
|
||||
-lradiationModels \
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -31,12 +31,11 @@ License
|
||||
#include "absorptionEmissionModel.H"
|
||||
#include "scatterModel.H"
|
||||
#include "constants.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "unitConversion.H"
|
||||
#include "interpolationCell.H"
|
||||
#include "interpolationCellPoint.H"
|
||||
#include "Random.H"
|
||||
#include "OBJstream.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
using namespace Foam::constant;
|
||||
|
||||
@ -680,28 +679,44 @@ void Foam::radiation::laserDTRM::calculate()
|
||||
Info<< "Final number of particles..."
|
||||
<< returnReduce(DTRMCloud_.size(), sumOp<label>()) << endl;
|
||||
|
||||
pointField lines(2*DTRMCloud_.size());
|
||||
OFstream osRef(type() + ":particlePath.obj");
|
||||
label vertI = 0;
|
||||
|
||||
List<pointField> positions(Pstream::nProcs());
|
||||
List<pointField> p0(Pstream::nProcs());
|
||||
|
||||
DynamicList<point> positionsMyProc;
|
||||
DynamicList<point> p0MyProc;
|
||||
|
||||
for (const DTRMParticle& p : DTRMCloud_)
|
||||
{
|
||||
label i = 0;
|
||||
for (const DTRMParticle& p : DTRMCloud_)
|
||||
positionsMyProc.append(p.position());
|
||||
p0MyProc.append(p.p0());
|
||||
}
|
||||
|
||||
positions[Pstream::myProcNo()].transfer(positionsMyProc);
|
||||
p0[Pstream::myProcNo()].transfer(p0MyProc);
|
||||
|
||||
Pstream::gatherList(positions);
|
||||
Pstream::scatterList(positions);
|
||||
Pstream::gatherList(p0);
|
||||
Pstream::scatterList(p0);
|
||||
|
||||
for (const int proci : Pstream::allProcs())
|
||||
{
|
||||
const pointField& pos = positions[proci];
|
||||
const pointField& pfinal = p0[proci];
|
||||
forAll(pos, i)
|
||||
{
|
||||
lines[i] = p.position();
|
||||
lines[i+1] = p.p0();
|
||||
i += 2;
|
||||
meshTools::writeOBJ(osRef, pos[i]);
|
||||
vertI++;
|
||||
meshTools::writeOBJ(osRef, pfinal[i]);
|
||||
vertI++;
|
||||
osRef << "l " << vertI-1 << ' ' << vertI << nl;
|
||||
}
|
||||
}
|
||||
|
||||
globalIndex::gatherInplaceOp(lines);
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
OBJstream os(type() + ":particlePath.obj");
|
||||
|
||||
for (label pointi = 0; pointi < lines.size(); pointi += 2)
|
||||
{
|
||||
os.write(linePointRef(lines[pointi], lines[pointi+1]));
|
||||
}
|
||||
}
|
||||
osRef.flush();
|
||||
|
||||
scalar totalQ = gSum(Q_.primitiveFieldRef()*mesh_.V());
|
||||
Info << "Total energy absorbed [W]: " << totalQ << endl;
|
||||
|
||||
@ -28,8 +28,8 @@ EXE_LIBS = \
|
||||
-ldynamicFvMesh \
|
||||
-lphaseTemperatureChangeTwoPhaseMixtures \
|
||||
-ltwoPhaseMixture \
|
||||
-ltwoPhaseProperties \
|
||||
-linterfaceProperties \
|
||||
-ltwoPhaseProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
|
||||
@ -13,7 +13,7 @@ LIB_LIBS = \
|
||||
-lmeshTools \
|
||||
-lgeometricVoF \
|
||||
-ltwoPhaseMixture \
|
||||
-ltwoPhaseProperties \
|
||||
-linterfaceProperties \
|
||||
-ltwoPhaseProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-lfluidThermophysicalModels
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2020 Henning Scheufler
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -265,13 +265,23 @@ correct()
|
||||
const dimensionedScalar& TSat = thermo.TSat();
|
||||
const dimensionedScalar T0(dimTemperature, Zero);
|
||||
|
||||
const dimensionedScalar L(mag(mixture_.Hf2() - mixture_.Hf1()));
|
||||
dimensionedScalar L = mixture_.Hf2() - mixture_.Hf1();
|
||||
|
||||
// interface heat resistance
|
||||
mDotc_ = interfaceArea_*R_*max(TSat - T, T0)/L;
|
||||
mDote_ = interfaceArea_*R_*max(T - TSat, T0)/L;
|
||||
|
||||
// Limiting max condensation
|
||||
forAll(mDotc_, celli)
|
||||
{
|
||||
scalar rhobyDt = mixture_.rho1().value()/mesh_.time().deltaTValue();
|
||||
scalar maxEvap = mixture_.alpha1()[celli]*rhobyDt; // positive
|
||||
scalar maxCond = -mixture_.alpha2()[celli]*rhobyDt; // negative
|
||||
mDotc_[celli] = min(max(mDotc_[celli], maxCond), maxEvap);
|
||||
}
|
||||
|
||||
// Calculate the spread sources
|
||||
|
||||
dimensionedScalar D
|
||||
(
|
||||
"D",
|
||||
|
||||
@ -24,7 +24,6 @@ EXE_LIBS = \
|
||||
-lincompressibleTransportModels \
|
||||
-linterfaceProperties \
|
||||
-limmiscibleIncompressibleTwoPhaseMixture \
|
||||
-ltwoPhaseProperties \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
-lwaveModels \
|
||||
|
||||
@ -23,7 +23,6 @@ EXE_LIBS = \
|
||||
-lincompressibleTransportModels \
|
||||
-linterfaceProperties \
|
||||
-limmiscibleIncompressibleTwoPhaseMixture \
|
||||
-ltwoPhaseProperties \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
-ldynamicMesh \
|
||||
|
||||
@ -33,7 +33,5 @@ EXE_LIBS = \
|
||||
-lincompressibleTurbulenceModels \
|
||||
-lwaveModels \
|
||||
-lgeometricVoF \
|
||||
-ltwoPhaseMixture \
|
||||
-ltwoPhaseProperties \
|
||||
-lVoFphaseTurbulentTransportModels \
|
||||
-lincompressibleInterPhaseTransportModels
|
||||
|
||||
@ -17,8 +17,8 @@ EXE_LIBS = \
|
||||
-lsampling \
|
||||
-lphaseChangeTwoPhaseMixtures \
|
||||
-ltwoPhaseMixture \
|
||||
-ltwoPhaseProperties \
|
||||
-linterfaceProperties \
|
||||
-ltwoPhaseProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels
|
||||
|
||||
@ -20,8 +20,8 @@ EXE_LIBS = \
|
||||
-lsampling \
|
||||
-lphaseChangeTwoPhaseMixtures \
|
||||
-ltwoPhaseMixture \
|
||||
-ltwoPhaseProperties \
|
||||
-linterfaceProperties \
|
||||
-ltwoPhaseProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
|
||||
@ -23,8 +23,8 @@ EXE_LIBS = \
|
||||
-lsampling \
|
||||
-lphaseChangeTwoPhaseMixtures \
|
||||
-ltwoPhaseMixture \
|
||||
-ltwoPhaseProperties \
|
||||
-linterfaceProperties \
|
||||
-ltwoPhaseProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-ltwoPhaseMixture \
|
||||
-ltwoPhaseProperties \
|
||||
-lincompressibleTransportModels
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
|
||||
@ -20,5 +20,4 @@ EXE_LIBS = \
|
||||
-lsampling \
|
||||
-lreactingMultiphaseSystem \
|
||||
-lreactingTwoPhaseSystem \
|
||||
-ltwoPhaseReactingTurbulenceModels \
|
||||
-lthermoTools
|
||||
-ltwoPhaseReactingTurbulenceModels
|
||||
|
||||
@ -23,7 +23,6 @@ EXE_LIBS = \
|
||||
-lspecie \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lthermoTools \
|
||||
-lincompressibleTransportModels \
|
||||
-lcompressibleTwoPhaseSystem \
|
||||
-lphaseCompressibleTurbulenceModels
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
Test-CircularBuffer.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-CircularBuffer
|
||||
@ -1,2 +0,0 @@
|
||||
/* EXE_INC = */
|
||||
/* EXE_LIBS = */
|
||||
@ -1,136 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
Test-CircularBuffer
|
||||
|
||||
Description
|
||||
Basic tests for CircularBuffer behaviour and characteristics
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
#include "ListOps.H"
|
||||
#include "CircularBuffer.H"
|
||||
#include "StringStream.H"
|
||||
#include "FlatOutput.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
template<class T>
|
||||
inline Ostream& report
|
||||
(
|
||||
const CircularBuffer<T>& buf,
|
||||
bool debugOutput = true
|
||||
)
|
||||
{
|
||||
buf.writeList(Info, 0);
|
||||
if (debugOutput)
|
||||
{
|
||||
Info<< " : ";
|
||||
buf.info(Info);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< nl;
|
||||
}
|
||||
return Info;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
CircularBuffer<label> buf1(1); report(buf1);
|
||||
buf1.append(10); report(buf1);
|
||||
|
||||
Info<< buf1.range_one() << nl;
|
||||
|
||||
buf1.append(20); report(buf1);
|
||||
buf1.append(30); report(buf1);
|
||||
buf1.push_back(40); report(buf1);
|
||||
buf1.push_front(-50); report(buf1);
|
||||
buf1.append(60); report(buf1);
|
||||
buf1.append(labelList({70,80,90})); report(buf1);
|
||||
|
||||
Info<< nl << "access: " << buf1 << nl;
|
||||
|
||||
Info<< buf1[-12] << nl;
|
||||
|
||||
Info<< "found: " << buf1.found(40) << nl;
|
||||
buf1.appendUniq(100); report(buf1);
|
||||
|
||||
buf1 = Zero; report(buf1);
|
||||
|
||||
buf1 = 500; report(buf1);
|
||||
|
||||
while (buf1.size() > 2)
|
||||
{
|
||||
(void) buf1.pop_front();
|
||||
}
|
||||
report(buf1);
|
||||
|
||||
buf1.append(identity(5)); report(buf1);
|
||||
|
||||
buf1.info(Info);
|
||||
Info<< buf1 << nl;
|
||||
|
||||
CircularBuffer<label> buf2(15);
|
||||
report(buf2);
|
||||
|
||||
buf2 = std::move(buf1);
|
||||
Info<< "buf1: "; report(buf1);
|
||||
Info<< "buf2: "; report(buf2);
|
||||
|
||||
Info<< "for-range:";
|
||||
for (const label val : buf2)
|
||||
{
|
||||
Info<< ' ' << val;
|
||||
}
|
||||
Info<< endl;
|
||||
|
||||
{
|
||||
auto iter = buf2.cbegin();
|
||||
auto endIter = buf2.cend();
|
||||
|
||||
Info<< "iterated:";
|
||||
while (iter != endIter)
|
||||
{
|
||||
Info<< ' ' << *(++iter);
|
||||
}
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
Info<< "normal: " << flatOutput(buf2) << nl;
|
||||
buf2.reverse();
|
||||
Info<< "reverse: " << flatOutput(buf2) << nl;
|
||||
|
||||
Info<< nl << "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -34,6 +34,7 @@ Description
|
||||
#include "ListOps.H"
|
||||
#include "face.H"
|
||||
#include "Circulator.H"
|
||||
#include "ConstCirculator.H"
|
||||
|
||||
|
||||
using namespace Foam;
|
||||
@ -57,31 +58,21 @@ int main(int argc, char *argv[])
|
||||
|
||||
face f(identity(4));
|
||||
|
||||
// ConstCirculator<face> foo;
|
||||
// Info<< "size: " << foo.size() << nl;
|
||||
|
||||
ConstCirculator<face> cStart(f);
|
||||
|
||||
if (!cStart.empty())
|
||||
if (cStart.size()) do
|
||||
{
|
||||
do
|
||||
{
|
||||
Info<< "Iterate forwards over face (prev/curr/next) : "
|
||||
<< cStart.prev() << " / "
|
||||
<< cStart.curr() << " / "
|
||||
<< cStart.next()
|
||||
Info<< "Iterate forwards over face (prev/curr/next) : "
|
||||
<< cStart.prev() << " / " << cStart() << " / " << cStart.next()
|
||||
<< endl;
|
||||
} while (cStart.circulate(CirculatorBase::CLOCKWISE));
|
||||
}
|
||||
|
||||
if (!cStart.empty())
|
||||
} while (cStart.circulate(CirculatorBase::CLOCKWISE));
|
||||
|
||||
if (cStart.size()) do
|
||||
{
|
||||
do
|
||||
{
|
||||
Info<< "Iterate backwards over face : " << cStart() << endl;
|
||||
Info<< "Iterate backwards over face : " << cStart() << endl;
|
||||
|
||||
} while (cStart.circulate(CirculatorBase::ANTICLOCKWISE));
|
||||
}
|
||||
} while (cStart.circulate(CirculatorBase::ANTICLOCKWISE));
|
||||
|
||||
|
||||
Info<< nl << nl << "Test non-const circulator" << nl << endl;
|
||||
@ -98,18 +89,15 @@ int main(int argc, char *argv[])
|
||||
|
||||
} while (cStart2.circulate(CirculatorBase::CLOCKWISE));
|
||||
|
||||
if (!cStart2.empty())
|
||||
if (cStart2.size()) do
|
||||
{
|
||||
do
|
||||
{
|
||||
Info<< "Iterate forwards over face, adding 1 to each element : "
|
||||
<< cStart2();
|
||||
Info<< "Iterate forwards over face, adding 1 to each element : "
|
||||
<< cStart2();
|
||||
|
||||
cStart2() += 1;
|
||||
cStart2() += 1;
|
||||
|
||||
Info<< " -> " << cStart2() << endl;
|
||||
} while (cStart2.circulate(CirculatorBase::CLOCKWISE));
|
||||
}
|
||||
Info<< " -> " << cStart2() << endl;
|
||||
} while (cStart2.circulate(CirculatorBase::CLOCKWISE));
|
||||
|
||||
Info<< "Face after : " << f << endl;
|
||||
|
||||
@ -151,14 +139,11 @@ int main(int argc, char *argv[])
|
||||
face fZero;
|
||||
Circulator<face> cZero(fZero);
|
||||
|
||||
if (!cZero.empty())
|
||||
if (cZero.size()) do
|
||||
{
|
||||
do
|
||||
{
|
||||
Info<< "Iterate forwards over face : " << cZero() << endl;
|
||||
Info<< "Iterate forwards over face : " << cZero() << endl;
|
||||
|
||||
} while (cZero.circulate(CirculatorBase::CLOCKWISE));
|
||||
}
|
||||
} while (cZero.circulate(CirculatorBase::CLOCKWISE));
|
||||
|
||||
fZero = face(identity(5));
|
||||
|
||||
@ -178,19 +163,16 @@ int main(int argc, char *argv[])
|
||||
ConstCirculator<face> circForward(f);
|
||||
ConstCirculator<face> circBackward(f);
|
||||
|
||||
if (circForward.size() && circBackward.size())
|
||||
if (circForward.size() && circBackward.size()) do
|
||||
{
|
||||
do
|
||||
{
|
||||
Info<< "Iterate over face forwards : " << circForward()
|
||||
<< ", backwards : " << circBackward() << endl;
|
||||
}
|
||||
while
|
||||
(
|
||||
circForward.circulate(CirculatorBase::CLOCKWISE),
|
||||
circBackward.circulate(CirculatorBase::ANTICLOCKWISE)
|
||||
);
|
||||
Info<< "Iterate over face forwards : " << circForward()
|
||||
<< ", backwards : " << circBackward() << endl;
|
||||
}
|
||||
while
|
||||
(
|
||||
circForward.circulate(CirculatorBase::CLOCKWISE),
|
||||
circBackward.circulate(CirculatorBase::ANTICLOCKWISE)
|
||||
);
|
||||
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -25,7 +24,7 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
Test-CompactListList
|
||||
CompactListListTest
|
||||
|
||||
Description
|
||||
Simple demonstration and test application for the CompactListList class.
|
||||
@ -33,7 +32,6 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "CompactListList.H"
|
||||
#include "IndirectList.H"
|
||||
#include "IOstreams.H"
|
||||
#include "StringStream.H"
|
||||
#include "faceList.H"
|
||||
@ -46,9 +44,9 @@ using namespace Foam;
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
{
|
||||
// Default construct
|
||||
// null construct
|
||||
CompactListList<label> cll1;
|
||||
Info<< "cll1:" << cll1 << nl;
|
||||
Info<< "cll1:" << cll1 << endl;
|
||||
|
||||
// Resize and assign row by row
|
||||
labelList row0(2, Zero);
|
||||
@ -63,12 +61,10 @@ int main(int argc, char *argv[])
|
||||
cll1[1].deepCopy(row1);
|
||||
Info<< "cll1:" << cll1 << endl;
|
||||
|
||||
forAll(cll1.values(), i)
|
||||
forAll(cll1.m(), i)
|
||||
{
|
||||
Info<< "i:" << i << " whichRow:" << cll1.whichRow(i) << endl;
|
||||
}
|
||||
|
||||
Info<< "unpack:" << cll1.unpack<face>() << endl;
|
||||
}
|
||||
|
||||
List<List<label>> lll(5);
|
||||
@ -78,23 +74,23 @@ int main(int argc, char *argv[])
|
||||
lll[3].setSize(0, 3);
|
||||
lll[4].setSize(1, 4);
|
||||
|
||||
Info<< "packed:" << CompactListList<label>::pack(lll) << endl;
|
||||
|
||||
auto cll2(CompactListList<label>::pack(lll));
|
||||
CompactListList<label> cll2(lll);
|
||||
|
||||
Info<< "cll2 = " << cll2 << endl;
|
||||
|
||||
forAll(cll2, i)
|
||||
{
|
||||
Info<< cll2[i] << nl;
|
||||
Info<< cll2[i] << endl;
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
|
||||
Info<< "cll2(2, 3) = " << cll2(2, 3) << nl << endl;
|
||||
cll2(2, 3) = 999;
|
||||
Info<< "cll2(2, 3) = " << cll2(2, 3) << nl << endl;
|
||||
|
||||
Info<< "cll2 as List<List<label>> " << cll2.unpack() << endl;
|
||||
Info<< "cll2 as List<List<label >> " << cll2()
|
||||
<< endl;
|
||||
|
||||
cll2.setSize(3);
|
||||
|
||||
@ -144,34 +140,16 @@ int main(int argc, char *argv[])
|
||||
Info<< "cll5 = " << cll5 << endl;
|
||||
}
|
||||
|
||||
// Make some faces
|
||||
{
|
||||
faceList fcs(5);
|
||||
forAll(fcs, facei)
|
||||
{
|
||||
fcs[facei] = face(identity(4, facei));
|
||||
}
|
||||
faceList fcs(2);
|
||||
fcs[0] = face(labelList(1, label(111)));
|
||||
fcs[1] = face(labelList(2, label(222)));
|
||||
|
||||
Info<< "input faces: " << fcs << endl;
|
||||
CompactListList<label, face> compactFcs(fcs);
|
||||
Info<< "comactFcs:" << compactFcs << endl;
|
||||
|
||||
// From <face>
|
||||
auto compactFcs(CompactListList<label>::pack<face>(fcs));
|
||||
Info<< "compact faces:" << compactFcs << endl;
|
||||
|
||||
faceList fcs2 = compactFcs.unpack<face>();
|
||||
Info<< "deserialized:" << fcs2 << endl;
|
||||
|
||||
// From some faces
|
||||
IndirectList<face> subfaces(fcs, labelList({2, 4, 1}));
|
||||
|
||||
Info<< "sub faces: " << subfaces << endl;
|
||||
|
||||
auto subCompact
|
||||
(
|
||||
CompactListList<label>::pack(subfaces)
|
||||
);
|
||||
Info<< "compact faces:" << subCompact << endl;
|
||||
Info<< "deserialized:" << subCompact.unpack() << endl;
|
||||
faceList fcs2 = compactFcs();
|
||||
Info<< "fcs2:" << fcs2 << endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user