~fluidity-core/fluidity/ocean_forcing

« back to all changes in this revision

Viewing changes to manual/configuring_fluidity.tex

  • Committer: Christian Jacobs
  • Date: 2011-08-31 20:38:52 UTC
  • mfrom: (3408.1.124 ctjacobs-multiphase)
  • Revision ID: c.jacobs10@imperial.ac.uk-20110831203852-4cburyv2422y6ms1
Merging ctjacobs-multiphase branch revisions (from r3452 to r3532 inclusive) into trunk. Branch queue passes all unit, short and medium tests on buildbot.

Summary of changes:
===================

- Implemented the fluid-particle drag term in Multiphase.F90. The mphase_stokes_law and mphase_tephra_settling test cases have been updated to use this new implementation, rather than a Python diagnostic Source field. An MMS test which includes this fluid-particle drag term is available in longtests/mphase_mms_p1dgp2_fpdrag, and converges at the expected order.

- Implemented a new boundary condition type, called 'flux', for control volume discretisations. Updated the mphase_tephra_settling test case to use this, which allows to flux in through the boundary at the correct rate. Also added documentation regarding this boundary condition type to the manual.

- When checking the tfield_bc_type in Field_Equations_CV.F90, we now compare against the more meaningful integer parameters BC_TYPE_WEAKDIRICHLET (=1), BC_TYPE_NEUMANN (=2), etc.

- Added the 'tephra_settling' example to the examples directory, along with some documentation (background, simulation setup, results, pretty pictures) in manual/examples.tex.

- In manual/model_equations.tex and manual/configuring_fluidity.tex: Added documentation on the multi-phase flow model equations, setting up multi-phase flow simulations, available inter-phase interaction terms, and current limitations of the model.

- Corrected typos in various places in the manual.

- Made the mphase_tephra_settling test more realistic by adding in random perturbations to the PhaseVolumeFraction influx. Also made a few minor tweaks (e.g. finish_time, timestep), and added pass_tests.

- Added a three-phase test called mphase_three_layers. This checks that our model can simulate more than one dispersed phase, allowing us to use several different particle sizes in our tephra settling simulation later on.

- Moved the mphase_tephra_settling_3d test case to the longtests directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
261
261
a stat file at the start (timestep zero) and outputting stat data before and
262
262
after an adapt.
263
263
 
264
 
There are futher options under individual fields, for example to exclude data from the stat file.
 
264
There are further options under individual fields, for example to exclude data from the stat file.
265
265
 
266
266
\subsubsection{Detectors}
267
267
\index{detectors!options}
409
409
switching on the option: \option{\ldots/at\_first\_timestep}
410
410
 
411
411
\subsubsection{Steady state}
412
 
It is possible to run fludity until it converges to a steady state; this is sometimes useful for initialising a problem. In order to do this, switch on \option{/timestepping/steady\_state} and set a tolerance. 
 
412
It is possible to run \fluidity until it converges to a steady state; this is sometimes useful for initialising a problem. In order to do this, switch on \option{/timestepping/steady\_state} and set a tolerance. 
413
413
 
414
414
\subsection{Physical parameters}
415
415
These options control global physical quantities.
606
606
 
607
607
Meshes that are required to be periodic can now be derived from this
608
608
periodic mesh. Note that the periodic mesh must be directly derived from the
609
 
mesh which has been read \option{from\_file}. It is not possibe to derive a
 
609
mesh which has been read \option{from\_file}. It is not possible to derive a
610
610
periodic mesh from a \option{from\_mesh}\ mesh.
611
611
 
612
612
\subsubsection{Extruded meshes}\label{Sect:extruded}
901
901
\option{conservative\_advection} option is applicable to all discretisation
902
902
types. See chapter \ref{chap:numerical_discretisation} for details.
903
903
 
904
 
For each field, the spatial discretisations can be selcted using
 
904
For each field, the spatial discretisations can be selected using
905
905
\option{\ldots/prognostic/spatial\_discretisation}.  Once selected a number
906
906
of other options will open underneath this option.
907
907
 
1123
1123
\index{conjugate gradient}
1124
1124
\index{multigrid}
1125
1125
\index{PETSc}
1126
 
As described in Section \ref{ND_Linear_solvers}, for the solution of large sparse linear systems, the so called iterative methods are usually employed. These methods avoid having to explicitly construct the inverse of the matrix, which is generally dense and therefore costly to compute (both in memory and computer time). FLUIDITY is linked to PETSc: a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations.  It employs the MPI standard for parallelism. FLUIDITY therefore supports any iterative method provided by the PETSc library (http://www-unix.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-dev/docs/manualpages/KSP/KSPType.html --- available methods may depend on the PETSc library installed on your system). Examples include Conjugate Gradient (CG), GMRES and FGMRES (Flexible GMRES). Some options are explicitly listed under \option{solver/iterative\_method}, for example CG: \option{solver/iterative\_method::cg}, whereas others can be selected entering the name of the chosen scheme in \option{solver/iterative\_method}.
 
1126
As described in Section \ref{ND_Linear_solvers}, for the solution of large sparse linear systems, the so called iterative methods are usually employed. These methods avoid having to explicitly construct the inverse of the matrix, which is generally dense and therefore costly to compute (both in memory and computer time). FLUIDITY is linked to PETSc: a suite of data structures and routines for the scalable (parallel) solution of scientific applications modelled by partial differential equations.  It employs the MPI standard for parallelism. FLUIDITY therefore supports any iterative method provided by the PETSc library (http://www-unix.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-dev/docs/manualpages/KSP/KSPType.html --- available methods may depend on the PETSc library installed on your system). Examples include Conjugate Gradient (CG), GMRES and FGMRES (Flexible GMRES). Some options are explicitly listed under \option{solver/iterative\_method}, for example CG: \option{solver/iterative\_method::cg}, whereas others can be selected entering the name of the chosen scheme in \option{solver/iterative\_method}.
1127
1127
 
1128
1128
\subsection{Preconditioner}
1129
1129
\index{linear solvers!preconditioners}
1174
1174
 
1175
1175
\subsection{Solver Diagnostics}
1176
1176
 
1177
 
This subsection includeds a series of extra diagnostic options to help debug solver problems. 
 
1177
This subsection includes a series of extra diagnostic options to help debug solver problems. 
1178
1178
 
1179
1179
\subsubsection{Print norms}
1180
1180
Print out the norm of vectors and matrices before the solve, and that of the solution vector afterwards. Norms are printed at verbosity level 2, so run \fluidity\ with -v2 or -v3.
1376
1376
 
1377
1377
\subsection{Boundary condition types}\label{Sect:BCs:types}
1378
1378
\index{boundary conditions!setting}
1379
 
\fluidity\ supports a wide range of boundary coditions which will be introduced in the next sections.
 
1379
\fluidity\ supports a wide range of boundary conditions which will be introduced in the next sections.
1380
1380
 
1381
1381
\subsubsection{Dirichlet}
1382
1382
\index{boundary conditions!Dirichlet}
1418
1418
 
1419
1419
For control volume discretisations only this options prevents the field fluxing from the boundary.
1420
1420
 
 
1421
\subsubsection{Flux}
 
1422
\index{boundary conditions!flux}
 
1423
 
 
1424
For control volume discretisations only, this option allows a given flux $h$ of field $c$ through the boundary. In other words, we have
 
1425
\begin{equation*}
 
1426
   \frac{\partial c}{\partial t} = h
 
1427
\end{equation*}
 
1428
 
1421
1429
\subsubsection{Free surface}
1422
1430
\index{boundary conditions!free surface}
1423
1431
\index{free surface!boundary condition}
1486
1494
\item \option{\ldots/tidal/variable\_name\_amplitude},
1487
1495
\item \option{\ldots/tidal/variable\_name\_phase}
1488
1496
\end{itemize}
1489
 
respectively. Finally, the constituet should be selected from the list under:
 
1497
respectively. Finally, the constituent should be selected from the list under:
1490
1498
\begin{itemize}
1491
1499
\item \option{\ldots/tidal/name}.
1492
1500
\end{itemize}
1493
 
A separate tidal boundary consition needs to be set for each constituent.
 
1501
A separate tidal boundary condition needs to be set for each constituent.
1494
1502
 
1495
1503
\index{boundary conditions!NEMO data}
1496
1504
\option{\ldots/NEMO\_data} will set the field according to a specified NEMO
1586
1594
\end{itemize}
1587
1595
(see \citealp{Wells2008} for descriptions of
1588
1596
the different constituents). These can be switched either
1589
 
individually or in combination. In addition, a body tide correction can be stipluated
 
1597
individually or in combination. In addition, a body tide correction can be stipulated
1590
1598
under:
1591
1599
\begin{itemize}
1592
1600
\item \option{\ldots/tidal\_forcing/love\_number},
1640
1648
  \caption{A Python function that imports the biology module and sets the algorithm to use.}
1641
1649
\end{example}
1642
1650
 
1643
 
The final thing to change is to add absorption coefficients in the photsynthetic radiation field for water and plankton concentration.
 
1651
The final thing to change is to add absorption coefficients in the photosynthetic radiation field for water and plankton concentration.
1644
1652
 
1645
1653
\section{Sediment model}
1646
1654
\label{config:sediments}
1902
1910
 
1903
1911
For each field present in the simulation there are up to two options that should be set. The first
1904
1912
is the interpolation method that should be used to transfer the values of a field from the old to the new mesh.
1905
 
Second, in order to form the error metic by which the mesh is adapted, the user must set which fields
 
1913
Second, in order to form the error metric by which the mesh is adapted, the user must set which fields
1906
1914
should form the error metric and how the error for that field should be calculated.
1907
1915
 
1908
1916
\subsubsection{Interpolation method} \label{sec:config_adapt_interp}
1910
1918
For each prognostic field in the current state, an interpolation type must be set. These can be set by selecting an
1911
1919
option \option{\ldots/prognostic/<interpolation type>} where \texttt{<interpolation type>} is one of:
1912
1920
\begin{itemize}
1913
 
\item Consistent interpolation - the default and quick inteprolation method, but is non-conservative and dissipative.
 
1921
\item Consistent interpolation - the default and quick interpolation method, but is non-conservative and dissipative.
1914
1922
\item Pseudo-consistent interpolation - not recommended at present.
1915
1923
\item Galerkin interpolation - Conservative and non-dissipative, but requires the construction of a supermesh \citep{farrell2009a,farrell2010a}
1916
1924
\item Grandy interpolation - Conservative, but highly diffusive. See \citet{grandy1999}.
1918
1926
 
1919
1927
For some fields, such as Pressure and Velocity other interpolation methods are available.
1920
1928
 
1921
 
For diagnostic and prescribed fields an inteprolation method is not required. However, if an output dump
1922
 
occurs immeadiately following a mesh adapt, diagnostic fields may not have correct values depending
 
1929
For diagnostic and prescribed fields an interpolation method is not required. However, if an output dump
 
1930
occurs immediately following a mesh adapt, diagnostic fields may not have correct values depending
1923
1931
on the method by which they are calculated. In these instances, it is worth setting an interpolation type
1924
1932
for these fields which will ensure that the values are set correctly before an output dump occurs.
1925
1933
 
1948
1956
 
1949
1957
The second step for configuring adaptivity is to set up the fields that are to form the error metric used
1950
1958
to adapt the mesh. For each field that should be considered when forming the metric the option
1951
 
\option{\ldots/adaptivity\_options} needs to be enabled. The error bound is set as seperate fields within 
 
1959
\option{\ldots/adaptivity\_options} needs to be enabled. The error bound is set as separate fields within 
1952
1960
state, so for Temperature, for example, the acceptable error is stored an a field called 
1953
1961
TemperatureInterpolationErrorBound. There are two methods available for calculating the error, absolute and relative.
1954
1962
Both have similar options in which the InterpolationErrorBound field can be set as with any other prescribed field.
1957
1965
 
1958
1966
For relative interpolation error bounds a tolerance value also has to be set under \newline
1959
1967
\option{\ldots/adaptivity\_options/relative\_measure/tolerance}. This value prevents division by zero
1960
 
and should be set to a small enough number that the field can effecivtly be considered zero at this value.
 
1968
and should be set to a small enough number that the field can effectively be considered zero at this value.
1961
1969
 
1962
1970
\subsection{General adaptivity options}
1963
1971
\label{sect:configuring_fluidity_adaptivity_options}
1986
1994
 
1987
1995
\section{Multiple material/phase models} \label{sec:config_multimatph}
1988
1996
 
1989
 
This section contains advice on setting up simulations with multiple material\_phase options.  This enables related fields to be grouped together into related materials or phases.  For example a prognostic scalar field in one material\_phase will be advected using the Velocity from that material\_phase while a prognostic scalar field in another material\_phase will be advected according to the Velocity in its material\_phase.
 
1997
This section contains advice on setting up simulations with multiple material\_phase options.  This enables related fields to be grouped together into related materials or phases.  For example a prognostic scalar field in one material\_phase will be advected using the Velocity field from that material\_phase, while a prognostic scalar field in another material\_phase will be advected according to the Velocity field in its material\_phase.
1990
1998
 
1991
1999
We refer to two typical scenarios: a \emph{multiple material} model and a \emph{multiple phase} model. A multiple phase model is one in which the Velocity field in each material\_phase is in some way independent of the velocities in the other material\_phases.  This means that scalar fields (for example phase volume fractions) in each material\_phase are advected independently.  A multiple material model is one in which the Velocity field is shared between all material\_phases so that all scalar fields are advected similarly.
1992
2000
 
1993
 
\subsection{Multiple phase models}
1994
 
 
1995
 
It is not currently possible to model problems with multiple prognostic velocity fields although the options system has been designed with this in mind for the future.
1996
 
 
1997
2001
\subsection{Multiple material models}
1998
2002
 
1999
2003
Models with a single prognostic velocity field that is shared between material\_phases (using the \option{aliased} field type) are referred to as multiple material models.  These are generally used to describe systems of nearly immiscible materials with different material properties contained within the same domain.  This section focusses on this type of multiple material\_phase simulation.
2000
2004
 
2001
2005
In a multiple material simulation each material\_phase requires:
2002
2006
\begin{itemize}
2003
 
\item an equation of state
2004
 
\item a MaterialVolumeFraction scalar field
 
2007
\item an equation of state, and
 
2008
\item a MaterialVolumeFraction scalar field.
2005
2009
\end{itemize}
2006
2010
 
2007
2011
The equation of state provides the density properties of the material described in the current material\_phase.  For incompressible simulations a linear equation of state is used, which only requires a reference density:\\
2049
2053
\end{equation}
2050
2054
where $\tensor{\mu}$ is the bulk viscosity and $\tensor{\mu}^i$ is the individual material's viscosity.  To use this it is necessary to activate a MaterialViscosity field in every material\_phase with a nonzero viscosity.  Additionally the Viscosity field underneath the prognostic Velocity must be activated and set to the \option{bulk\_viscosity} diagnostic algorithm.
2051
2055
 
 
2056
\subsection{Multiple phase models}
 
2057
Models with one prognostic velocity field per \option{material\_phase} are referred to as multiple phase models. The use of these multiple velocity fields permits the inter-penetration and interaction between different phases.
 
2058
 
 
2059
\subsubsection{Simulation requirements}
 
2060
In a multi-phase simulation, each \option{material\_phase} requires:
 
2061
\begin{itemize}
 
2062
 \item an equation of state, and
 
2063
 \item a PhaseVolumeFraction scalar field.
 
2064
\end{itemize}
 
2065
 
 
2066
As per multi-material simulations, the equation of state provides the density properties of the phase described in the current \option{material\_phase}. For incompressible simulations a linear equation of state is used, which only requires a reference density:\\
 
2067
\option{\ldots/equation\_of\_state/fluids/linear/reference\_density}\\
 
2068
to be set.
 
2069
 
 
2070
For an $N$ phase problem, $N$ material\_phases are required and hence $N$ PhaseVolumeFractions, $\alpha_i, i = 1, \ldots, N$, and $N$ equations of state. Just as in multi-material simulations, only $N-1$ of the PhaseVolumeFraction fields, $\alpha_i, i = 1, \ldots, N-1$, need be prognostic. The final PhaseVolumeFraction field, $\alpha_N$, should always be set to \option{diagnostic}, as it can be recovered using the internal algorithm:
 
2071
\begin{equation}
 
2072
\alpha_N = 1 - \sum_{i=1}^{N-1}\alpha_i\textrm{.}
 
2073
\end{equation}
 
2074
 
 
2075
\subsubsection{Inter-phase interactions}
 
2076
Inter-phase interactions can be included under \option{../multiphase\_properties} in Diamond. Currently, \fluidity\ only supports fluid-particle drag between the continuous phase and dispersed phase(s), given by:
 
2077
\begin{equation}\label{eq:multiphase_drag_term}
 
2078
\mathbf{F}_D = \frac{3\ \alpha_p\ C_D\ \alpha_f\ \rho_f\ |\mathbf{u}_f-\mathbf{u}_p|\ (\mathbf{u}_f-\mathbf{u}_p)}{4\ d},
 
2079
\end{equation}
 
2080
where $f$ and $p$ denote the fluid (i.e. continuous) and particle (i.e. dispersed) phases respectively, and $d$ is the diameter of a single particle in the dispersed phase. The drag coefficient $C_D$ is defined as:
 
2081
\begin{equation}\label{eq:drag_coefficient}
 
2082
C_D = \frac{24}{\mathrm{Re}},
 
2083
\end{equation}
 
2084
with
 
2085
\begin{equation}\label{eq:particle_reynolds_number}
 
2086
\mathrm{Re} = \frac{\alpha_f\ \rho_f\ d\ |\mathbf{u}_f-\mathbf{u}_p|}{\mu_f}.
 
2087
\end{equation}
 
2088
Note that $\mu_f$ denotes the isotropic viscosity of the fluid (i.e. continuous) phase.
 
2089
 
 
2090
Within a dispersed phase, entering a value for $d$ in the \option{../multiphase\_properties/particle\_diameter} option enables fluid-particle interaction between itself and the continuous phase.
 
2091
 
 
2092
\subsubsection{Current limitations}
 
2093
\begin{itemize}
 
2094
 \item Boussinesq and fully compressible multi-phase simulations are not yet supported.
 
2095
 \item The momentum equation for each \option{material\_phase} can only be discretised in non-conservative form.
 
2096
 \item The \option{bassi\_rebay} and \option{compact\_discontinuous\_galerkin} are currently the only DG viscosity schemes available for multi-phase flow simulations.
 
2097
 \item Discontinuous \option{PhaseVolumeFraction} fields are not yet supported.
 
2098
 \item The Pressure field only supports a continuous Galerkin discretisation.
 
2099
 \item Prescribed velocity fields cannot yet be used in multi-phase simulations.
 
2100
 \item Fluid-particle drag can currently only support one continuous (i.e. fluid) phase.
 
2101
\end{itemize}
 
2102
 
2052
2103
 
2053
2104
\section{Compressible fluid model}
2054
2105
\index{compressible fluid model}
2063
2114
\begin{itemize}
2064
2115
\item The value for the atmospheric pressure can be added by switching on \option{\ldots/atmospheric\_pressure}, otherwise a default of zero is used.
2065
2116
\item A Poisson pressure equation should not be used to calculate a first guess, therefore \\* \option{\ldots/scheme/poisson\_pressure\_solution} should be set to $never$.
2066
 
\item \option{\ldots/scheme/use\_compressible\_projection\_method} shuold be selected, so the calculated pressure satisfies the continuity equation and the EOS.
 
2117
\item \option{\ldots/scheme/use\_compressible\_projection\_method} should be selected, so the calculated pressure satisfies the continuity equation and the EOS.
2067
2118
\end{itemize}
2068
2119
 
2069
2120
\subsection{Density options}