-
Notifications
You must be signed in to change notification settings - Fork 708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Functions::RayleighKotheVortex #15932
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
New: The Rayleigh--Kothe vortex has been extracted | ||
from step-68 and is now availabe as the new class | ||
Functions::RayleighKotheVortex. | ||
<br> | ||
(Bruno Blais, Peter Munch, 2023/08/20) |
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 | ||||
---|---|---|---|---|---|---|
|
@@ -1752,6 +1752,72 @@ namespace Functions | |||||
const std::vector<double> coefficients; | ||||||
}; | ||||||
|
||||||
|
||||||
/** | ||||||
* A class that represents a time-dependent function object for a | ||||||
* Rayleigh--Kothe vortex vector field. This is generally used as | ||||||
* flow pattern in complex test cases for interface tracking methods | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The line above contains the |
||||||
* (e.g., volume-of-fluid and level-set approaches) since it leads | ||||||
* to strong rotation and elongation of the fluid @cite Blais2013. | ||||||
* | ||||||
* The stream function $\Psi$ of this Rayleigh-Kothe vortex is defined as: | ||||||
@f[ | ||||||
\Psi = \frac{1}{\pi} \sin^2 (\pi x) \sin^2 (\pi y) \cos \left( \pi \frac{t}{T} | ||||||
\right) | ||||||
@f] | ||||||
* where $T$ is half the period of the flow. The velocity profile in 2D | ||||||
($\textbf{u}=[u,v]^T$) is : | ||||||
@f{eqnarray*}{ | ||||||
u &=& - \frac{\partial\Psi}{\partial y} = -2 \sin^2 (\pi x) \sin (\pi y) | ||||||
\cos (\pi y) \cos \left( \pi \frac{t}{T} \right)\\ v &=& | ||||||
\frac{\partial\Psi}{\partial x} = 2 \cos(\pi x) \sin(\pi x) \sin^2 (\pi y) \cos | ||||||
\left( \pi \frac{t}{T} \right) | ||||||
@f} | ||||||
* where $T$ is half the period of the flow. | ||||||
* | ||||||
* The velocity profile is illustrated in the following animation: | ||||||
* | ||||||
@htmlonly | ||||||
<p align="center"> | ||||||
<iframe width="560" height="500" | ||||||
src="https://www.youtube.com/embed/m6hQm7etji8" frameborder="0" | ||||||
allow="accelerometer; autoplay; encrypted-media; gyroscope; | ||||||
picture-in-picture" allowfullscreen></iframe> | ||||||
</p> | ||||||
@endhtmlonly | ||||||
* | ||||||
* It can be seen that this velocity reverses periodically due to the term | ||||||
* $\cos \left( \pi \frac{t}{T} \right)$ and that material will end up at its | ||||||
* starting position after every period of length $t=2T$. | ||||||
* | ||||||
* @note This class is only implemented for 2D and 3D. In 3D, the | ||||||
* third component is set to zero. | ||||||
* | ||||||
* @ingroup functions | ||||||
*/ | ||||||
template <int dim> | ||||||
class RayleighKotheVortex : public Function<dim> | ||||||
{ | ||||||
public: | ||||||
/** | ||||||
* Constructor. | ||||||
*/ | ||||||
RayleighKotheVortex(const double T = 1.0); | ||||||
|
||||||
/** | ||||||
* Return all components of a vector-valued function at a given point. | ||||||
*/ | ||||||
virtual void | ||||||
vector_value(const Point<dim> &point, | ||||||
Vector<double> &values) const override; | ||||||
|
||||||
private: | ||||||
/** | ||||||
* Half the period of the flow. | ||||||
*/ | ||||||
const double T; | ||||||
}; | ||||||
|
||||||
#ifndef DOXYGEN | ||||||
|
||||||
|
||||||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also make the same change in the performance benchmark while we are at it?
:)