-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Description of the problem For some simple cases of tracer modeling, we need to account for tracer drift to have a simple model for dilute multiphase simulation. This is currently not possible. Description of the solution Add a simple drift flux velocity model for the tracer physics. This is just a user-defined function that adds a supplementary velocity on top of the fluid velocity to the tracer physics. How Has This Been Tested? This is a very minimal modification which just adds a velocity to the fluid velocity so this does not require specific unit test. If all the regular tests still pass, this implementation should be valid. Documentation Documentation of the class was added and class is adequately documented.
- Loading branch information
Showing
9 changed files
with
211 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
===================== | ||
Tracer Drift Velocity | ||
===================== | ||
|
||
This subsection allows you to define a tracer drift velocity. This drift velocity is an additional velocity which is added to the fluid velocity when advecting the tracer. This enables user to model, with some strong hypothesis, the dynamics of a dispersed phase (such as bubbles or particles) within a fluid flow. | ||
|
||
.. code-block:: text | ||
subsection tracer drift velocity | ||
subsection drift velocity | ||
# Default values in 2D | ||
set Function expression = 0; 0 | ||
# in 3D: set Function expression = 0; 0; 0 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/* --------------------------------------------------------------------- | ||
* | ||
* Copyright (C) 2019 - by the Lethe authors | ||
* | ||
* This file is part of the Lethe library | ||
* | ||
* The Lethe library is free software; you can use it, redistribute | ||
* it, and/or modify it under the terms of the GNU Lesser General | ||
* Public License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* The full text of the license can be found in the file LICENSE at | ||
* the top level of the Lethe distribution. | ||
* | ||
* --------------------------------------------------------------------- | ||
* | ||
*/ | ||
|
||
|
||
#ifndef lethe_tracer_drift_velocity_h | ||
#define lethe_tracer_drift_velocity_h | ||
|
||
#include <deal.II/base/function.h> | ||
#include <deal.II/base/parameter_handler.h> | ||
#include <deal.II/base/parsed_function.h> | ||
|
||
#include <deal.II/lac/vector.h> | ||
|
||
#include <memory> | ||
|
||
using namespace dealii; | ||
/** | ||
* Drift velocity that is added to the tracer velocity to account for simplified | ||
*multiphase simulations using drift-flux modeling. | ||
**/ | ||
|
||
namespace Parameters | ||
{ | ||
/** | ||
* @brief Implements a drift velocity function to account for simplified multiphase flows. | ||
* | ||
* @tparam dim An integer that denotes the dimension of the space in which | ||
* the flow is solved. | ||
* The drift velocity provides a simple way to model dilute disperse multiphase | ||
flow through the tracer physics. | ||
**/ | ||
|
||
template <int dim> | ||
class TracerDriftVelocity | ||
{ | ||
public: | ||
TracerDriftVelocity() | ||
{ | ||
drift_velocity = std::make_shared<Functions::ParsedFunction<dim>>(dim); | ||
} | ||
|
||
/** | ||
* @brief Declares the parameters required by the drift velocity. | ||
* | ||
* @param prm ParameterHandler used to declare the parameters. | ||
* | ||
*/ | ||
virtual void | ||
declare_parameters(ParameterHandler &prm); | ||
|
||
/** | ||
* @brief Parses the parameters required by the analytical solution | ||
* within a parameter file | ||
* | ||
* @param prm ParameterHandler used to parse the parameters. | ||
* | ||
*/ | ||
virtual void | ||
parse_parameters(ParameterHandler &prm); | ||
|
||
// Drift velocity | ||
std::shared_ptr<Functions::ParsedFunction<dim>> drift_velocity; | ||
}; | ||
|
||
template <int dim> | ||
void | ||
TracerDriftVelocity<dim>::declare_parameters(ParameterHandler &prm) | ||
{ | ||
prm.enter_subsection("tracer drift velocity"); | ||
|
||
prm.enter_subsection("drift velocity"); | ||
drift_velocity->declare_parameters(prm, dim); | ||
prm.leave_subsection(); | ||
|
||
prm.leave_subsection(); | ||
} | ||
|
||
template <int dim> | ||
void | ||
TracerDriftVelocity<dim>::parse_parameters(ParameterHandler &prm) | ||
{ | ||
prm.enter_subsection("tracer drift velocity"); | ||
|
||
prm.enter_subsection("drift velocity"); | ||
drift_velocity->parse_parameters(prm); | ||
prm.leave_subsection(); | ||
|
||
prm.leave_subsection(); | ||
} | ||
} // namespace Parameters | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* --------------------------------------------------------------------- | ||
* | ||
* Copyright (C) 2019 - by the Lethe authors | ||
* | ||
* This file is part of the Lethe library | ||
* | ||
* The Lethe library is free software; you can use it, redistribute | ||
* it, and/or modify it under the terms of the GNU Lesser General | ||
* Public License as published by the Free Software Foundation; either | ||
* version 3.1 of the License, or (at your option) any later version. | ||
* The full text of the license can be found in the file LICENSE at | ||
* the top level of the Lethe distribution. | ||
* | ||
* --------------------------------------------------------------------- | ||
*/ | ||
|
||
#include <solvers/tracer_drift_velocity.h> | ||
|
||
// Pre-compile the 2D and 3D Navier-Stokes solver to ensure that the library is | ||
// valid before we actually compile the solver This greatly helps with debugging | ||
template class Parameters::TracerDriftVelocity<2>; | ||
template class Parameters::TracerDriftVelocity<3>; |