Commit af9dd9ff authored by Andrea Cassinelli's avatar Andrea Cassinelli

Added documentation for phase sampling feature

parent 241b242d
......@@ -27,6 +27,39 @@ In the following we document the filters implemented. Note that some filters are
solver-specific and will therefore only work for a given subset of the available
solvers.
\subsection{Phase sampling}
\begin{notebox}
This feature is currently only supported for filters derived from the
FieldConvert filter: AverageFields, MovingAverage, ReynoldsStresses.
\end{notebox}
When analysing certain time-dependent problems, it might be of interest to
activate a filter in a specific physical phase and with a certain period
(for instance, to carry out phase averaging).
The simulation time can be written as
$t = m \mathcal{T} + n_{\mathcal{T}} \mathcal{T}$,
where $m$ is an integer representing the number of periods $\mathcal{T}$
elapsed, and $0 \leq n_{\mathcal{T}} \leq 1$ is the phase.
This feature can be activated by adding the two parameters below to the
filter of interest:
\begin{center}
\begin{tabularx}{0.99\textwidth}{lllX}
\toprule
\textbf{Option name} & \textbf{Required} & \textbf{Default} &
\textbf{Description} \\
\midrule
\inltt{PhaseAveragePeriod} & \cmark & &
Period $\mathcal{T}$\\
\inltt{PhaseAveragePhase} & \cmark & &
Phase $n_{\mathcal{T}}$.\\
\bottomrule
\end{tabularx}
\end{center}
Since this feature checks the current phase every \inltt{SampleFrequency},
for best results it is recommended to set \inltt{SampleFrequency}$=1$.
\subsection{FieldConvert checkpoints}
\begin{notebox}
......
......@@ -111,20 +111,6 @@ FilterFieldConvert::FilterFieldConvert(
// (Derived classes need to override this if needed)
m_sampleFrequency = m_outputFrequency;
// If phase average is computed, m_sampleFrequency is the frequency
// used to check for sampling. In general it would be best to set it to 1.
// Phase average option
// it = pParams.find("PhaseAverage");
// if (it == pParams.end())
// {
// m_phaseAverage = false;
// }
// else
// {
// LibUtilities::Equation equ(
// m_session->GetExpressionEvaluator(), it->second);
// m_phaseAverage = round(equ.Evaluate());
// }
auto itPeriod = pParams.find("PhaseAveragePeriod");
auto itPhase = pParams.find("PhaseAveragePhase");
......@@ -139,11 +125,13 @@ FilterFieldConvert::FilterFieldConvert(
LibUtilities::Equation equPhase(
m_session->GetExpressionEvaluator(), itPhase->second);
m_phaseAveragePhase = equPhase.Evaluate();
// Check that phase is within required limits
}
// Error if only one of the required params for PhaseAverage is present
ASSERTL0((itPeriod != pParams.end() && itPhase != pParams.end()),
"The phase average feature requires both 'PhaseAveragePeriod' and "
"The phase sampling feature requires both 'PhaseAveragePeriod' and "
"'PhaseAveragePhase' to be set.");
m_numSamples = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment