Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X Conduction–convection problems 1. General differential equation 1.1. Momentum equation: ϕ = u 1.2. Control–volume discretization equation for simple situation 2. Four basic rules for discretization equation 2.1. Consistency at control–volume faces 2.2. Positive coefficients 2.3. Negative–slope linearization of source term 2.4. Sum of the neighbor coefficients 3. Heat conduction 3.1. Conduction–type problems d k dT 3.2. Steady 1–D conduction dx dx + S = 0 3.3. Grid spacing 3.4. Interface conductivity 3.5. Limiting cases Conduction–convection problems Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 4. Convection and diffusion 4.1. Steady 1–D convection and diffusion 4.2. Upwind scheme (upstream–difference, donor–all method) 5. Exact solution 6. Exponential scheme 7. Hybrid scheme 8. Power–law scheme 9. Generalized formulation 9.1. Example ϕE = 1; ϕW = 0 9.2. Discretization equation of general diffusion equation in 3D 10. Flow field calculation R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 11. Additional features 11.1. Pressure–gradient terms 11.2. Continuity equation 12. Solution: staggered grid 13. Momentum equation 13.1. How to get guessed pressure field p∗ to get to “correct” pressure field? 13.2. Pressure–correction equation 13.3. Special discussions 13.4. SIMPLER algorithm 14. Examples Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 1. General differential equation ∂ ∂t (% φ) + div (% ~u φ) = div (Γ grad φ) +S {z } | {z } | Convection term φ % Γ S ~u = = = = = Dif f usion term dependent variable density diffusion coefficient source term velocity field Remarks: 1. % is related to variables like mass fraction and temperature (Equation of state) 2. Additional constraint for flow field → mass conservation of continuity equation: ∂% + div (% ~u) = Scon ∂t 3. If diffusion terms are not governed by gradient of relevant variable φ → contribution in S Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 1. General differential equation 1.1. Momentum equation: φ = u ∂ ∂t ∂p (% u) + div (% ~u u) = div (µ grad u) − ∂x + B x + Vx u p Bx Vx = = = = x–direction velocity pressure x–direction body force per unit volume additional viscous terms not included in div (µ grad u) All relevant differential equations for heat and mass transfer, fluid flow, turbulence and related phenomena can be brought into standard form → general φ equation → general numerical procedure ? Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 1. General differential equation • Calculational domain is divided into nonoverlapping control volumes (one control volume surrounding each grid point) • Differential equation is integrated over each control volume • Piecewise profiles expressing variation of φ between grid points are used for integrals ⇒ discretization equation for φ: express conservation principle for φ for finite control volume → guarantees always conservation (exact balance) Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 1. General differential equation 1.2. Control–volume discretization equation for simple situation d k dT steady one–dimensional heat conduction: dx dx + S = 0 (δx)w Grid: (δx)e w W (x–direction) e P E ∆x dashed lines = faces of control volume volume of control volume (assume ∆y = ∆z = 1): ∆x × 1 × 1 k dT dx e → integral over control volume: − k dT dx w + Re S dx = 0 w Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 1. General differential equation T Profiles: Assumption necessary! e.g.: stepwise profile piecewise-linear profile W w stepwise profile: problem for dT dx P at control–volume faces e E x Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 1. General differential equation Discretization equation: piecewise–linear profile used ⇒ ke ·(TE −TP ) (δx)e P −TW ) − kw (T(δx) + S̄ ∆x = 0 w ↓ average value of S over control volume ⇔ a P TP = aE · T E + aW · T W + b in general: with: aE = ke (δx)e • a P TP = P aw = kw (δx)w aP = aE + aW b = S̄ ∆x anbTnb + b all neighbors • other interpolation functions for profiles give same general form • different profiles possible for different quantities (S̄, ke) or different terms (T ; dT dx ; . . .) Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 2. Four basic rules for discretization equation 2.1. Consistency at control–volume faces Flux across a control volume face must be the same for both directions (integral balance) T quadratic profile can produce inconsistency at interface interface flux inconsistency: assume that fluxes at faces of given control volume are all governed by center– point conductivity kP slope from left W P slope from right E EE x P −TE → heat flux at e: kP T(δx) (point P) P −TE kE T(δx) (point E) e e Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 2. Four basic rules for discretization equation Source term: usually linearized as S̄ = Se + SP TP ↓ ↓ constant part linearization coef f icient with respect to TP (not S evaluted at P !) ⇒ a P T P = a E · T E + a W T W + bi with aE = ke (δx)e aW = kw (δx)w aP = aE + aW − SP ∆x b = Se ∆x Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 2. Four basic rules for discretization equation 2.2. Positive coefficients φ at a grid point is influenced by values at neighboring grid points through convection and conduction → increase of φ at one point should increase φ at neighboring points → if TE ↑ =⇒ TP ↑ ←→ aE and aP must have same sign in general: neighbor coefficients anb and center–point coefficient aP must have same sign (we choose positive sign) Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 2. Four basic rules for discretization equation 2.3. Negative–slope linearization of source term even if aW0 > 0 (aP can get negative) aP ≥ 0 via SP term → S̄ = Se + SP TP with SP ≤ 0 SP > 0: physical situation can get unstable without heat removal ⇒ TxP ↑ SP ↑ Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 2. Four basic rules for discretization equation 2.4. Sum of the neighbor coefficients ! aP = P anb If differential equation remains satisfied after adding a constant to φ T gets determined by boundary condition comment: discretization equation without source linearization obeys this rule, but not the equation with source linearization (correct, because if source term depends on φ, both φ and φ + e are no longer solutions of the differential equation) If S = 0 and Tnb = constant =⇒ TP must get the source value Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 3. Heat conduction for general algorithm: omit convection term (included later) 3.1. Conduction–type problems heat conduction, potential flow, mass diffusion, flow through porous media, electromagnetic field theory, diffusion models of thermal radiation, . . . d 3.2. Steady 1–D conduction dx k dT dx + S = 0 ⇒ a P TP = aE TE + aW TW + b ke aE = (δx) e kW (δx)w aW = aP = aE + aW − SP ∆x b = Se ∆x • piecewise–linear profile for T (x) dT dx • S = Se + SP TP −→ stepwise profile Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 3. Heat conduction 3.3. Grid spacing nonuniform grids gives better computing power efficiency: fine grid, where T (x) variation is steep comment: nonuniform grids do not lead to less accuracy if grid spacing is ”correctly” adapted to T (x) no general recipe for best mesh spacing available Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 3. Heat conduction 3.4. Interface conductivity (δx) e+ (δx) e - P nonuniform conductivities: e.g. nonhomogeneity of material, T – dependence of k E e (δx) e simple–mined ansatz (linear variation of k between P and E): (δx) ke = fe kP + (1 − fe) kE fe = (δx)e+ e midway position of e: → fe = 0.5 ke = arithmetic mean of kP and kE ⇒ leads to rather incorrect implications Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 3. Heat conduction much better ansatz: main objective is good representation of heat flux qe at interface: qe = → desired expression for ke is the one with correct q ⇒ assume control volume around P has material with kP E kE → composite slab between P and E (without S): qe = −1 (δx) 1−fe fe ⇒ ke = k + k fe = (δx)e+ P E ke ·(TP −TE ) (δx)e TP −Te (δx)e− /kP +(δx)e+ /kE e ⇒ midway interface e: fe = 0.5 ke−1 = 0.5 kP−1 + kE−1 (harmonic mean) ↔ arithmetic mean of simple ansatz is wrong ⇒ aE = h (δx)e− kP + i (δx)e+ −1 kE → aE represents conductance of material between P and E (similar procedure for a ) Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 3. Heat conduction 3.5. Limiting cases 1. kE → 0: ke → 0 heat flux at the face of an insulator should get zero (arithmetic–mean would give nonzero ) 2. kP kE : ke → kfEe interface conductivity independent of kP (material around P offers negligible resistance) (arithmetic–mean would keep kP –effect on ke ) P −TE ) ke is not kE , but kfEe : qe = ke(T (δx) + e kP k E : • TP will prevail up to interface e • temperature drop will take place over (δx)e+ → factor fe compensates use of nominal distance (δx)e in original equation ⇒ this formulation can handle abrupt changes in conductivity without need of fine grid Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 4. Convection and diffusion only term missing for general equation: convection term → created by fluid flow → obtain a solution in presence of given flow field (calculation of flow field see later) remark: flow field must satisfy continuity equation ∂% + ∂x∂ j (%uj ) = 0 (without sources) ∂t ∂φ ∂ ∂ ∂ → general diffusion equation: ∂t (%φ) + ∂xj (%uj φ) = ∂xj Γ ∂xj + S ∂φ ∂φ ∂φ ∂ can be rewritten: % ∂t + %uj ∂xj = ∂xj Γ ∂xj + S (*) ⇒ for given %, uj , Γ, S: any φ and φ+constant satisfy (*) ⇒ basic rule 4 (sum of coefficients) apply Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 4. Convection and diffusion 4.1. Steady 1–D convection and diffusion dφ d d u = velocity in x–direction dx (%uφ) = dx Γ dx continuity equation: d dx (%u) = 0 ←→ %u = constant integrating over control volume: (%uφ)e − (%uφ)w = convection term: (piecewise–linear profile) → φe = 1 2 (φE + φP ) φw = 1 2 1 2 (φP + φW ) ⇐⇒ assumed midway interfaces ⇒ 12 (%u)e (φE + φP ) − 21 (%u)w (φP + φW ) = | dφ Γ dx dφ − Γ dx e {z w} already discussed (piecewise − linear prof ile) Γe (φE −φP ) (δx)e P −φW ) − Γw (φ(δx) w Γe and Γw obtained as discussed for interface conductivity: harmonic mean for midway location Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 4. Convection and diffusion new symbols: F = %u Γ D = δx strength of convection diffusion conductance (≥ 0) F is positive for u > 0 ⇒ and negative for u < 0 aP φP = a E φE + a W φW aw = Dw + F2w aE = De − F2e aP = De + F2e + Dw − F2w = aE + aW + (Fe − Fw ) Remarks: • Fe = Fw (continuity) ⇒ aP = aE + aW • discretization equation (piecewise–linear profile for φ) is central– difference scheme • problems, if coefficient gets negative (|F | > 2D) e.g.: φE = 100, φW = 200, → φP = 250 if this happens: unphysical solutions F ) ←→ central–difference limited to low Reynolds numbers (low D • zero diffusion (Γ = 0) ⇒ aP = 0 → solution unsuitable for iterative methods Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 4. Convection and diffusion 4.2. Upwind scheme (upstream–difference, donor–all method) weak point in preliminary discussion is that convected property φe is average of φE and φP diffusion term: unchanged convection term: value of φ at interface is equal to value of φ at grid point on upwind side → φe = φP if Fe > 0 φe = φE if Fe < 0 ←→ Feφe = φP Fe, 0 − φE −Fe, 0 ( A, B : greater of A and B) ⇒ a P φP = a E φE + a W φW aE = De + −Fe, 0 a W = DW + FW , 0 aP = aE + aW + (Fe − FW ) = De + Fe, 0 + Dw + −Fw , 0 Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 4. Convection and diffusion • this forms guarantees always positive coefficients • main physics idea: ”tank–and–tube” model control volume = b stirred tanks connected in series by short tubes flow through tubes ←→ convection conduction through tank walls ←→ diffusion ⇒ fluid flowing in each connecting tube has temperature that prevails in tank on upstream side Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 4. Convection and diffusion for discretization equation approximate φ ∼ x profile necessary ←→ • linear profile (preliminary derivation): only valid for small |P | dφ dx • |P | large → nearly 0 at x = L 2 ⇒ upwind scheme overestimates diffusion in this case ⇒ exact solution possible by using complete expression (→ exponential scheme) Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 5. Exact solution d dx (%uφ) = d dx Γ dφ dx % · u = constant (continuity equation) Γ = constant (boundary conditions: x = 0, φ = φ0; x = L, φ = φL) exact solution: φ φL φ−φ0 φL −φ0 = exp(P x/L)−1 exp(P )−1 P = Péclet number = ratio of strength of convection and diffusion P = % uΓ L -P>>1 P = 0 → pure diffusion (conduction) φ ∼ x variation linear P > 0 → φ more influenced by upstream value φ0 P < 0 → reversed picture P=0 P=-1 P=1 φ0 P>>1 L x Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 6. Exponential scheme consider total flux: J = %uφ − Γ dφ dx d d ⇒ dx Γ dφ ←→ dJ (%uφ) = dx = 0 dx dx integration over control volume: Je − Jw = 0 use exact solution as profile between P an E (φP and φE replacing φ0 and φL; (δx)e replacing L) (%u)e (δx)e φP −φE = DFee ⇒ Je = Fe φP + exp(Fe)−1 ; Pe = Γe JE is independent of location of interface (clear, because we started from dJ dx = 0) similar for w Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 6. Exponential scheme ⇒ a P φP = a E φE + a W φW aE = Fe exp(Fe /De )−1 ; aW = Fw exp(Fw /Dw ) exp(Fw /Dw )−1 aP = aE + aW + (Fe − Fw ) exact scheme for steady 1–D, but: • exponentials are expensive to compute • scheme not exact for 2 or 3D, nonzero sources, . . . ⇒ needed: easy–to–compute scheme with qualitative behavior of exponential scheme Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 7. Hybrid scheme aE De = aE De Pe exp(Pe )−1 P aE =1- e De 2 ( Pe = 0) exact aE = - Pe De ( Pe → - ∞ ) -2 -4 0 2 Pe 4 aE = 0 ( Pe→ ∞) De Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 7. Hybrid scheme → approximation to exact curve: aE = −P Pe < −2 : D e e aE = De −Pe, 1 − P2e , 0 aE Pe −2 ≤ Pe ≤ 2 : De = 1 − 2 ←→ aE = −Fe, De − F2e , 0 aE Pe > 2 : D e = 0 hybrid scheme: • identical to central–difference scheme for −2 ≤ Pe ≤ 2 • outside this: upwind scheme (diffusion = 0) ←→ aP φP = aE φE + aW φW aE = −Fe, De − F2e , 0 FW 2 ,0 a W = FW , D W + aP = aE + aW + (Fe − FW ) Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 8. Power–law scheme departure of hybrid scheme from exact curve is rather large at Pe = ±2 → power–law scheme (extremely good approximation) Pe < −10: aCEe = −Pe −10 ≤ Pe < 0: aE De = (1 + 0.1Pe)5 − Pc 0 ≤ Pe ≤ 10: aE De = (1 + 0.1Pe)5 ↔ a E = De aE = 0 Pe > 10: D e 5 0.1|Fe| 0, 1 − De + 0, −Fe recommended scheme: accurate and fast Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 9. Generalized formulation ⇒ a P φP = a E φE + a W φW aE = DeA(|Pe|) + −Fe, 0 aW = D + W A(|PW |) + FW , 0 aP = aE + aW + (Fe − Fw ) different schemes: different functions 1 − 0.5|P | 1 0, 1 − 0.5|P | A(|P |) = 0, (1 − 0.1|P |)5 |P |/ exp(|P |) − 1 A(|P |) central difference upwind hybrid power law exponential (exact) Max-Planck-Institut für Plasmaphysik, EURATOM Association 9. Generalized formulation WENDELSTEIN 7-X 9.1. Example: φE = 1; φW = 0 A(|P|) 1.0 • all schemes except central difference give physically realistic solution upwind 0.5 • central–difference scheme produces some values outside 0−1 range of boundary values (reasonable solutions for P < 2) exponential power law hybrid grid Péclet number P < 2 → grid refinement (uneconomic) |P| central difference Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 9. Generalized formulation 9.2. Discretization equation of general diffusion equation in 3D aP φP = a E φE + a W φW + a N φN + a S φS + a T φT + a B φB + b aE aW aN aS aT = = = = = DeA(|Pe|) + −Fe, 0 Dw A(|Pw |) + Fw , 0 DnA(|Pn|) + −Fn, 0 DsA(|Ps|) + Fs, 0 DtA(|Pt|) + Ft, 0 Fe Fw Fn Fs Ft = = = = = (% (% (% (% (% u)e u)w v)n v)s w)t ∆y ∆z ∆y ∆z ∆z ∆x ∆z ∆x ∆x ∆y = = = = = Γe ∆y ∆z (δx)e Γw ∆y ∆z (δx)w Γn ∆z ∆x (δy)n Γs ∆z ∆x (δy)s Γt ∆x ∆y (δz)t Db = Γb ∆x ∆y (δz)b De Dw Dn Ds Dt %0P ∆x ∆y ∆z ∆t a0P = b = Se ∆x ∆y ∆z + a0P φ0P Fb = (% w)b ∆x ∆y aP = aE + aW + aN + aS + aT + aB + a0P − SP ∆x ∆y ∆z Pe = Fe D ; power–law: A(|P |) = 0, (1 − 0.1|P |)5 Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 10. Flow field calculation How to calculate the flow field? problem: • not non–linearity (convection coefficient %u = b k being function of T) • unknown pressure field: pressure gradient forms part of source term for momentum equation → no obvious equation for obtaining pressure (for given pressure field: no problem) problem: correct pressure field satisfies continuity equation and momentum equation (problem for iterative methods; direct solution of complete set of equations does not have this) ⇒ how to convert indirect information in continuity equation into direct algorithm for calculation of pressure Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 11. Additional features 11.1. Pressure–gradient terms new feature: −dp dx integrated over control volume resulting contribution: pw − pe (net pressure force) • assume piecewise–linear profile for pressure • midway faces c and w: pw − p e = pw +pP 2 E − pP +p = 2 pW −pE 2 → momentum equation contains pressure difference between 2 alternate grid points, not between adjacent ones Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 11. Additional features ⇒ pressure is taken from coarser grid ⇒ zig–zag fields are felt like uniform pressure field 1D: 100 500 x x 2D: 100 5 100 5 100 100 x 500 x 100 500 x x 300 100 300 100 300 27 5 27 5 27 300 100 300 100 300 27 5 27 5 27 300 100 300 100 300 Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 11. Additional features 11.2. Continuity equation similar problem as in 9.2.16.1. 1–D: du dx =0 (simplest situation) → (integration over control volume): ue − uw = 0 piecewise–linear profile for u midway faces → uP +uE 2 P − uW +u = uE − uW = 0 2 → zig–zag fields satisfy above equation Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 12. Solution: staggered grid variables do not have to be calculated on same grid → staggered grid for velocities (on all faces of control volumes) → staggered grid removes zig–zag problems, because velocities of adjacent velocity components enter Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 13. Momentum equations 13.1. How to get guessed pressure field p∗ to get to ”correct” pressure field? correct pressure: p = p∗ + p0 (p0 = pressure correction) ←→ u = u∗ + u0; v + v ∗ + v 0; w = w ∗ + w0 X 0 ⇒ a e ue = anbu0nb + (p0P − p0E ) Ae | {z } now drop this term (discussion later) → aeu0e = (p0P − p0E ) Ae ←→ ux0e = de (p0P − p0E ) with de = y velocity–correction formula: = b ue = u∗e + de (p0P − p0E ) same for: vn = vn∗ + dn (p0P − p0N ) wt = wt∗ + dt (p0P − p0T ) Ae ae Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 13. Momentum equations 13.2. Pressure–correction equation turn continuity equation into equation for pressure correction assume (for derivation, discussion later): density % does not directly depend on pressure continuity equation: discretized equation: ∂% ∂t + ∂(%u) + ∂(%v) + ∂(%w) = 0 ∂x ∂y ∂z + (%u)c − (%u)w ∆y ∆z + (%v)n − (%v)s ∆z ∆x + (%w)t − (%w)b ∆x ∆y = 0 (%p−%◦P ) ∆x ∆y ∆z ∆t Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 13. Momentum equations use velocity–corrections formulas: → discretization equation for p0: aP · p0P = aE · p0E + aW · p0W + aN · p0N + aS · p0S + aT · p0T + aB · p0B + b aE = %e de ∆y ∆z, . . . aP = aE + aW + aN + aS + aT + aB (%◦ −% ) ∆x ∆y ∆z ∗ + (%u )w − (%u∗)e ∆y ∆z b = P P ∆t + (%v ∗)s − (%v ∗)n ∆z ∆x + (%w ∗)b − (%w ∗)t ∆x ∆y term b in pressure–correction equation: essentially the negative of the left–hand size of discretized continuity equation evaluated in terms of ”starred” velocities b = 0 → starred velocities satisfy correction correction and continuity equation → correct velocities Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 13. Momentum equations ⇒ SIMPLE algorithm (semi–implicit method for pressure–linked equation) 1. guess pressure field p∗ 2. solve momentum equation for u∗, v ∗, w ∗ 3. solve p0 equation 4. calculate p from p0 and p∗ 5. calculate u, v, w from u∗, v ∗, w ∗ 6. solve discretization equation for other φ’s 7. treat correct pressure p as now guessed pressure p∗ 8. goto 2.; repeat until convergence Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 13. Momentum equations Pressure–correction continuity equation: ∂%u∗ ∂x ∗ ∂% ∂t ∂%v + ∂%u ∂x + ∂y = 0 ∂% ∂t =0 0 u = u ∗ + u0 v = v∗ + v0 0 ∂%u ∂%v + ∂%v ∂y + ∂x + ∂y = 0 0 0 ∂% ∂p ∂%u∗ ∂%v ∗ ∂% ∂p ∂x + + ∂x + ∂y∂y = 0 | ∂x {z ∂y } b 0 ∂% ∂p + ∂x∂y + 0 ∂% ∂p ∂y ∂y = 0 ←→ 2nd order equation for p0 Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 13. Momentum equations 13.3. Special discussions 1. • keeping this term would involve pressure correction at all grid points • semi–implicit method: omission of this term • omission of this term: for converged solution no error (b = 0, p 0 = 0) • b as indicator for convergence (b → 0) however: rate of convergence depends on p0 equation underrelaxation necessary for p: p = p∗ + αP · p0 (αP = 0.5 − 0.8) 2. correct velocity field → first give wrong pressure field convergence later through iterations Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 13. Momentum equations improved convergence → SIMPLER (SIMPLE revised) P motivation: omission of anbu0nb leads to exaggerated pressure correction → underrelaxation essential neighbor–point velocity corrections removed → pressure correction has entire burden for velocity–correction pressure–correction equation is good for velocity correction, but rather bad for pressure correction ⇒ basic idea: employ pressure–correction equation only for velocity–correction and use other means for improved pressure field pressure equation (momentum equation): ue = define pseudo–velocity u be: u be = P anb unb +b ae P anb unb +b ae + de (pP − pE ) (b ue contains no pressure) Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 13. Momentum equations similarly: vn = vbn + dn (pP − pN ) wt = w bt + dt (pP − pT ) u b, vb, w b appears in place of u∗, v ∗, w ∗ p appears in place of p0 → equation for pressure: a P pP = a E pE + a W pW + a N pN + a S pS + a T pT + a B pB + b aE , . . . given as before (%◦P −%P ) ∆x ∆y ∆z + (%b u ) − (%b u ) ∆y ∆z b = w ∆t e + (%b v)s − (%b v )n ∆z ∆x + (%w) b b − (%w) b t ∆x ∆y • equation for b is only difference between pressure equation and pressure– correction equation • no approximation introduced for derivation of pressure equation ⇒ correct velocity field would result in correct pressure Conduction–convection problems R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 13. Momentum equations 13.4. SIMPLER algorithm revised algorithm solves pressure equation to obtain pressure field and solves pressure–correction equation only to correct velocities 1. start with guessed velocity field 2. calculate coefficient for momentum equation and calculate u b, vb, w b 3. calculate coefficient for pressure equation and solve it for pressure field 4. take this pressure field as p∗; solve momentum equation for u∗, v ∗, w ∗ 5. calculate mass source b and solve p0–equation 6. correct velocity field, but do not correct pressure 7. solve equations for other φ’s 8. return to 2.; repeat until convergence remark: SIMPLER does not use guessed pressure fields, but extracts pressure Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 14. Examples: momentum Conduction–convection problems Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 14. Examples: source R. Schneider Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 14. Examples: circle Conduction–convection problems Max-Planck-Institut für Plasmaphysik, EURATOM Association WENDELSTEIN 7-X 14. Examples: wall R. Schneider