Skip to content

Commit

Permalink
OpenFOAM10-specific changes
Browse files Browse the repository at this point in the history
Co-authored-by: Gerasimos Chourdakis <chourdak@in.tum.de>
Co-authored-by: Jeff Heylmun <heylmun@synthetik-technologies.com>
  • Loading branch information
3 people committed Apr 26, 2024
1 parent a288580 commit 12f8da3
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 19 deletions.
34 changes: 21 additions & 13 deletions Adapter.C
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ void preciceAdapter::Adapter::reloadMeshPoints()
// TODO
// Switch oldpoints on for pure physics. (is this required?). Switch off for better mesh deformation capabilities?
// const_cast<pointField&>(mesh_.points()) = oldMeshPoints_;
const_cast<fvMesh&>(mesh_).move();
const_cast<fvMesh&>(mesh_).movePoints(meshPoints_);

DEBUG(adapterInfo("Moved mesh points to their previous locations."));
Expand Down Expand Up @@ -834,21 +835,27 @@ void preciceAdapter::Adapter::setupMeshVolCheckpointing()
DEBUG(adapterInfo("Creating a list of the mesh volume checkpointed fields..."));
// Add the V0 and the V00 to the list of checkpointed fields.
// For V0
addVolCheckpointField(
const_cast<volScalarField::Internal&>(
mesh_.V0()));
if (mesh_.foundObject<volScalarField::Internal>("V0"))
{
addVolCheckpointField(
const_cast<volScalarField::Internal&>(
mesh_.V0()));
#ifdef ADAPTER_DEBUG_MODE
adapterInfo(
"Added " + mesh_.V0().name() + " in the list of checkpointed fields.");
adapterInfo(
"Added " + mesh_.V0().name() + " in the list of checkpointed fields.");
#endif
}
// For V00
addVolCheckpointField(
const_cast<volScalarField::Internal&>(
mesh_.V00()));
if (mesh_.foundObject<volScalarField::Internal>("V00"))
{
addVolCheckpointField(
const_cast<volScalarField::Internal&>(
mesh_.V00()));
#ifdef ADAPTER_DEBUG_MODE
adapterInfo(
"Added " + mesh_.V00().name() + " in the list of checkpointed fields.");
adapterInfo(
"Added " + mesh_.V00().name() + " in the list of checkpointed fields.");
#endif
}

// Also add the buffer fields.
// TODO For V0
Expand All @@ -858,23 +865,24 @@ void preciceAdapter::Adapter::setupMeshVolCheckpointing()
(
mesh_.V0()
)
); */
);
#ifdef ADAPTER_DEBUG_MODE
adapterInfo(
"Added " + mesh_.V0().name() + " in the list of buffer checkpointed fields.");
#endif
// TODO For V00
/* addVolCheckpointFieldBuffer
addVolCheckpointFieldBuffer
(
const_cast<volScalarField::Internal&>
(
mesh_.V00()
)
);*/
);
#ifdef ADAPTER_DEBUG_MODE
adapterInfo(
"Added " + mesh_.V00().name() + " in the list of buffer checkpointed fields.");
#endif
*/
}


Expand Down
4 changes: 2 additions & 2 deletions FSI/ForceBase.C
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ Foam::tmp<Foam::volScalarField> preciceAdapter::FSI::ForceBase::mu() const
{
if (solverType_.compare("incompressible") == 0)
{
if (mesh_.foundObject<fluidThermo>(basicThermo::dictName))
if (mesh_.foundObject<fluidThermo>(physicalProperties::typeName))
{
const fluidThermo& thermo =
mesh_.lookupObject<fluidThermo>(basicThermo::dictName);
mesh_.lookupObject<fluidThermo>(physicalProperties::typeName);

return thermo.mu();
}
Expand Down
2 changes: 1 addition & 1 deletion FSI/ForceBase.H
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "pointFields.H"
#include "vectorField.H"
#include "compressibleMomentumTransportModel.H"
#include "kinematicMomentumTransportModel.H"
#include "incompressibleMomentumTransportModel.H"

namespace preciceAdapter
{
Expand Down
6 changes: 3 additions & 3 deletions Make/options
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/transportModels/ \
-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)/transportModels/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
$(ADAPTER_PKG_CONFIG_CFLAGS) \
-I../ \
Expand All @@ -16,7 +16,7 @@ EXE_INC = \
LIB_LIBS = \
-lfiniteVolume \
-lmeshTools \
-ltransportModels \
-lphysicalProperties \
-lmomentumTransportModels \
-lincompressibleMomentumTransportModels \
-lcompressibleMomentumTransportModels \
Expand Down
7 changes: 7 additions & 0 deletions preciceAdapterFunctionObject.H
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ public:
//- Write the preciceAdapterFunctionObject
bool write() final;

//- 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,
Expand Down

0 comments on commit 12f8da3

Please sign in to comment.