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

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

#include "coloredlusgs.h"
#include "flux.h"
#include <omp.h>
Include dependency graph for coloredlusgs.c:

Go to the source code of this file.

Functions

void parallel_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 Colored LU-SGS method. More...
 
void ns_parallel_lower_sweep (UCFD_INT n0, UCFD_INT ne, UCFD_INT neles, UCFD_INT nface, UCFD_INT *nei_ele, UCFD_INT *icolor, UCFD_INT *lcolor, 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 Colored LU-SGS method for Navier-Stokes equations. More...
 
void rans_parallel_lower_sweep (UCFD_INT n0, UCFD_INT ne, UCFD_INT neles, UCFD_INT nface, UCFD_INT *nei_ele, UCFD_INT *icolor, UCFD_INT *lcolor, 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 Colored LU-SGS method for RANS equations. More...
 
void ns_parallel_upper_sweep (UCFD_INT n0, UCFD_INT ne, UCFD_INT neles, UCFD_INT nface, UCFD_INT *nei_ele, UCFD_INT *icolor, UCFD_INT *lcolor, 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 Colored LU-SGS method for Navier-Stokes equations. More...
 
void rans_parallel_upper_sweep (UCFD_INT n0, UCFD_INT ne, UCFD_INT neles, UCFD_INT nface, UCFD_INT *nei_ele, UCFD_INT *icolor, UCFD_INT *lcolor, 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 Colored LU-SGS method for RANS equations. More...
 
void lusgs_parallel_ns_update (UCFD_INT neles, UCFD_FLOAT *uptsb, UCFD_FLOAT *rhsb)
 Updates solution array. More...
 
void lusgs_parallel_update (UCFD_INT neles, UCFD_FLOAT *uptsb, UCFD_FLOAT *rhsb)
 Updates solution array. More...
 

Detailed Description

Colored LU-SGS time integration method for unstructured grid.

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

LU-SGS time integration method applying Multi-coloring algorithm.
Multi-thread computation is enabled using <omp.h> header file.
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 Colored LU-SGS functions, icolor and lcolor array are used instead of mapping, unmapping array which are used in serial LU-SGS. Be aware that they have different values albeit the number of arguments and each data type is totally identical.
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 coloredlusgs.c.

Function Documentation

◆ lusgs_parallel_ns_update()

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

Updates solution array.

solution array is 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 338 of file coloredlusgs.c.

Here is the caller graph for this function:

◆ lusgs_parallel_update()

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

Updates solution array.

solution array is 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 360 of file coloredlusgs.c.

◆ ns_parallel_lower_sweep()

void ns_parallel_lower_sweep ( UCFD_INT  n0,
UCFD_INT  ne,
UCFD_INT  neles,
UCFD_INT  nface,
UCFD_INT nei_ele,
UCFD_INT icolor,
UCFD_INT lcolor,
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 Colored LU-SGS method for Navier-Stokes equations.

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 79 of file coloredlusgs.c.

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

◆ ns_parallel_upper_sweep()

void ns_parallel_upper_sweep ( UCFD_INT  n0,
UCFD_INT  ne,
UCFD_INT  neles,
UCFD_INT  nface,
UCFD_INT nei_ele,
UCFD_INT icolor,
UCFD_INT lcolor,
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 Colored 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 208 of file coloredlusgs.c.

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

◆ parallel_pre_lusgs()

void parallel_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 Colored 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 46 of file coloredlusgs.c.

Here is the caller graph for this function:

◆ rans_parallel_lower_sweep()

void rans_parallel_lower_sweep ( UCFD_INT  n0,
UCFD_INT  ne,
UCFD_INT  neles,
UCFD_INT  nface,
UCFD_INT nei_ele,
UCFD_INT icolor,
UCFD_INT lcolor,
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 Colored 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 139 of file coloredlusgs.c.

Here is the call graph for this function:

◆ rans_parallel_upper_sweep()

void rans_parallel_upper_sweep ( UCFD_INT  n0,
UCFD_INT  ne,
UCFD_INT  neles,
UCFD_INT  nface,
UCFD_INT nei_ele,
UCFD_INT icolor,
UCFD_INT lcolor,
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 Colored 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 270 of file coloredlusgs.c.

Here is the call graph for this function: