Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@

# OpenFOAM / WMake
lnInclude/
Make/linux64GccDPInt32Opt/
Make/darwin64ClangDPInt32Opt/
Make/linux64*/
Make/darwin64*/

# Editors
.cproject
Expand Down
192 changes: 126 additions & 66 deletions Adapter.C

Large diffs are not rendered by default.

66 changes: 47 additions & 19 deletions Adapter.H
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
/*---------------------------------------------------------------------------*\
Copyright (C) 2017 Gerasimos Chourdakis
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
* Copyright (C) 2025 Gesellschaft fuer Anlagen- und Reaktorsicherheit *
* (GRS) gGmbH *
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM-preCICE adapter.

This program 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 with terms added by GRS.

This program 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 with terms by GRS for more details.

You should have received a copy of the GNU General Public License
with terms by GRS along with this program. If not, please
contact your conveyor or GRS gGmbH.
For a copy of the unmodified GNU General Public License, see
<http://www.gnu.org/licenses/>.

\*---------------------------------------------------------------------------*/

#ifndef PRECICEADAPTER_H
#define PRECICEADAPTER_H

Expand Down Expand Up @@ -294,10 +322,9 @@ private:
//- Configure the checkpointing
void setupCheckpointing();

//- Remove checkpointed fields which are not used by OpenFOAM anymore
//- Remove checkpointed fields which are not used by OpenFOAM anymore and update pointer
void pruneCheckpointedFields();


//- Make a copy of the runTime object
void storeCheckpointTime();

Expand All @@ -312,53 +339,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 addVolCheckpointFieldBuffer(volScalarField::Internal & field);
void addVolCheckpointField(Foam::volScalarField::Internal& field);
// void addVolCheckpointFieldBuffer(Foam::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();
Expand Down Expand Up @@ -395,8 +422,9 @@ public:
//- Called by the functionObject's execute()
void execute();

//- Called by the functionObject's adjustTimeStep()
void adjustTimeStep();
//- Not called by OpenFOAM.org since OpenFOAM 9
// See https://github.com/precice/openfoam-adapter/issues/261
void setTimeStep();

//- Called by the functionObject's end()
void end();
Expand Down
34 changes: 30 additions & 4 deletions CHT/CHT.H
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
/*---------------------------------------------------------------------------*\
Copyright (C) 2017 Gerasimos Chourdakis
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
* Copyright (C) 2025 Gesellschaft fuer Anlagen- und Reaktorsicherheit *
* (GRS) gGmbH *
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM-preCICE adapter.

This program 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 with terms added by GRS.

This program 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 with terms by GRS for more details.

You should have received a copy of the GNU General Public License
with terms by GRS along with this program. If not, please
contact your conveyor or GRS gGmbH.
For a copy of the unmodified GNU General Public License, see
<http://www.gnu.org/licenses/>.

\*---------------------------------------------------------------------------*/

#ifndef CHT_H
#define CHT_H

Expand All @@ -8,8 +36,6 @@
#include "CHT/SinkTemperature.H"
#include "CHT/HeatTransferCoefficient.H"

#include "fvCFD.H"

namespace preciceAdapter
{
namespace CHT
Expand Down Expand Up @@ -50,14 +76,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);
Expand Down
34 changes: 31 additions & 3 deletions CHT/HeatFlux.C
Original file line number Diff line number Diff line change
@@ -1,7 +1,35 @@
/*---------------------------------------------------------------------------*\
Copyright (C) 2017 Gerasimos Chourdakis
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
* Copyright (C) 2025 Gesellschaft fuer Anlagen- und Reaktorsicherheit *
* (GRS) gGmbH *
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM-preCICE adapter.

This program 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 with terms added by GRS.

This program 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 with terms by GRS for more details.

You should have received a copy of the GNU General Public License
with terms by GRS along with this program. If not, please
contact your conveyor or GRS gGmbH.
For a copy of the unmodified GNU General Public License, see
<http://www.gnu.org/licenses/>.

\*---------------------------------------------------------------------------*/

#include "HeatFlux.H"
#include "primitivePatchInterpolation.H"

#include "fvCFD.H"
#include "volFields.H"
#include "fixedGradientFvPatchFields.H"

using namespace Foam;

Expand Down Expand Up @@ -160,7 +188,7 @@ preciceAdapter::CHT::HeatFlux_Incompressible::HeatFlux_Incompressible(
const std::string namePr,
const std::string nameAlphat)
: HeatFlux(mesh, nameT),
Kappa_(new KappaEff_Incompressible(mesh, nameRho, nameCp, namePr, nameAlphat))
Kappa_(new KappaEff_Incompressible(mesh))
{
}

Expand Down
31 changes: 29 additions & 2 deletions CHT/HeatTransferCoefficient.C
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
/*---------------------------------------------------------------------------*\
Copyright (C) 2017 Gerasimos Chourdakis
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
* Copyright (C) 2025 Gesellschaft fuer Anlagen- und Reaktorsicherheit *
* (GRS) gGmbH *
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM-preCICE adapter.

This program 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 with terms added by GRS.

This program 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 with terms by GRS for more details.

You should have received a copy of the GNU General Public License
with terms by GRS along with this program. If not, please
contact your conveyor or GRS gGmbH.
For a copy of the unmodified GNU General Public License, see
<http://www.gnu.org/licenses/>.

\*---------------------------------------------------------------------------*/

#include "HeatTransferCoefficient.H"

#include "fvCFD.H"
#include "mixedFvPatchFields.H"
#include "primitivePatchInterpolation.H"

Expand Down Expand Up @@ -179,7 +206,7 @@ preciceAdapter::CHT::HeatTransferCoefficient_Incompressible::
const std::string namePr,
const std::string nameAlphat)
: HeatTransferCoefficient(mesh, nameT),
Kappa_(new KappaEff_Incompressible(mesh, nameRho, nameCp, namePr, nameAlphat))
Kappa_(new KappaEff_Incompressible(mesh))
{
}

Expand Down
Loading