Skip to content
Snippets Groups Projects
Commit c007b1f3 authored by Alexander Jaust's avatar Alexander Jaust
Browse files

added files for reverse coupling of preCICE and DuMuX

parent 1d381ad7
No related branches found
No related tags found
1 merge request!6Feature/ff pm coupling fvca cleanup (to be moved into dumux-pub/jaust2020a)
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* 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 2 of the License, or *
* (at your option) any later version. *
* *
* 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 for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
* \ingroup OnePTests
* \brief The spatial parameters class for the test problem using the 1p cc model
*/
#ifndef DUMUX_1P_TEST_SPATIALPARAMS_HH
#define DUMUX_1P_TEST_SPATIALPARAMS_HH
#include <dumux/material/spatialparams/fv1p.hh>
namespace Dumux {
/*!
* \ingroup OnePModel
*
* \brief The spatial parameters class for the test problem using the
* 1p cc model
*/
template<class FVGridGeometry, class Scalar>
class OnePSpatialParams
: public FVSpatialParamsOneP<FVGridGeometry, Scalar, OnePSpatialParams<FVGridGeometry, Scalar>>
{
using GridView = typename FVGridGeometry::GridView;
using ParentType = FVSpatialParamsOneP<FVGridGeometry, Scalar, OnePSpatialParams<FVGridGeometry, Scalar>>;
using Element = typename GridView::template Codim<0>::Entity;
using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
public:
// export permeability type
using PermeabilityType = Scalar;
OnePSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
: ParentType(fvGridGeometry)
{
permeability_ = getParam<Scalar>("Darcy.SpatialParams.Permeability");
porosity_ = getParam<Scalar>("Darcy.SpatialParams.Porosity");
alphaBJ_ = getParam<Scalar>("Darcy.SpatialParams.AlphaBeaversJoseph");
}
/*!
* \brief Function for defining the (intrinsic) permeability \f$[m^2]\f$.
*
* \param globalPos The global position
* \return the intrinsic permeability
*/
PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const
{ return permeability_; }
/*! \brief Define the porosity in [-].
*
* \param globalPos The global position
*/
Scalar porosityAtPos(const GlobalPosition& globalPos) const
{ return porosity_; }
/*! \brief Define the Beavers-Joseph coefficient in [-].
*
* \param globalPos The global position
*/
Scalar beaversJosephCoeffAtPos(const GlobalPosition& globalPos) const
{ return alphaBJ_; }
private:
Scalar permeability_;
Scalar porosity_;
Scalar alphaBJ_;
};
} // end namespace
#endif
<?xml version="1.0"?>
<precice-configuration>
<log>
<sink type="stream" output="stdout" filter= "(%Severity% > debug) or (%Severity% >= trace and %Module% contains SolverInterfaceImpl)" enabled="false" />
<sink type="stream" output="stdout" enabled="false" />
</log>
<solver-interface dimensions="2">
<data:scalar name="Velocity"/>
<data:scalar name="Pressure"/>
<mesh name="FreeFlowMesh">
<use-data name="Velocity" />
<use-data name="Pressure" />
</mesh>
<mesh name="DarcyMesh">
<use-data name="Velocity" />
<use-data name="Pressure" />
</mesh>
<participant name="FreeFlow">
<use-mesh name="FreeFlowMesh" provide="yes"/>
<use-mesh name="DarcyMesh" from="Darcy"/>
<read-data name="Velocity" mesh="FreeFlowMesh"/>
<write-data name="Pressure" mesh="FreeFlowMesh"/>
<mapping:nearest-neighbor direction="write" from="FreeFlowMesh" to="DarcyMesh" constraint="consistent"/>
<mapping:nearest-neighbor direction="read" from="DarcyMesh" to="FreeFlowMesh" constraint="consistent"/>
</participant>
<participant name="Darcy">
<use-mesh name="DarcyMesh" provide="yes"/>
<read-data name="Pressure" mesh="DarcyMesh"/>
<write-data name="Velocity" mesh="DarcyMesh"/>
</participant>
<m2n:sockets from="FreeFlow" to="Darcy" distribution-type="gather-scatter" network="lo" exchange-directory="/tmp/coupling" />
<coupling-scheme:serial-implicit>
<max-time value="100"/>
<timestep-length value="1" />
<max-iterations value="100"/>
<participants first="FreeFlow" second="Darcy"/>
<!--
<participants first="Darcy" second="FreeFlow"/>
-->
<exchange data="Pressure" mesh="FreeFlowMesh" from="FreeFlow" to="Darcy" initialize="false" />
<exchange data="Velocity" mesh="FreeFlowMesh" from="Darcy" to="FreeFlow" initialize="true" />
<!--
<relative-convergence-measure limit="1.0e-6" data="Velocity" mesh="FreeFlowMesh"/>
-->
<relative-convergence-measure limit="1.0e-8" data="Pressure" mesh="DarcyMesh"/>
<relative-convergence-measure limit="1.0e-8" data="Velocity" mesh="DarcyMesh"/>
<!--
<relative-convergence-measure limit="1.0e-2" data="Velocity" mesh="FreeFlowMesh"/>
-->
<!--
<extrapolation-order value="0"/>
<post-processing:IQN-ILS>
<data mesh="DarcyMesh" name="Velocity" />
<initial-relaxation value="0.1" />
<max-used-iterations value="9" />
<timesteps-reused value="10" />
<filter type="QR2" limit="1e-3" />
</post-processing:IQN-ILS>
-->
</coupling-scheme:serial-implicit>
</solver-interface>
</precice-configuration>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment