My Project
programmer's documentation
Functions/Subroutines
cs_user_boundary_conditions_ale.f90 File Reference

User subroutine dedicated the use of ALE (Arbitrary Lagrangian Eulerian) Method: More...

Functions/Subroutines

subroutine usalcl (itrale, nvar, nscal, icodcl, itypfb, ialtyb, impale, dt, rcodcl, xyzno0, disale)
 

Detailed Description

User subroutine dedicated the use of ALE (Arbitrary Lagrangian Eulerian) Method:

See Examples of data settings for boundary conditions ale (cs_user_boundary_conditions_ale.f90) for examples.

Introduction

Here one defines boundary conditions on a per-face basis.

Boundary faces may be identified using the getfbr subroutine. The syntax of this subroutine is described in cs_user_boundary_conditions.f90 subroutine, but a more thorough description can be found in the user guide.

Boundary conditions setup for standard variables (pressure, velocity, turbulence, scalars) is described precisely in cs_user_boundary_conditions.f90 subroutine.

Detailed explanation will be found in the theory guide.

Boundary condition types

Boundary conditions may be assigned in two ways.

For "standard" boundary conditions

One defines a code in the ialtyb array (of dimensions number of boundary faces). The available codes are:

For "non-standard" conditions

Other than (fixed boundary, sliding mesh boundary, fixed velocity), one defines for each face and each component IVAR = IUMA, IVMA, IWMA:

The value of icodcl is taken from the following:

The values of the 3 rcodcl components are:

To the contrary, if the user prescribes icodcl(ifac, ivar) (nonzero), the values assigned to rcodcl will be used for the considered face and variable (if rcodcl values are not set, the default values will be used for the face and variable, so:

If the user decides to prescribe his own non-standard boundary conditions it will be necessary to assign values to icodcl AND to rcodcl for ALL mesh velocity components. Thus, the user does not need to assign values to IALTYB for each associated face, as it will not be taken into account in the code.

Consistency rules

A consistency rules between icodcl codes for variables with non-standard boundary conditions:

Fixed displacement on nodes

For a better precision concerning mesh displacement, one can also assign values of displacement to certain internal and/or boundary nodes. Thus, one need to fill DEPALE and impale arrays :

If the displacement is fixed for all nodes of a boundary face it's not necessary to prescribe boundary conditions at this face on mesh velocity. icodcl and rcodcl values will be overwritten:

If a fixed boundary condition (ialtyb(ifac)=ibfixe) is imposed to the face ifac, the displacement of each node inod belonging to ifac is considered to be fixed, meaning that impale(inod) = 1 and disale(.,inod) = 0.d0.

Description of nodes

nnod gives the total (internal and boundary) number of nodes. Vertices coordinates are given by xyznod(3, nnod) array. This table is updated at each time step of the calculation. xyzno0(3,nnod) gives the coordinates of initial mesh at the beginning of the calculation.

The faces - nodes connectivity is stored by means of four integer arrays : ipnfac, nodfac, ipnfbr, nodfbr.

nodfac(nodfbr) stores sequentially the index-numbers of the nodes of each internal (boundary) face. ipnfac(ipnfbr) gives the position of the first node of each internal (boundary) face in the array nodfac(nodfbr).

For example, in order to get all nodes of internal face ifac, one can use the following loop:

do ii = ipnfac(ifac), ipnfac(ifac+1)-1 !! index number of nodfac array
!! corresponding to ifac
inod = nodfac(ii) !! index-number iith node of face ifac.
!! ...
enddo

Influence on boundary conditions related to fluid velocity

The effect of fluid velocity and ALE modeling on boundary faces that are declared as walls (itypfb = iparoi or iparug) really depends on the physical nature of this interface.

Indeed when studying an immersed structure the motion of corresponding boundary faces is the one of the structure, meaning that it leads to fluid motion. On the other hand when studying a piston the motion of vertices belonging to lateral boundaries has no physical meaning therefore it has no influence on fluid motion.

Whatever the case, mesh velocity component that is normal to the boundary face is always taken into account ( $ \vect{u}_{fluid} \cdot \vect{n} = \vect{w}_{mesh} \cdot \vect{n} $).

The modeling of tangential mesh velocity component differs from one case to another.

The influence of mesh velocity on boundary conditions for fluid modeling is managed and modeled in Code_Saturne as follows:

Note that mesh velocity has no influence on modeling of boundary faces with 'inlet' or 'free outlet' fluid boundary condition.

For "non standard" conditions USER has to manage the influence of boundary conditions for ALE method (i.e. mesh velocity) on the ones for Navier Stokes equations(i.e. fluid velocity). (Note that fluid boundary conditions can be specified in this subroutine.)

Cells identification

Cells may be identified using the getcel subroutine. The syntax of this subroutine is described in the cs_user_boundary_conditions.f90 subroutine, but a more thorough description can be found in the user guide.

Faces identification

Faces may be identified using the getfbr subroutine. The syntax of this subroutine is described in the cs_user_boundary_conditions.f90 subroutine, but a more thorough description can be found in the user guide.

Function/Subroutine Documentation

◆ usalcl()

subroutine usalcl ( integer  itrale,
integer  nvar,
integer  nscal,
integer, dimension(nfabor,nvar icodcl,
integer, dimension(nfabor)  itypfb,
integer, dimension(nfabor)  ialtyb,
integer, dimension(nnod)  impale,
double precision, dimension(ncelet)  dt,
double precision, dimension(nfabor,nvar,3)  rcodcl,
double precision, dimension(3,nnod)  xyzno0,
double precision, dimension(3,nnod)  disale 
)
Parameters
[in]itralenumber of iterations for ALE method
[in]nvartotal number of variables
[in]nscaltotal number of scalars
[out]icodclboundary condition code:
  • 1 Dirichlet
  • 2 Radiative outlet
  • 3 Neumann
  • 4 sliding and $ \vect{u} \cdot \vect{n} = 0 $
  • 5 smooth wall and $ \vect{u} \cdot \vect{n} = 0 $
  • 6 rough wall and $ \vect{u} \cdot \vect{n} = 0 $
  • 9 free inlet/outlet (input mass flux blocked to 0)
[in,out]itypfbboundary face types
[out]ialtybboundary face types for mesh velocity
[in]impaleindicator for fixed node displacement
[in]dttime step (per cell)
[in,out]rcodclboundary condition values:
  • rcodcl(1) value of the dirichlet
  • rcodcl(2) value of the exterior exchange coefficient (infinite if no exchange)
  • rcodcl(3) value flux density (negative if gain) in w/m2 or roughness in m if icodcl=6
    1. for the velocity $ (\mu+\mu_T) \gradv \vect{u} \cdot \vect{n} $
    2. for the pressure $ \Delta t \grad P \cdot \vect{n} $
    3. for a scalar $ cp \left( K + \dfrac{K_T}{\sigma_T} \right) \grad T \cdot \vect{n} $
[in,out]disalenodes total displacement (from time 0 to n)
[in]xyzno0vertex coordinates of initial mesh