Verification
Verification of AMR-WIND uses MASA and auto-differentiation tools to implement the Method of Manufactured Solutions. MMS verification has been performed for both CPU and GPU architectures.
Building and linking MASA
The user must first build and install MASA. This can be done from source or using Spack.
Building MASA from source
The user must build both Metaphysicl and MASA. After defining
METAPHYSICL_ROOT_DIR
and MASA_ROOT_DIR
:
$ git clone https://github.com/roystgnr/MetaPhysicL
$ ./bootstrap
$ ./configure --prefix=$METAPHYSICL_ROOT_DIR
$ make
$ make install
$ git clone https://github.com/manufactured-solutions/MASA
$ ./bootstrap
$ ./configure --enable-fortran-interfaces METAPHYSICL_DIR=$METAPHYSICL_ROOT_DIR --prefix=$MASA_ROOT_DIR --enable-python-interfaces
$ make
$ make check
$ make install
Building MASA using Spack
Assuming the user has Spack configured for their system, building and installing MASA is as easy as:
$ spack install masa
Linking MASA to AMR-Wind
The following CMake options enable MASA in AMR-Wind:
-DAMR_WIND_ENABLE_MASA=ON -DMASA_DIR=$MASA_ROOT_DIR
where MASA_ROOT_DIR
is the MASA install location.
Performing the MMS verification
For an MMS verification study, one performs a convergence study using an MMS input file, several examples of which can be found in the regression test suite. The velocity errors are computed after each time step and logged to a text file named mms.log. The following results for the Godunov FV method exhibit the expected second order accuracy:
Velocity (u, v, w)
error norms:

The
where
Convecting Taylor Vortex (CTV)
An exact solution to the incompressible Navier-Stokes equations is the Convecting Taylor Vortex (CTV) which can also be used to test the order of accuracy. This exact solution is two dimensional, viscous, unsteady and uses periodic boundary conditions. The exact solution is
where

Ekman spiral
Solution method adapted from this Ekman lecture. Ekman assumed steady, homogeneous and horizontal flow with friction on a rotating Earth. Hence, the horizontal and time derivatives are zero.
This leave a balance between vertical friction and the Coriolis force:
where
where
Next we define
where
The boundary conditions for this flow are
where
where
rearranging
using Euler’s identity
apply the boundary conditions
simplifying further we arrive at the Ekman spiral solution
Velocity profiles of AMR-wind with a Geostrophic wind of 15 m/s
Wind direction
AMR-wind
Channel flow (laminar, quasi-2D) with different BCs
These tests use the Poiseuille flow solution for a channel to verify the implementation of the boundary conditions. Input files for these tests are included among the regression test directories.
AMR-wind

AMR-wind

Burggraf flow: lid-driven cavity with body force
This flow, described by Burggraf (JFM, 1966), is a two-dimensional flow with no-slip walls. The upper wall has a spatially-varying tangential velocity (which is applied to the simulation via a user-defined-function, or UDF, boundary condition), and a spatially-varying body force. At steady state, this flow has an analytical solution that we use to verify the implementation of the UDF BC.

Channel flow with Smagorinsky LES
This test verifies the implementation of the Smagorinsky LES model as well as the wall model boundary conditions using an analytical channel flow solution.
Smagorinsky model:
This simplifies in a 1-D case to
Mean velocity equations:
Steady state solution (assuming
The analytical solution is:
where
To solve for
This gives us a value for
Using this
Finally, to make this problem well-posed, instead of setting a slip-wall
at the top boundary, we set a Dirichlet boundary condition using
Parameter values for testing
The hand computed values for the constants and boundary conditions for
varying
8 |
169.90632344067848 |
49.63299783004268 |
0.5322727144609587 |
16 |
2449.4399999999982 |
201.95839999999998 |
0.5576738677495996 |
32 |
38115.76743991355 |
811.5733178848386 |
0.5646234542509774 |
64 |
605551.4603806001 |
3250.1208744082833 |
0.5664029656909406 |
Test results
These are results of running the test case for 100 seconds.
