|
| 1 | +commercial :term:`CFD<CFD>` codes |
| 2 | +is ``Nelements * Np``, |
| 3 | +the :math:`x`-coordinates a :math:`\checkmark` in |
| 4 | +in the |
| 5 | +:ref:`Creating a Mesh for Conjugate Heat Transfer <cht_mesh>` section |
| 6 | + |
| 7 | +Plugins |
| 8 | +======= |
| 9 | + |
| 10 | +RANS :math:`k`-:math:`\tau` Plugin |
| 11 | +---------------------------------- |
| 12 | + |
| 13 | +Add the Closure Properties Calculation |
| 14 | +"""""""""""""""""""""""""""""""""""""" |
| 15 | + 1. Set the ``udf.sEqnSource`` function pointer to a function |
| 16 | + local to the ``.udf`` file that actually computes the source terms |
| 17 | + 2. Add that source term function to the ``.udf`` |
| 18 | + |
| 19 | +.. code-block:: |
| 20 | + user$ export NEKRS_HOME=$HOME/.local/nekrs |
| 21 | + |
| 22 | +.. code-block:: cpp |
| 23 | +
|
| 24 | + void user_q(nrs_t *nrs, dfloat time, occa::memory o_S, occa::memory o_FS) |
| 25 | + { |
| 26 | + RANSktau::updateSourceTerms(); |
| 27 | + } |
| 28 | +
|
| 29 | +
|
| 30 | +.. warning:: |
| 31 | + |
| 32 | + nekRS's :math:`k`-:math:`\tau` implementation currently requires that |
| 33 | + the laminar dynamic viscosity and the density are constant. Therefore, you |
| 34 | + should not have any other material properties being set in this function |
| 35 | + like there were in :ref:`Setting Custom Properties <custom_properties>`. |
| 36 | + |
| 37 | +.. _setting_ICs: |
| 38 | +Then, be sure to add this directory to your path: |
| 39 | + |
| 40 | + ALE |
| 41 | + Arbitrary Lagrange Eulerian |
| 42 | +ed in [Persson]_ |
| 43 | +from `github <https://github.com/Nek5000/nekRS>`__. |
| 44 | + |
| 45 | +================== ============================ ================== ================================================= |
| 46 | +Variable Name Size Device? Meaning |
| 47 | +================== ============================ ================== ================================================= |
| 48 | +``comm`` 1 MPI communicator |
| 49 | +``device`` 1 backend device |
| 50 | +``dim`` 1 spatial dimension of mesh |
| 51 | +``elementInfo`` ``Nelements`` phase of element (0 = fluid, 1 = solid) |
| 52 | +``EToB`` ``Nelements * Nfaces`` :math:`\checkmark` boundary ID for each face |
| 53 | +``N`` 1 polynomial order for each dimension |
| 54 | +``NboundaryFaces`` 1 *total* number of faces on a boundary (rank sum) |
| 55 | +``Nelements`` 1 number of elements |
| 56 | +``Nfaces`` 1 number of faces per element |
| 57 | +``Nfp`` 1 number of quadrature points per face |
| 58 | +``Np`` 1 number of quadrature points per element |
| 59 | +``rank`` 1 parallel process rank |
| 60 | +``size`` 1 size of MPI communicator |
| 61 | +``vmapM`` ``Nelements * Nfaces * Nfp`` :math:`\checkmark` quadrature point index for faces on boundaries |
| 62 | +``x`` ``Nelements * Np`` :math:`\checkmark` :math:`x`-coordinates of quadrature points |
| 63 | +``y`` ``Nelements * Np`` :math:`\checkmark` :math:`y`-coordinates of quadrature points |
| 64 | +``z`` ``Nelements * Np`` :math:`\checkmark` :math:`z`-coordinates of quadrature points |
| 65 | +================== ============================ ================== ================================================= |
| 66 | + |
| 67 | +.. _flow_vars: |
| 68 | + |
| 69 | +Flow Solution Fields and Simulation Settings |
| 70 | +Flow Solution Fields and Simulation Settings |
| 71 | +-------------------------------------------- |
| 72 | +corresponding array ``nrs->mue`` member. |
| 73 | + |
| 74 | +================== ================================= ================== ====================================================================================================== |
| 75 | +Variable Name Size Device? Meaning |
| 76 | +================== ================================= ================== ====================================================================================================== |
| 77 | +``cds`` 1 convection-diffusion solution object |
| 78 | +``cht`` 1 whether the problem contains conjugate heat transfer |
| 79 | +``dim`` 1 spatial dimension of ``nrs->mesh`` |
| 80 | +``dt`` 3 time step for previous 3 time steps |
| 81 | +``fieldOffset`` 1 offset in flow solution arrays to access new component |
| 82 | +``FU`` ``NVfields * nEXT * fieldOffset`` :math:`\checkmark` source term for each momentum equation for each step in the time stencil |
| 83 | +``isOutputStep`` 1 if an output file is written on this time step |
| 84 | +``lastStep`` 1 if this time step is the last time step of the run |
| 85 | +``mesh`` 1 mesh used for the flow simulation |
| 86 | +``nEXT`` 1 number of time steps in the time derivative stencil |
| 87 | +``NiterU`` 1 number of iterations taken in last velocity solve |
| 88 | +``NiterP`` 1 number of iterations taken in last pressure solve |
| 89 | +``Nlocal`` 1 number of quadrature points local to this process |
| 90 | +``Nscalar`` 1 number of passive scalars to solve for |
| 91 | +``NTfields`` 1 number of flow-related fields to solve for (:math:`\vec{V}` plus :math:`T`) |
| 92 | +``NVfields`` 1 number of velocity fields to solve for |
| 93 | +``o_mue`` ``fieldOffset`` :math:`\checkmark` total dynamic viscosity (laminar plus turbulent) for the momentum equation |
| 94 | +``options`` 1 object containing user settings from ``.par`` file |
| 95 | +``o_rho`` ``fieldOffset`` :math:`\checkmark` density for the momentum equation |
| 96 | +``P`` ``fieldOffset`` :math:`\checkmark` pressure solution for most recent time step |
| 97 | +``prop`` ``2 * fieldOffset`` :math:`\checkmark` total dynamic viscosity (laminar plus turbulent) and density (in this order) for the momentum equation |
| 98 | +``U`` ``NVfields * fieldOffset`` :math:`\checkmark` velocity solution for all components for most recent time step |
| 99 | +================== ================================= ================== ====================================================================================================== |
| 100 | + |
| 101 | +Passive Scalar Solution Fields and Simulation Settings |
0 commit comments