From 8509a095743d9a8c1c799f9a55be288214b2eb50 Mon Sep 17 00:00:00 2001 From: Eduardo Firvida Date: Sun, 31 Dec 2023 16:50:54 -0500 Subject: [PATCH 1/5] Fix: OpenFOAM 11 primitivePatchInterpolation Seems that they remove this file for some reason so I put it here --- primitivePatchInterpolation.H | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 primitivePatchInterpolation.H diff --git a/primitivePatchInterpolation.H b/primitivePatchInterpolation.H new file mode 100644 index 00000000..581fe5ba --- /dev/null +++ b/primitivePatchInterpolation.H @@ -0,0 +1,28 @@ +// copied from OpenFOAMv10 which is missing +// on newer versions + +#ifndef primitivePatchInterpolation_H +#define primitivePatchInterpolation_H + +#include "PrimitivePatchInterpolation.H" +#include "PrimitivePatch.H" +#include "face.H" +#include "SubList.H" +#include "pointField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef PrimitivePatchInterpolation + < + PrimitivePatch, const pointField&> + > + primitivePatchInterpolation; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // \ No newline at end of file From 87beea43cce9fdb3201180380b6ee772ab6b7fa6 Mon Sep 17 00:00:00 2001 From: Eduardo Firvida Date: Sun, 31 Dec 2023 18:02:41 -0500 Subject: [PATCH 2/5] Fix: OpenFOAM 11 and higher does not ship an fvCFD.h --- CHT/CHT.H | 2 -- CHT/HeatFlux.C | 2 +- CHT/HeatTransferCoefficient.C | 1 - CHT/SinkTemperature.H | 2 +- CHT/Temperature.H | 2 +- FF/FF.H | 2 -- FF/Pressure.H | 2 +- FF/PressureGradient.H | 3 ++- FF/Velocity.H | 3 ++- FF/VelocityGradient.H | 4 +++- FSI/Displacement.H | 2 +- FSI/DisplacementDelta.H | 2 +- FSI/FSI.H | 2 -- FSI/ForceBase.H | 2 +- Interface.H | 5 ++++- 15 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CHT/CHT.H b/CHT/CHT.H index bbda2fca..19616e43 100644 --- a/CHT/CHT.H +++ b/CHT/CHT.H @@ -8,8 +8,6 @@ #include "CHT/SinkTemperature.H" #include "CHT/HeatTransferCoefficient.H" -#include "fvCFD.H" - namespace preciceAdapter { namespace CHT diff --git a/CHT/HeatFlux.C b/CHT/HeatFlux.C index 64393518..a7cad4d4 100644 --- a/CHT/HeatFlux.C +++ b/CHT/HeatFlux.C @@ -1,7 +1,7 @@ #include "HeatFlux.H" #include "primitivePatchInterpolation.H" -#include "fvCFD.H" +#include "constrainPressure.H" using namespace Foam; diff --git a/CHT/HeatTransferCoefficient.C b/CHT/HeatTransferCoefficient.C index a8ff0af1..67764b99 100644 --- a/CHT/HeatTransferCoefficient.C +++ b/CHT/HeatTransferCoefficient.C @@ -1,6 +1,5 @@ #include "HeatTransferCoefficient.H" -#include "fvCFD.H" #include "mixedFvPatchFields.H" #include "primitivePatchInterpolation.H" diff --git a/CHT/SinkTemperature.H b/CHT/SinkTemperature.H index 68493e54..924758bd 100644 --- a/CHT/SinkTemperature.H +++ b/CHT/SinkTemperature.H @@ -3,7 +3,7 @@ #include "CouplingDataUser.H" #include "mixedFvPatchFields.H" -#include "fvCFD.H" +#include "findRefCell.H" namespace preciceAdapter { diff --git a/CHT/Temperature.H b/CHT/Temperature.H index d3e17d5b..9d56bdbe 100644 --- a/CHT/Temperature.H +++ b/CHT/Temperature.H @@ -3,7 +3,7 @@ #include "CouplingDataUser.H" -#include "fvCFD.H" +#include "findRefCell.H" namespace preciceAdapter { diff --git a/FF/FF.H b/FF/FF.H index ded126e0..f2f35f7d 100644 --- a/FF/FF.H +++ b/FF/FF.H @@ -8,8 +8,6 @@ #include "FF/PressureGradient.H" #include "FF/VelocityGradient.H" -#include "fvCFD.H" - namespace preciceAdapter { namespace FF diff --git a/FF/Pressure.H b/FF/Pressure.H index 32993489..5d5f7f52 100644 --- a/FF/Pressure.H +++ b/FF/Pressure.H @@ -3,7 +3,7 @@ #include "CouplingDataUser.H" -#include "fvCFD.H" +#include "findRefCell.H" namespace preciceAdapter { diff --git a/FF/PressureGradient.H b/FF/PressureGradient.H index 95094f3c..b53cdd92 100644 --- a/FF/PressureGradient.H +++ b/FF/PressureGradient.H @@ -3,7 +3,8 @@ #include "CouplingDataUser.H" -#include "fvCFD.H" +#include "findRefCell.H" +#include "constrainPressure.H" namespace preciceAdapter { diff --git a/FF/Velocity.H b/FF/Velocity.H index 8c5e396b..649f0bd6 100644 --- a/FF/Velocity.H +++ b/FF/Velocity.H @@ -3,7 +3,8 @@ #include "CouplingDataUser.H" -#include "fvCFD.H" +#include "findRefCell.H" +#include "constrainHbyA.H" namespace preciceAdapter { diff --git a/FF/VelocityGradient.H b/FF/VelocityGradient.H index 3e1f16da..20f46de5 100644 --- a/FF/VelocityGradient.H +++ b/FF/VelocityGradient.H @@ -3,7 +3,9 @@ #include "CouplingDataUser.H" -#include "fvCFD.H" +#include "findRefCell.H" +#include "constrainPressure.H" +#include "constrainHbyA.H" namespace preciceAdapter { diff --git a/FSI/Displacement.H b/FSI/Displacement.H index 8b7d5216..344ca987 100644 --- a/FSI/Displacement.H +++ b/FSI/Displacement.H @@ -3,7 +3,7 @@ #include "CouplingDataUser.H" -#include "fvCFD.H" +#include "findRefCell.H" #include "fixedValuePointPatchFields.H" #include "primitivePatchInterpolation.H" diff --git a/FSI/DisplacementDelta.H b/FSI/DisplacementDelta.H index 27c57e51..53d369d3 100644 --- a/FSI/DisplacementDelta.H +++ b/FSI/DisplacementDelta.H @@ -3,7 +3,7 @@ #include "CouplingDataUser.H" -#include "fvCFD.H" +#include "findRefCell.H" #include "fixedValuePointPatchFields.H" #include "primitivePatchInterpolation.H" diff --git a/FSI/FSI.H b/FSI/FSI.H index 52d948fa..81e9fcad 100644 --- a/FSI/FSI.H +++ b/FSI/FSI.H @@ -8,8 +8,6 @@ #include "FSI/Force.H" #include "FSI/Stress.H" -#include "fvCFD.H" - namespace preciceAdapter { namespace FSI diff --git a/FSI/ForceBase.H b/FSI/ForceBase.H index 21e6734e..fd0572d0 100644 --- a/FSI/ForceBase.H +++ b/FSI/ForceBase.H @@ -4,7 +4,7 @@ #include "CouplingDataUser.H" -#include "fvCFD.H" +#include "fvcGrad.H" #include "pointFields.H" #include "vectorField.H" diff --git a/Interface.H b/Interface.H index 3d05329e..cfd9113d 100644 --- a/Interface.H +++ b/Interface.H @@ -3,7 +3,10 @@ #include #include -#include "fvCFD.H" +#include +#include "argList.H" +#include "timeSelector.H" +#include "findRefCell.H" #include "CouplingDataUser.H" #include "precice/SolverInterface.hpp" From d5d2a514df87465280af3d8a0e3ac6ebb914af77 Mon Sep 17 00:00:00 2001 From: Eduardo Firvida Date: Sun, 31 Dec 2023 18:32:26 -0500 Subject: [PATCH 3/5] Remove duplicated code --- preciceAdapterFunctionObject.H | 7 ------- 1 file changed, 7 deletions(-) diff --git a/preciceAdapterFunctionObject.H b/preciceAdapterFunctionObject.H index 3d51fbea..d3eda1e7 100644 --- a/preciceAdapterFunctionObject.H +++ b/preciceAdapterFunctionObject.H @@ -140,13 +140,6 @@ public: return wordList::null(); } - //- Return the list of fields required - // (pure virtual since OpenFOAM 10) - virtual wordList fields() const - { - return wordList::null(); - } - /* // NOTE: If you add a new module that needs to execute methods // whenever the mesh is updated or its points moved, From b1c5d35bc31e28c085caad78b830d361f60a8762 Mon Sep 17 00:00:00 2001 From: Eduardo Firvida Date: Sun, 31 Dec 2023 18:32:45 -0500 Subject: [PATCH 4/5] Use Foam namespace --- Adapter.H | 28 ++++++++++++++-------------- CHT/CHT.H | 4 ++-- FF/FF.H | 4 ++-- FSI/FSI.H | 4 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Adapter.H b/Adapter.H index a435b2a5..36d6c560 100644 --- a/Adapter.H +++ b/Adapter.H @@ -316,53 +316,53 @@ private: // Add mesh checkpoint fields, depending on the type //- Add a surfaceScalarField mesh field - void addMeshCheckpointField(surfaceScalarField& field); + void addMeshCheckpointField(Foam::surfaceScalarField& field); //- Add a surfaceVectorField mesh field - void addMeshCheckpointField(surfaceVectorField& field); + void addMeshCheckpointField(Foam::surfaceVectorField& field); //- Add a volVectorField mesh field - void addMeshCheckpointField(volVectorField& field); + void addMeshCheckpointField(Foam::volVectorField& field); // TODO V0 and V00 checkpointed field. //- Add the V0 and V00 checkpoint fields - void addVolCheckpointField(volScalarField::Internal& field); + void addVolCheckpointField(Foam::volScalarField::Internal& field); // void addVolCheckpointFieldBuffer(volScalarField::Internal & field); // Add checkpoint fields, depending on the type //- Add a volScalarField to checkpoint - void addCheckpointField(volScalarField* field); + void addCheckpointField(Foam::volScalarField* field); //- Add a volVectorField to checkpoint - void addCheckpointField(volVectorField* field); + void addCheckpointField(Foam::volVectorField* field); //- Add a surfaceScalarField to checkpoint - void addCheckpointField(surfaceScalarField* field); + void addCheckpointField(Foam::surfaceScalarField* field); //- Add a surfaceVectorField to checkpoint - void addCheckpointField(surfaceVectorField* field); + void addCheckpointField(Foam::surfaceVectorField* field); //- Add a pointScalarField to checkpoint - void addCheckpointField(pointScalarField* field); + void addCheckpointField(Foam::pointScalarField* field); //- Add a pointVectorField to checkpoint - void addCheckpointField(pointVectorField* field); + void addCheckpointField(Foam::pointVectorField* field); // NOTE: Add here methods to add other object types to checkpoint, // if needed. //- Add a volTensorField to checkpoint - void addCheckpointField(volTensorField* field); + void addCheckpointField(Foam::volTensorField* field); //- Add a surfaceTensorField to checkpoint - void addCheckpointField(surfaceTensorField* field); + void addCheckpointField(Foam::surfaceTensorField* field); //- Add a pointTensorField to checkpoint - void addCheckpointField(pointTensorField* field); + void addCheckpointField(Foam::pointTensorField* field); //- Add a volSymmTensorField to checkpoint - void addCheckpointField(volSymmTensorField* field); + void addCheckpointField(Foam::volSymmTensorField* field); //- Read the checkpoint - restore the mesh fields and time void readMeshCheckpoint(); diff --git a/CHT/CHT.H b/CHT/CHT.H index 19616e43..77916c2a 100644 --- a/CHT/CHT.H +++ b/CHT/CHT.H @@ -48,14 +48,14 @@ protected: std::string determineSolverType(); //- Read the CHT-related options from the adapter's configuration file - bool readConfig(const IOdictionary& adapterConfig); + bool readConfig(const Foam::IOdictionary& adapterConfig); public: //- Constructor ConjugateHeatTransfer(const Foam::fvMesh& mesh); //- Configure - bool configure(const IOdictionary& adapterConfig); + bool configure(const Foam::IOdictionary& adapterConfig); //- Add coupling data writers bool addWriters(std::string dataName, Interface* interface); diff --git a/FF/FF.H b/FF/FF.H index f2f35f7d..61e42bcc 100644 --- a/FF/FF.H +++ b/FF/FF.H @@ -35,14 +35,14 @@ protected: std::string determineSolverType(); //- Read the FF-related options from the adapter's configuration file - bool readConfig(const IOdictionary& adapterConfig); + bool readConfig(const Foam::IOdictionary& adapterConfig); public: //- Constructor FluidFluid(const Foam::fvMesh& mesh); //- Configure - bool configure(const IOdictionary& adapterConfig); + bool configure(const Foam::IOdictionary& adapterConfig); //- Add coupling data writers bool addWriters(std::string dataName, Interface* interface); diff --git a/FSI/FSI.H b/FSI/FSI.H index 81e9fcad..fd2df0cf 100644 --- a/FSI/FSI.H +++ b/FSI/FSI.H @@ -49,7 +49,7 @@ protected: std::string determineSolverType(); //- Read the FSI-related options from the adapter's configuration file - bool readConfig(const IOdictionary& adapterConfig); + bool readConfig(const Foam::IOdictionary& adapterConfig); public: //- Constructor @@ -57,7 +57,7 @@ public: FluidStructureInteraction(const Foam::fvMesh& mesh, const Foam::Time& runTime); //- Configure - bool configure(const IOdictionary& adapterConfig); + bool configure(const Foam::IOdictionary& adapterConfig); //- Add coupling data writers bool addWriters(std::string dataName, Interface* interface); From e9b6e41236177d04441ea6af47b9cf74970d8f03 Mon Sep 17 00:00:00 2001 From: Eduardo Firvida Date: Sun, 31 Dec 2023 18:39:14 -0500 Subject: [PATCH 5/5] Update wmake options files --- Make/options | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Make/options b/Make/options index fc31eb84..819549d4 100644 --- a/Make/options +++ b/Make/options @@ -1,13 +1,12 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/physicalProperties/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ - -I$(LIB_SRC)/physicalProperties/lnInclude \ - -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \ + -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ + -I$(LIB_SRC)/physicalProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/thermophysicalTransportModel/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude \ $(ADAPTER_PKG_CONFIG_CFLAGS) \ -I../ \ @@ -20,7 +19,7 @@ LIB_LIBS = \ -lmomentumTransportModels \ -lincompressibleMomentumTransportModels \ -lcompressibleMomentumTransportModels \ - -lthermophysicalTransportModels \ - -limmiscibleIncompressibleTwoPhaseMixture \ + -lthermophysicalTransportModel \ + -lfluidThermophysicalModels \ $(ADAPTER_PKG_CONFIG_LIBS) \ -lprecice