Boundary condition¶
Algorithm¶
The following describes the flow of logic in setting the boundary conditions.
In drive1.f:
nek_advance(): single timestep if Pn/Pn-2igeom=1: RHS termsigeom=2: Actualcall heatcall fluid-> drive2.f
-
iftran=1,ifrich=0->plan3()inplanx.f
plan3(): Helmholtz operator split into two stepsigeom=1,2makef(): extrapolate pressure, solve for intermadiate velocitysolve for update of pressure, velocity divergence free. Only approximate operator is used here, because the exact one requires Helmholtz operator.
Block LU decomposition -> Consistent Helmholtz operator
Boundary condition is not required for the second step. Preconditioner.
See Blair Perot (1993)
Also if igeom=2:
sethlm:h1=diffusionh2=helmholtz operatorcresvif()compute residual:lagvel, save velocity field
bcdirvc: boundary dirichlet velocity,bcneutr: boundary neutral ->bdry.fopgradt: extrapolate pressire in timeadd residual
ophinv,opadd2: inverse helmholtz-
Project velocity
opgradt: pressureopbinv->navier1:bdry?
opmask: set 0 to dirichlet BC, masked from the update
Boundary conditions¶
Periodicity: node numbering
bcdirvc¶
CB = V (Constant Dirichlet in rea file)CB = v (user provided Dirichlet in userbc):FACEIV: works on temporary arraystmp1, tmpr3facind: face index
facev->userbcopdsop: max min, to get consistent bc shared nodesif not stress forulation
ifstrs:add2-> Velocity + Tmp
bcneutr: Neumann transient?¶
No mask
chkcbc: alignment checkSYM<- calledbcmask<->=nek_initmodifies the masking for one componentAlso by
sethmskb1mask,b2mask,b3maskarrays:FEM trick, if you don’t anything: Natural BC. Normal stresses are 0, BC is the fluxes on the last element.
subs2.f
sh:faceiv-> sets traction array TRX, TRY, TRZ -> as accelerationfaccvs-> multiplies by the surface area -> forceglobrot, does rotation with respect to global coordinatesadded to RHS:
bfx,bfy-> acceleration
Velocity should be v=0
Caution: Pressure preconditioner BC are related
To Do¶
Set velocity v=0, normal component of velocity is zero, opposite of
on boundary condition.
FAQ¶
Time-stepping algebra¶
Mass matrix requires time levels (n, n-1, n-2): extrapolated Conv / Stiffness requires time levels (n-1, n-2): explicit
Comparison with Adams-Bashforth¶
AB2: needs previous RHS BDF: needs previous LHS
Why not: Runge-Kutta?¶
According to mathematicians, it is not clear because you have a pressure correction in each sub-step.
CFL number¶
BDF3/EXT3: CFL=0.6. Characteristic emthod