Loading [MathJax]/extensions/tex2jax.js
3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
freeflow/navierstokes/momentum/problem.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*****************************************************************************
4 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
24#ifndef DUMUX_NAVIERSTOKES_MOMENTUM_PROBLEM_HH
25#define DUMUX_NAVIERSTOKES_MOMENTUM_PROBLEM_HH
26
27#include <dune/common/exceptions.hh>
28#include <dune/common/typetraits.hh>
34
35namespace Dumux {
36
37template<class TypeTag, class DiscretizationMethod>
39
40template<class TypeTag>
41class NavierStokesMomentumProblemImpl<TypeTag, DiscretizationMethods::FCStaggered>
42: public FVProblemWithSpatialParams<TypeTag>
43{
45 using Implementation = GetPropType<TypeTag, Properties::Problem>;
46
48 using GridView = typename GridGeometry::GridView;
49 using Element = typename GridView::template Codim<0>::Entity;
50
52 using GridVolumeVariables = typename GridVariables::GridVolumeVariables;
53 using ElementVolumeVariables = typename GridVolumeVariables::LocalView;
55
56 using FVElementGeometry = typename GridGeometry::LocalView;
57 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
58 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
60
61 enum {
62 dim = GridView::dimension,
63 dimWorld = GridView::dimensionworld
64 };
65
66 using GlobalPosition = typename SubControlVolumeFace::GlobalPosition;
67 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
68 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
71
72 static constexpr bool isCoupled_ = !std::is_empty_v<CouplingManager>;
73
74
75public:
79 using InitialValues = Dune::FieldVector<Scalar, dimWorld>;
80 using Sources = Dune::FieldVector<Scalar, dimWorld>;
81 using DirichletValues = Dune::FieldVector<Scalar, dimWorld>;
82 using BoundaryFluxes = Dune::FieldVector<Scalar, dimWorld>;
83
84 using MomentumFluxType = Dune::FieldVector<Scalar, dimWorld>;
85
88
90 static constexpr bool isMomentumProblem() { return true; }
91
98 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
99 std::shared_ptr<CouplingManager> couplingManager,
100 const std::string& paramGroup = "")
101 : ParentType(gridGeometry, paramGroup)
102 , gravity_(0.0)
103 , couplingManager_(couplingManager)
104 {
105 if (getParamFromGroup<bool>(paramGroup, "Problem.EnableGravity"))
106 gravity_[dim-1] = -9.81;
107
108 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup, "Problem.EnableInertiaTerms");
109 }
110
116 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
117 const std::string& paramGroup = "")
118 : NavierStokesMomentumProblemImpl(gridGeometry, {}, paramGroup)
119 {}
120
139 Sources source(const Element& element,
140 const FVElementGeometry& fvGeometry,
141 const ElementVolumeVariables& elemVolVars,
142 const SubControlVolume& scv) const
143 {
144 // forward to solution independent, fully-implicit specific interface
145 return asImp_().sourceAtPos(scv.dofPosition());
146 }
147
161 Sources sourceAtPos(const GlobalPosition& globalPos) const
162 {
165 return Sources(0.0);
166 }
167
175 auto boundaryTypes(const Element& element,
176 const SubControlVolumeFace& scvf) const
177 {
178 // Forward it to the method which only takes the global coordinate.
179 // We evaluate the boundary type at the center of the sub control volume face
180 // in order to avoid ambiguities at domain corners.
181 return asImp_().boundaryTypesAtPos(scvf.center());
182 }
183
192 DirichletValues dirichlet(const Element& element, const SubControlVolumeFace& scvf) const
193 {
194 return asImp_().dirichletAtPos(scvf.ipGlobal());
195 }
196
206 template<class ElementFluxVariablesCache>
207 BoundaryFluxes neumann(const Element& element,
208 const FVElementGeometry& fvGeometry,
209 const ElementVolumeVariables& elemVolVars,
210 const ElementFluxVariablesCache& elemFluxVarsCache,
211 const SubControlVolumeFace& scvf) const
212 { return asImp_().neumannAtPos(scvf.ipGlobal()); }
213
217 BoundaryFluxes neumannAtPos(const GlobalPosition& globalPos) const
218 { return BoundaryFluxes(0.0); }
219
226 const GravityVector& gravity() const
227 { return gravity_; }
228
233 { return enableInertiaTerms_; }
234
239 Scalar pressure(const Element& element,
240 const FVElementGeometry& fvGeometry,
241 const SubControlVolumeFace& scvf) const
242 {
243 if constexpr (isCoupled_)
244 return couplingManager_->pressure(element, fvGeometry, scvf);
245 else
246 return asImp_().pressureAtPos(scvf.ipGlobal());
247 }
248
252 Scalar pressureAtPos(const GlobalPosition&) const
253 {
254 DUNE_THROW(Dune::NotImplemented, "pressureAtPos not implemented");
255 }
256
263 Scalar referencePressure(const Element& element,
264 const FVElementGeometry& fvGeometry,
265 const SubControlVolumeFace& scvf) const
266 { return 0.0; }
267
272 Scalar density(const Element& element,
273 const FVElementGeometry& fvGeometry,
274 const SubControlVolumeFace& scvf) const
275 {
276 if constexpr (isCoupled_)
277 return couplingManager_->density(element, fvGeometry, scvf);
278 else
279 return asImp_().densityAtPos(scvf.ipGlobal());
280 }
281
286 Scalar density(const Element& element,
287 const SubControlVolume& scv,
288 const bool isPreviousTimeStep = false) const
289 {
290 if constexpr (isCoupled_)
291 return couplingManager_->density(element, scv, isPreviousTimeStep);
292 else
293 return asImp_().densityAtPos(scv.dofPosition());
294 }
295
296 auto insideAndOutsideDensity(const Element& element,
297 const FVElementGeometry& fvGeometry,
298 const SubControlVolumeFace& scvf,
299 const bool isPreviousTimeStep = false) const
300 {
301 if constexpr (isCoupled_)
302 return couplingManager_->insideAndOutsideDensity(element, fvGeometry, scvf, isPreviousTimeStep);
303 else
304 {
305 const auto rho = asImp_().densityAtPos(scvf.ipGlobal());
306 return std::make_pair(rho, rho);
307 }
308 }
309
313 Scalar densityAtPos(const GlobalPosition&) const
314 {
315 DUNE_THROW(Dune::NotImplemented, "densityAtPos not implemented");
316 }
317
322 Scalar effectiveViscosity(const Element& element,
323 const FVElementGeometry& fvGeometry,
324 const SubControlVolumeFace& scvf) const
325 {
326 if constexpr (isCoupled_)
327 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
328 else
329 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
330 }
331
335 Scalar effectiveViscosityAtPos(const GlobalPosition&) const
336 {
337 DUNE_THROW(Dune::NotImplemented, "effectiveViscosityAtPos not implemented");
338 }
339
344 template<class SolutionVector>
345 void applyInitialSolution(SolutionVector& sol) const
346 {
347 sol.resize(this->gridGeometry().numDofs());
348 std::vector<bool> dofHandled(this->gridGeometry().numDofs(), false);
349 auto fvGeometry = localView(this->gridGeometry());
350 for (const auto& element : elements(this->gridGeometry().gridView()))
351 {
352 fvGeometry.bindElement(element);
353 for (const auto& scv : scvs(fvGeometry))
354 {
355 const auto dofIdx = scv.dofIndex();
356 if (!dofHandled[dofIdx])
357 {
358 dofHandled[dofIdx] = true;
359 sol[dofIdx] = asImp_().initial(scv)[scv.dofAxis()];
360 }
361 }
362 }
363 }
364
368 InitialValues initial(const SubControlVolume& scv) const
369 {
370 return asImp_().initialAtPos(scv.dofPosition());
371 }
372
374 Scalar pseudo3DWallFriction(const Element& element,
375 const FVElementGeometry& fvGeometry,
376 const ElementVolumeVariables& elemVolVars,
377 const SubControlVolume& scv,
378 const Scalar height,
379 const Scalar factor = 8.0) const
380 {
381 const Scalar velocity = elemVolVars[scv].velocity();
382 const auto scvf = scvfs(fvGeometry, scv).begin();
383 const Scalar viscosity = effectiveViscosity(element, fvGeometry, *scvf);
384 return pseudo3DWallFriction(velocity, viscosity, height, factor);
385 }
386
400 Scalar pseudo3DWallFriction(const Scalar velocity,
401 const Scalar viscosity,
402 const Scalar height,
403 const Scalar factor = 8.0) const
404 {
405 static_assert(dim == 2, "Pseudo 3D wall friction may only be used in 2D");
406 return -factor * velocity * viscosity / (height*height);
407 }
408
414 bool onSlipBoundary(const FVElementGeometry& fvGeometry, const SubControlVolumeFace& scvf) const
415 { return asImp_().onSlipBoundaryAtPos(scvf.center()); }
416
421 bool onSlipBoundaryAtPos(const GlobalPosition& pos) const
422 { return false; }
423
428 Scalar permeability(const FVElementGeometry& fvGeometry, const SubControlVolumeFace& scvf) const
429 {
430 DUNE_THROW(Dune::NotImplemented,
431 "When using the Beavers-Joseph-Saffman boundary condition, "
432 "the permeability must be returned in the actual problem"
433 );
434 }
435
440 Scalar alphaBJ(const FVElementGeometry& fvGeometry, const SubControlVolumeFace& scvf) const
441 {
442 DUNE_THROW(Dune::NotImplemented,
443 "When using the Beavers-Joseph-Saffman boundary condition, "
444 "the alpha value must be returned in the actual problem"
445 );
446 }
447
451 Scalar betaBJ(const FVElementGeometry& fvGeometry, const SubControlVolumeFace& scvf, const GlobalPosition& tangentialVector) const
452 {
453 const Scalar interfacePermeability = interfacePermeability_(fvGeometry, scvf, tangentialVector);
454 using std::sqrt;
455 return asImp_().alphaBJ(fvGeometry, scvf) / sqrt(interfacePermeability);
456 }
457
461 VelocityVector porousMediumVelocity(const FVElementGeometry& fvGeometry, const SubControlVolumeFace& scvf) const
462 {
463 return VelocityVector(0.0);
464 }
465
470 const VelocityVector beaversJosephVelocity(const FVElementGeometry& fvGeometry,
471 const SubControlVolumeFace& scvf,
472 const ElementVolumeVariables& elemVolVars,
473 Scalar tangentialVelocityGradient) const
474 {
475 assert(scvf.isLateral());
476 assert(scvf.boundary());
477
478 const auto& scv = fvGeometry.scv(scvf.insideScvIdx());
479
480 // create a unit normal vector oriented in positive coordinate direction
481 GlobalPosition orientation(0.0);
482 orientation[scv.dofAxis()] = 1.0;
483
484 // du/dy + dv/dx = beta * (u_boundary-uPM)
485 // beta = alpha/sqrt(K)
486 const Scalar betaBJ = asImp_().betaBJ(fvGeometry, scvf, orientation);
487 const Scalar distanceNormalToBoundary = (scvf.ipGlobal() - scv.dofPosition()).two_norm();
488
489 static const bool onlyNormalGradient = getParamFromGroup<bool>(this->paramGroup(), "FreeFlow.EnableUnsymmetrizedVelocityGradientForBeaversJoseph", false);
490 if (onlyNormalGradient)
491 tangentialVelocityGradient = 0.0;
492
493 const Scalar scalarSlipVelocity = (tangentialVelocityGradient*distanceNormalToBoundary
494 + asImp_().porousMediumVelocity(fvGeometry, scvf) * orientation * betaBJ * distanceNormalToBoundary
495 + elemVolVars[scv].velocity()) / (betaBJ*distanceNormalToBoundary + 1.0);
496
497 orientation *= scalarSlipVelocity;
498 return orientation;
499 }
500
501 const CouplingManager& couplingManager() const
502 {
503 if constexpr (isCoupled_)
504 return *couplingManager_;
505 else
506 DUNE_THROW(Dune::InvalidStateException,
507 "Accessing coupling manager of an uncoupled problem is not possible."
508 );
509 }
510
511private:
513 template<class Scvf>
514 Scalar interfacePermeability_(const FVElementGeometry& fvGeometry, const Scvf& scvf, const GlobalPosition& tangentialVector) const
515 {
516 const auto& K = asImp_().permeability(fvGeometry, scvf);
517
518 // use t*K*t for permeability tensors
519 if constexpr (Dune::IsNumber<std::decay_t<decltype(K)>>::value)
520 return K;
521 else
522 return vtmv(tangentialVector, K, tangentialVector);
523 }
524
526 Implementation& asImp_()
527 { return *static_cast<Implementation *>(this); }
528
530 const Implementation& asImp_() const
531 { return *static_cast<const Implementation *>(this); }
532
533 GravityVector gravity_;
534 bool enableInertiaTerms_;
535 std::shared_ptr<CouplingManager> couplingManager_;
536};
537
541template<class TypeTag, class DM>
542class NavierStokesMomentumProblemImpl<TypeTag, DiscretizationMethods::CVFE<DM>>
543: public FVProblemWithSpatialParams<TypeTag>
544{
546 using Implementation = GetPropType<TypeTag, Properties::Problem>;
547
549 using GridView = typename GridGeometry::GridView;
550 using Element = typename GridView::template Codim<0>::Entity;
551
553 using GridVolumeVariables = typename GridVariables::GridVolumeVariables;
554 using ElementVolumeVariables = typename GridVolumeVariables::LocalView;
556
557 using FVElementGeometry = typename GridGeometry::LocalView;
558 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
559 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
561
562 static constexpr int dim = GridView::dimension;
563 static constexpr int dimWorld = GridView::dimensionworld;
564
565 using GlobalPosition = typename SubControlVolumeFace::GlobalPosition;
566 using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
567 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
570
571 static constexpr bool isVertexCentered
572 = GridGeometry::discMethod == DiscretizationMethods::box
573 || GridGeometry::discMethod == DiscretizationMethods::pq1bubble;
574
575public:
579 using InitialValues = Dune::FieldVector<Scalar, dimWorld>;
580 using Sources = Dune::FieldVector<Scalar, dimWorld>;
581 using DirichletValues = Dune::FieldVector<Scalar, dimWorld>;
582 using BoundaryFluxes = Dune::FieldVector<Scalar, dimWorld>;
583
586
588 static constexpr bool isMomentumProblem() { return true; }
589
596 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
597 std::shared_ptr<CouplingManager> couplingManager,
598 const std::string& paramGroup = "")
599 : ParentType(gridGeometry, paramGroup)
600 , gravity_(0.0)
601 , couplingManager_(couplingManager)
602 {
603 if (getParamFromGroup<bool>(paramGroup, "Problem.EnableGravity"))
604 gravity_[dim-1] = -9.81;
605
606 enableInertiaTerms_ = getParamFromGroup<bool>(paramGroup, "Problem.EnableInertiaTerms");
607 }
608
614 NavierStokesMomentumProblemImpl(std::shared_ptr<const GridGeometry> gridGeometry,
615 const std::string& paramGroup = "")
616 : NavierStokesMomentumProblemImpl(gridGeometry, {}, paramGroup)
617 {}
618
637 template<class ElementVolumeVariables>
638 Sources source(const Element &element,
639 const FVElementGeometry& fvGeometry,
640 const ElementVolumeVariables& elemVolVars,
641 const SubControlVolume &scv) const
642 {
643 // forward to solution independent, fully-implicit specific interface
644 return asImp_().sourceAtPos(scv.center());
645 }
646
660 Sources sourceAtPos(const GlobalPosition &globalPos) const
661 {
664 return Sources(0.0);
665 }
666
674 BoundaryTypes boundaryTypes(const Element& element,
675 const SubControlVolume& scv) const
676 {
677 if (!isVertexCentered)
678 DUNE_THROW(Dune::InvalidStateException,
679 "boundaryTypes(..., scv) called for for a non vertex-centered method.");
680
681 // forward it to the method which only takes the global coordinate
682 return asImp_().boundaryTypesAtPos(scv.dofPosition());
683 }
684
692 BoundaryTypes boundaryTypes(const Element& element,
693 const SubControlVolumeFace& scvf) const
694 {
695 if (isVertexCentered)
696 DUNE_THROW(Dune::InvalidStateException,
697 "boundaryTypes(..., scvf) called for a vertex-centered method.");
698
699 // forward it to the method which only takes the global coordinate
700 return asImp_().boundaryTypesAtPos(scvf.ipGlobal());
701 }
702
710 DirichletValues dirichlet(const Element& element, const SubControlVolume& scv) const
711 {
712 // forward it to the method which only takes the global coordinate
713 if (!isVertexCentered)
714 DUNE_THROW(Dune::InvalidStateException, "dirichlet(scv) called for a non vertex-centered method.");
715 else
716 return asImp_().dirichletAtPos(scv.dofPosition());
717 }
718
726 DirichletValues dirichlet(const Element& element, const SubControlVolumeFace& scvf) const
727 {
728 // forward it to the method which only takes the global coordinate
729 if (isVertexCentered)
730 DUNE_THROW(Dune::InvalidStateException, "dirichlet(scvf) called for vertex-centered method.");
731 else
732 return asImp_().dirichletAtPos(scvf.ipGlobal());
733 }
734
741 const GravityVector& gravity() const
742 { return gravity_; }
743
748 { return enableInertiaTerms_; }
749
756 Scalar referencePressure() const
757 { return 0.0; }
758
763 Scalar pressure(const Element& element,
764 const FVElementGeometry& fvGeometry,
765 const SubControlVolumeFace& scvf) const
766 {
767 if constexpr (std::is_empty_v<CouplingManager>)
768 return asImp_().pressureAtPos(scvf.ipGlobal());
769 else
770 return couplingManager_->pressure(element, fvGeometry, scvf);
771 }
772
777 Scalar pressure(const Element& element,
778 const FVElementGeometry& fvGeometry,
779 const SubControlVolume& scv,
780 const bool isPreviousTimeStep = false) const
781 {
782 if constexpr (std::is_empty_v<CouplingManager>)
783 return asImp_().pressureAtPos(scv.dofPosition());
784 else
785 return couplingManager_->pressure(element, fvGeometry, scv, isPreviousTimeStep);
786 }
787
791 Scalar pressureAtPos(const GlobalPosition&) const
792 {
793 DUNE_THROW(Dune::NotImplemented, "pressureAtPos not implemented");
794 }
795
800 Scalar density(const Element& element,
801 const FVElementGeometry& fvGeometry,
802 const SubControlVolumeFace& scvf) const
803 {
804 if constexpr (std::is_empty_v<CouplingManager>)
805 return asImp_().densityAtPos(scvf.ipGlobal());
806 else
807 return couplingManager_->density(element, fvGeometry, scvf);
808 }
809
814 Scalar density(const Element& element,
815 const FVElementGeometry& fvGeometry,
816 const SubControlVolume& scv,
817 const bool isPreviousTimeStep = false) const
818 {
819 if constexpr (std::is_empty_v<CouplingManager>)
820 return asImp_().densityAtPos(scv.dofPosition());
821 else
822 return couplingManager_->density(element, fvGeometry, scv, isPreviousTimeStep);
823 }
824
825
829 Scalar densityAtPos(const GlobalPosition&) const
830 {
831 DUNE_THROW(Dune::NotImplemented, "densityAtPos not implemented");
832 }
833
838 Scalar effectiveViscosity(const Element& element,
839 const FVElementGeometry& fvGeometry,
840 const SubControlVolumeFace& scvf) const
841 {
842 if constexpr (std::is_empty_v<CouplingManager>)
843 return asImp_().effectiveViscosityAtPos(scvf.ipGlobal());
844 else
845 return couplingManager_->effectiveViscosity(element, fvGeometry, scvf);
846 }
847
852 Scalar effectiveViscosity(const Element& element,
853 const FVElementGeometry& fvGeometry,
854 const SubControlVolume& scv) const
855 {
856 if constexpr (std::is_empty_v<CouplingManager>)
857 return asImp_().effectiveViscosityAtPos(scv.dofPosition());
858 else
859 return couplingManager_->effectiveViscosity(element, fvGeometry, scv);
860 }
861
865 Scalar effectiveViscosityAtPos(const GlobalPosition&) const
866 {
867 DUNE_THROW(Dune::NotImplemented, "effectiveViscosityAtPos not implemented");
868 }
869
874 template<class SolutionVector>
875 void applyInitialSolution(SolutionVector& sol) const
876 {
877 static_assert(GridGeometry::discMethod == DiscretizationMethods::CVFE<DM>{});
878 sol.resize(this->gridGeometry().numDofs());
879 std::vector<bool> dofHandled(this->gridGeometry().numDofs(), false);
880 auto fvGeometry = localView(this->gridGeometry());
881 for (const auto& element : elements(this->gridGeometry().gridView()))
882 {
883 fvGeometry.bindElement(element);
884 for (const auto& scv : scvs(fvGeometry))
885 {
886 const auto dofIdx = scv.dofIndex();
887 if (!dofHandled[dofIdx])
888 {
889 dofHandled[dofIdx] = true;
890 sol[dofIdx] = asImp_().initial(scv);
891 }
892 }
893 }
894 }
895
899 InitialValues initial(const SubControlVolume& scv) const
900 {
901 static_assert(GridGeometry::discMethod == DiscretizationMethods::CVFE<DM>{});
902 return asImp_().initialAtPos(scv.dofPosition());
903 }
904
905private:
907 Implementation &asImp_()
908 { return *static_cast<Implementation *>(this); }
909
911 const Implementation &asImp_() const
912 { return *static_cast<const Implementation *>(this); }
913
914 GravityVector gravity_;
915 bool enableInertiaTerms_;
916 std::shared_ptr<CouplingManager> couplingManager_ = {};
917};
918
925template<class TypeTag>
928>;
929
930} // end namespace Dumux
931
932#endif
A helper to deduce a vector with the same size as numbers of equations.
Base class for all finite volume problems that are parameterized.
The available discretization methods in Dumux.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:38
Dune::DenseMatrix< MAT >::value_type vtmv(const Dune::DenseVector< V1 > &v1, const Dune::DenseMatrix< MAT > &M, const Dune::DenseVector< V2 > &v2)
Evaluates the scalar product of a vector v2, projected by a matrix M, with a vector v1.
Definition: math.hh:863
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:180
constexpr Box box
Definition: method.hh:136
constexpr PQ1Bubble pq1bubble
Definition: method.hh:137
std::string viscosity(int phaseIdx) noexcept
I/O name of viscosity for multiphase systems.
Definition: name.hh:74
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:38
Base class for all finite-volume problems.
Definition: common/fvproblem.hh:55
Base class for all finite-volume problems using spatial parameters.
Definition: fvproblemwithspatialparams.hh:41
Definition: method.hh:58
Class to specify the type of a boundary condition for the Navier-Stokes model.
Definition: freeflow/navierstokes/momentum/boundarytypes.hh:37
Definition: freeflow/navierstokes/momentum/problem.hh:38
Sources source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: freeflow/navierstokes/momentum/problem.hh:139
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string &paramGroup="")
The constructor for usage without a coupling manager.
Definition: freeflow/navierstokes/momentum/problem.hh:116
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the pressure at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:239
auto boundaryTypes(const Element &element, const SubControlVolumeFace &scvf) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: freeflow/navierstokes/momentum/problem.hh:175
Scalar pseudo3DWallFriction(const Scalar velocity, const Scalar viscosity, const Scalar height, const Scalar factor=8.0) const
An additional drag term can be included as source term for the momentum balance to mimic 3D flow beha...
Definition: freeflow/navierstokes/momentum/problem.hh:400
const VelocityVector beaversJosephVelocity(const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf, const ElementVolumeVariables &elemVolVars, Scalar tangentialVelocityGradient) const
Returns the slip velocity at a porous boundary based on the Beavers-Joseph(-Saffman) condition.
Definition: freeflow/navierstokes/momentum/problem.hh:470
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the effective dynamic viscosity at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:322
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:232
Scalar permeability(const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the intrinsic permeability of required as input parameter for the Beavers-Joseph-Saffman boun...
Definition: freeflow/navierstokes/momentum/problem.hh:428
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string &paramGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:98
Scalar betaBJ(const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf, const GlobalPosition &tangentialVector) const
Returns the beta value which is the alpha value divided by the square root of the (scalar-valued) int...
Definition: freeflow/navierstokes/momentum/problem.hh:451
VelocityVector porousMediumVelocity(const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the velocity in the porous medium (which is 0 by default according to Saffmann).
Definition: freeflow/navierstokes/momentum/problem.hh:461
Scalar pseudo3DWallFriction(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv, const Scalar height, const Scalar factor=8.0) const
Convenience function for staggered grid implementation.
Definition: freeflow/navierstokes/momentum/problem.hh:374
auto insideAndOutsideDensity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf, const bool isPreviousTimeStep=false) const
Definition: freeflow/navierstokes/momentum/problem.hh:296
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:335
const CouplingManager & couplingManager() const
Definition: freeflow/navierstokes/momentum/problem.hh:501
Dune::FieldVector< Scalar, dimWorld > MomentumFluxType
Definition: freeflow/navierstokes/momentum/problem.hh:84
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:90
Scalar referencePressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns a reference pressure at a given sub control volume face. This pressure is subtracted from the...
Definition: freeflow/navierstokes/momentum/problem.hh:263
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:345
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the density at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:272
const GravityVector & gravity() const
A default, i.e. if the user's does not overload any neumann method.
Definition: freeflow/navierstokes/momentum/problem.hh:226
bool onSlipBoundary(const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns true if the scvf is located on a boundary with a slip condition.
Definition: freeflow/navierstokes/momentum/problem.hh:414
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:79
Scalar density(const Element &element, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the density at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:286
BoundaryFluxes neumannAtPos(const GlobalPosition &globalPos) const
Returns the neumann flux at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:217
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at an sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:368
Scalar alphaBJ(const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the alpha value required as input parameter for the Beavers-Joseph-Saffman boundary condition...
Definition: freeflow/navierstokes/momentum/problem.hh:440
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:313
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:82
DirichletValues dirichlet(const Element &element, const SubControlVolumeFace &scvf) const
Evaluate the boundary conditions for a dirichlet control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:192
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:81
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:80
BoundaryFluxes neumann(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const
Evaluates the boundary conditions for a Neumann control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:207
bool onSlipBoundaryAtPos(const GlobalPosition &pos) const
Returns true if the scvf is located on a boundary with a slip condition.
Definition: freeflow/navierstokes/momentum/problem.hh:421
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:252
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: freeflow/navierstokes/momentum/problem.hh:161
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the effective dynamic viscosity at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:838
Dune::FieldVector< Scalar, dimWorld > Sources
Definition: freeflow/navierstokes/momentum/problem.hh:580
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< CouplingManager > couplingManager, const std::string &paramGroup="")
The constructor.
Definition: freeflow/navierstokes/momentum/problem.hh:596
void applyInitialSolution(SolutionVector &sol) const
Applies the initial solution for all degrees of freedom of the grid.
Definition: freeflow/navierstokes/momentum/problem.hh:875
Scalar pressureAtPos(const GlobalPosition &) const
Returns the pressure at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:791
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the pressure at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:777
static constexpr bool isMomentumProblem()
This problem is used for the momentum balance model.
Definition: freeflow/navierstokes/momentum/problem.hh:588
Scalar densityAtPos(const GlobalPosition &) const
Returns the density at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:829
InitialValues initial(const SubControlVolume &scv) const
Evaluate the initial value at an sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:899
Sources sourceAtPos(const GlobalPosition &globalPos) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: freeflow/navierstokes/momentum/problem.hh:660
Sources source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: freeflow/navierstokes/momentum/problem.hh:638
Scalar effectiveViscosityAtPos(const GlobalPosition &) const
Returns the effective dynamic viscosity at a given position.
Definition: freeflow/navierstokes/momentum/problem.hh:865
Dune::FieldVector< Scalar, dimWorld > InitialValues
Definition: freeflow/navierstokes/momentum/problem.hh:579
BoundaryTypes boundaryTypes(const Element &element, const SubControlVolumeFace &scvf) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: freeflow/navierstokes/momentum/problem.hh:692
const GravityVector & gravity() const
Returns the acceleration due to gravity.
Definition: freeflow/navierstokes/momentum/problem.hh:741
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the density at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:800
Dune::FieldVector< Scalar, dimWorld > DirichletValues
Definition: freeflow/navierstokes/momentum/problem.hh:581
DirichletValues dirichlet(const Element &element, const SubControlVolume &scv) const
Evaluate the boundary conditions for a Dirichlet control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:710
bool enableInertiaTerms() const
Returns whether inertia terms should be considered.
Definition: freeflow/navierstokes/momentum/problem.hh:747
Scalar effectiveViscosity(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv) const
Returns the effective dynamic viscosity at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:852
NavierStokesMomentumProblemImpl(std::shared_ptr< const GridGeometry > gridGeometry, const std::string &paramGroup="")
The constructor for usage without a coupling manager.
Definition: freeflow/navierstokes/momentum/problem.hh:614
BoundaryTypes boundaryTypes(const Element &element, const SubControlVolume &scv) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: freeflow/navierstokes/momentum/problem.hh:674
Scalar density(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolume &scv, const bool isPreviousTimeStep=false) const
Returns the density at a given sub control volume.
Definition: freeflow/navierstokes/momentum/problem.hh:814
Dune::FieldVector< Scalar, dimWorld > BoundaryFluxes
Definition: freeflow/navierstokes/momentum/problem.hh:582
Scalar referencePressure() const
Returns a reference pressure This pressure is subtracted from the actual pressure for the momentum ba...
Definition: freeflow/navierstokes/momentum/problem.hh:756
Scalar pressure(const Element &element, const FVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf) const
Returns the pressure at a given sub control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:763
DirichletValues dirichlet(const Element &element, const SubControlVolumeFace &scvf) const
Evaluate the boundary conditions for a Dirichlet control volume face.
Definition: freeflow/navierstokes/momentum/problem.hh:726
Declares all properties used in Dumux.