diff --git a/dune/tectonic/factories/twoblocksfactory.cc b/dune/tectonic/factories/twoblocksfactory.cc index 44070552a4a9cdd191188d5693aa0dcbf1c836d8..a5f57cbac2bae56491f2ebe7b11400d0fb9b00de 100644 --- a/dune/tectonic/factories/twoblocksfactory.cc +++ b/dune/tectonic/factories/twoblocksfactory.cc @@ -121,7 +121,7 @@ void TwoBlocksFactory<HostGridType, VectorTEMPLATE>::setBoundaryConditions() { using Function = Dune::VirtualFunction<double, double>; std::shared_ptr<Function> neumannFunction = std::make_shared<NeumannCondition>(); - std::shared_ptr<Function> velocityDirichletFunction = std::make_shared<VelocityDirichletCondition>(this->parset_.template get<double>("boundary.dirichlet.finalVelocity")); + std::shared_ptr<Function> velocityDirichletFunction = std::make_shared<VelocityDirichletCondition>(this->parset_.template get<double>("boundary.dirichlet.finalVelocity"), 0.25); const double lengthScale = CuboidGeometry::lengthScale(); diff --git a/dune/tectonic/problem-data/bc.hh b/dune/tectonic/problem-data/bc.hh index ac82e47fdf8519f5a058e49676992708e06739a0..075f5749956a0fcf42c1b014a19875a6538c9e86 100644 --- a/dune/tectonic/problem-data/bc.hh +++ b/dune/tectonic/problem-data/bc.hh @@ -7,8 +7,9 @@ class VelocityDirichletCondition : public Dune::VirtualFunction<double, double> { public: - VelocityDirichletCondition(const double finalVelocity = 5e-5) : - finalVelocity_(finalVelocity) + VelocityDirichletCondition(const double finalVelocity = 5e-5, const double threshold = 0.1) : + finalVelocity_(finalVelocity), + threshold_(threshold) {} void evaluate(double const &relativeTime, double &y) const { @@ -21,8 +22,8 @@ class VelocityDirichletCondition else std::cout << "- final velocity reached" << std::endl;*/ - y = (relativeTime <= 0.1) - ? finalVelocity_ * (1.0 - std::cos(relativeTime * M_PI / 0.1)) / 2.0 + y = (relativeTime <= threshold_) + ? finalVelocity_ * (1.0 - std::cos(relativeTime * M_PI / threshold_)) / 2.0 : finalVelocity_; //y = relativeTime * finalVelocity; @@ -31,6 +32,7 @@ class VelocityDirichletCondition private: const double finalVelocity_; + const double threshold_; }; class NeumannCondition : public Dune::VirtualFunction<double, double> {