UCFD_SPARSE  v1.1
Documentation
Loading...
Searching...
No Matches
lusgs.c File Reference

LU-SGS time integration method for unstructured grid. More...

#include "lusgs.h"
#include "flux.h"
Include dependency graph for lusgs.c:

Go to the source code of this file.

Functions

void serial_pre_lusgs (UCFD_INT neles, UCFD_INT nface, UCFD_FLOAT factor, UCFD_FLOAT *fnorm_vol, UCFD_FLOAT *dt, UCFD_FLOAT *diag, UCFD_FLOAT *fspr)
 Computes Diagonal matrix for LU-SGS method. More...
 
void ns_serial_lower_sweep (UCFD_INT neles, UCFD_INT nface, UCFD_INT *nei_ele, UCFD_FLOAT *fnorm_vol, UCFD_FLOAT *vec_fnorm, UCFD_FLOAT *uptsb, UCFD_FLOAT *rhsb, UCFD_FLOAT *dub, UCFD_FLOAT *diag, UCFD_FLOAT *fspr)
 Lower sweep of LU-SGS method for Navier-Stokes equations. More...
 
void rans_serial_lower_sweep (UCFD_INT neles, UCFD_INT nface, UCFD_INT *nei_ele, UCFD_FLOAT *fnorm_vol, UCFD_FLOAT *vec_fnorm, UCFD_FLOAT *uptsb, UCFD_FLOAT *rhsb, UCFD_FLOAT *dub, UCFD_FLOAT *diag, UCFD_FLOAT *fspr, UCFD_FLOAT *dsrc)
 Lower sweep of LU-SGS method for RANS equations. More...
 
void ns_serial_upper_sweep (UCFD_INT neles, UCFD_INT nface, UCFD_INT *nei_ele, UCFD_FLOAT *fnorm_vol, UCFD_FLOAT *vec_fnorm, UCFD_FLOAT *uptsb, UCFD_FLOAT *rhsb, UCFD_FLOAT *dub, UCFD_FLOAT *diag, UCFD_FLOAT *fspr)
 Upper sweep of LU-SGS method for Navier-Stokes equations. More...
 
void rans_serial_upper_sweep (UCFD_INT neles, UCFD_INT nface, UCFD_INT *nei_ele, UCFD_FLOAT *fnorm_vol, UCFD_FLOAT *vec_fnorm, UCFD_FLOAT *uptsb, UCFD_FLOAT *rhsb, UCFD_FLOAT *dub, UCFD_FLOAT *diag, UCFD_FLOAT *fspr, UCFD_FLOAT *dsrc)
 Upper sweep of LU-SGS method for RANS equations. More...
 
void lusgs_serial_ns_update (UCFD_INT neles, UCFD_FLOAT *uptsb, UCFD_FLOAT *rhsb)
 Updates solution array. More...
 
void lusgs_serial_update (UCFD_INT neles, UCFD_FLOAT *uptsb, UCFD_FLOAT *rhsb)
 Updates solution array. More...
 

Detailed Description

LU-SGS time integration method for unstructured grid.

======================================================================================================================

LU-SGS time integration method (Single thread only).
To compute solution of the next time step, refer to the following steps.

(1) Preparing LU-SGS :
Computes diagonal matrix of the Implicit operator.
(2) Lower sweep :
First step of LU-SGS method, which computes intermediate solution difference array.
(3) Upper sweep :
Second step of LU-SGS method, which computes next solution difference array.
(4) Update :
Time integration by adding current solution with next time step solution difference.

Note
In case of RANS equations, add rans_serial_{}_sweep function right after the ns_serial_{}_sweep function.
Be aware that ns and rans sweep function must be paired with each sweep step.
Author
Date
July 2024
Version
1.0
Copyright
Copyright (c) 2024, Namhyoung Kim and Jin Seok Park, Inha University, All rights reserved.
License
This project is release under the terms of the MIT License (see LICENSE file).

Definition in file lusgs.c.

Function Documentation

◆ lusgs_serial_ns_update()

void lusgs_serial_ns_update ( UCFD_INT  neles,
UCFD_FLOAT uptsb,
UCFD_FLOAT rhsb 
)

Updates solution array.

solution array updated by adding \(\Delta Q\). Be aware that rhsb array in function parameter is the difference array after upper sweep, not the right-hand-side array.

Definition at line 313 of file lusgs.c.

Here is the caller graph for this function:

◆ lusgs_serial_update()

void lusgs_serial_update ( UCFD_INT  neles,
UCFD_FLOAT uptsb,
UCFD_FLOAT rhsb 
)

Updates solution array.

solution array updated by adding \(\Delta Q\). Be aware that rhsb array in function parameter is the difference array after upper sweep, not the right-hand-side array.

Definition at line 333 of file lusgs.c.

◆ ns_serial_lower_sweep()

void ns_serial_lower_sweep ( UCFD_INT  neles,
UCFD_INT  nface,
UCFD_INT nei_ele,
UCFD_FLOAT fnorm_vol,
UCFD_FLOAT vec_fnorm,
UCFD_FLOAT uptsb,
UCFD_FLOAT rhsb,
UCFD_FLOAT dub,
UCFD_FLOAT diag,
UCFD_FLOAT fspr 
)

Lower sweep of LU-SGS method for Navier-Stokes equations.

By processing lower sweep, intermediate solution \(\Delta Q^*\) is computed. This function is used for Euler or Navier-Stokes equations, which has the same flux shape.
solution array is stored in dub array.

Definition at line 74 of file lusgs.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ns_serial_upper_sweep()

void ns_serial_upper_sweep ( UCFD_INT  neles,
UCFD_INT  nface,
UCFD_INT nei_ele,
UCFD_FLOAT fnorm_vol,
UCFD_FLOAT vec_fnorm,
UCFD_FLOAT uptsb,
UCFD_FLOAT rhsb,
UCFD_FLOAT dub,
UCFD_FLOAT diag,
UCFD_FLOAT fspr 
)

Upper sweep of LU-SGS method for Navier-Stokes equations.

By processing upper sweep, next time step solution \(\Delta Q\) is computed. This function is used for Euler or Navier-Stokes equations, which has the same flux shape.
Solution array is stored in rhsb array, since right-hand-side array is no longer needed.

Definition at line 193 of file lusgs.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rans_serial_lower_sweep()

void rans_serial_lower_sweep ( UCFD_INT  neles,
UCFD_INT  nface,
UCFD_INT nei_ele,
UCFD_FLOAT fnorm_vol,
UCFD_FLOAT vec_fnorm,
UCFD_FLOAT uptsb,
UCFD_FLOAT rhsb,
UCFD_FLOAT dub,
UCFD_FLOAT diag,
UCFD_FLOAT fspr,
UCFD_FLOAT dsrc 
)

Lower sweep of LU-SGS method for RANS equations.

By processing lower sweep, intermediate solution \(\Delta Q^*\) is computed. This function is used for RANS equations.
solution array is stored in dub array.

Definition at line 129 of file lusgs.c.

Here is the call graph for this function:

◆ rans_serial_upper_sweep()

void rans_serial_upper_sweep ( UCFD_INT  neles,
UCFD_INT  nface,
UCFD_INT nei_ele,
UCFD_FLOAT fnorm_vol,
UCFD_FLOAT vec_fnorm,
UCFD_FLOAT uptsb,
UCFD_FLOAT rhsb,
UCFD_FLOAT dub,
UCFD_FLOAT diag,
UCFD_FLOAT fspr,
UCFD_FLOAT dsrc 
)

Upper sweep of LU-SGS method for RANS equations.

By processing upper sweep, next time step solution \(\Delta Q\) is computed. This function is used for RANS equations.
Solution array is stored in rhsb array, since right-hand-side array is no longer needed.

Definition at line 251 of file lusgs.c.

Here is the call graph for this function:

◆ serial_pre_lusgs()

void serial_pre_lusgs ( UCFD_INT  neles,
UCFD_INT  nface,
UCFD_FLOAT  factor,
UCFD_FLOAT fnorm_vol,
UCFD_FLOAT dt,
UCFD_FLOAT diag,
UCFD_FLOAT fspr 
)

Computes Diagonal matrix for LU-SGS method.

This function computes diagonal matrix of the implicit operator. In LU-SGS method, implicit operator is replaced with spectral radius, so that all element except diagonal is zero. Therefore, diag array can be allocated as one-dimensional, which has less memory requirement.
Diffusive margin of wave speed is applied.

Definition at line 43 of file lusgs.c.

Here is the caller graph for this function: