天天看點

Understand more about flow field in CFDUnderstanding of discrete process

Understand more about flow field in CFD

  • Understanding of discrete process
    • Harvest in programming CFD solver
    • TODO list

Flow Field will be transformed into a column of vector consists of unknown velocity variables.

Understanding of discrete process

Field itself is a vector in linear algebraic equation, which will be multiplied by coefficient matrix. A row in matrix contains the coefficients of the discrete algebraic equation with respect to a point in field.

In finite difference, a partial differential equation(PDE) is implemented to every grid point. One PDE at a given grid point belongs to only one point and the solution of the PDE is the unknown value of the grid point. However, numerical scheme is a discrete operator transforming a PDE at a point into several items at several neighbouring grid points.

Harvest in programming CFD solver

  1. System of equations in CFD can be interpreted as a matrix in code
  2. Flow field, RHS of system of equations and explicit part of the LHS of system of equations can be thought to be a vector(which is said to be Field in OpenFOAM manner).
  3. Returned type of numerical scheme function(ddt(), div(), etc.) can be Matrix for implicit scheme or Vector(Field) for explicit scheme. For implicit scheme, the coefficients and unknown variables should be in LHS of equations(matrix). However, for explicit scheme, the coefficients and variables should be sum up to form a single term locating at the RHS of equations.
  4. Numerical scheme function should be a global function which does not rely on a specific class object.
  5. To construct an equation in a way like writing the formula, the operator == should be overloaded to connect a matrix and a vector in a good way.

TODO list

  1. Compose a matrix class and a vector class to form an equation class.
  2. Add numerical scheme function.
  3. Add overload operator + and operator == to equation class.

繼續閱讀