Skip to content
Snippets Groups Projects
Commit 48d8685b authored by podlesny's avatar podlesny
Browse files

generalize velocity boundary condition to allow setting loading time, previously 0.1 fix

parent 52b7a5f0
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
......@@ -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> {
......
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