Copyright c 2007 Tech Science Press CMES, vol.17, no.2, pp.95-114, 2007

Fictitious Domain Approach for Spectral/hp Element Method

L. Parussini1

Abstract: We propose a fictitious domain approaches have been developed to implement method combined with spectral/hp elements for immersed conditions and we can find different the solution of second-order differential prob- applications: to acoustics [Heikkola, Kuznetsov, lems. This paper presents the formulation, and Lipnikov (1999); Hetmaniuk and Farhat validation and application of fictitiuos domain- (2002); Hetmaniuk and Farhat (2003)], fluid dy- spectral/hp element algorithm to one- and two- namics [Glowinski, Pan, and Periaux (1994); dimensional Poisson problems. Fictitious domain Glowinski, Pan, and Periaux (1995); Glowin- methods allow problems formulated on an intri- ski, Pan, and Periaux (1997); Glowinski, Pan, cate domain Ω to be solved on a simpler domain Hesla, Joseph, and Periaux (1999); Glowinski, Π containing Ω. The Poisson equation, extended Pan, Hesla, Joseph, and Periaux (2001)], bio- to the new domain Π, is expressed as an equiv- medical problems [Arthurs, Moore, Peskin, Pit- alent set of first-order equations by introducing man, and Layton (1998); Roma, Peskin, and the gradient as an additional indipendent variable, Berger (1999); Jung and Peskin (2001); de Hart, and spectral/hp element method is used to develop Peters, Schreurs, and Baaijens (2000); Baaijens the discrete model. Convergence of relative en- (2001); de Hart, Peters, Schreurs, and Baaijens ergy norm η is verified computing smooth solu- (2003)]. In general we have to distinguish the tions to one- and two-dimensional Poisson equa- case of Dirichlet, Neumann or Robin conditions. tions. Thermal field calculations for heatsink pro- Methods to implement Dirichlet conditions can file is presented to demonstrate the predictive ca- be classified in penalty methods and Lagrangian pability of the proposed formulation. methods, as illustrated by [Heikkola, Kuznetsov, Neittanmaki, and Pironneau (2003)]. There are Keyword: fictitious domain, Lagrange multi- examples of Elimination method [Zienkiewicz pliers, spectral/hp element method, Poisson prob- and Taylor (2000)], Penalty method [Zienkiewicz lem. and Taylor (2000); Ramiere, Angot, and Bel- liard (2005)], Distributed Lagrangian method 1 Introduction [Haslinger, Maitre, and Tomas (2001); Glowinski, Pan, Hesla, and Joseph (1999); Glowinski, Pan, The main motivation for fictitious domain ap- Hesla, Joseph, and Periaux (2000)], Boundary proach, alternatively called immersed boundary Lagrangian method [Stenberg (1995); Joly and method, is that, defining the extended problem Rhaouti (1999)], Fat Boundary method [Maury on a simple domain, enables the use of effi- (2001)]. Among all the possible approaches, a cient discretization methods on simple structured technique which is popular, given its efficiency, grids. Literature on fictitious domain methods is to enforce the Dirichlet condition by Lagrange goes back to the sixties [Saul’ev (1963)]. In multipliers, which is the method we propose in the following years there has been a crescent in- this paper. Unfortunately, the same approach can terest on this kind of methodologies [Babuska not be adopted for Neumann immersed boundary (1973); Pitkaranta (1979); Pitkaranta (1980); condition because that one can not be directly en- Pitkaranta (1981); Barbosa and Hughes (1991); forced by Lagrange multipliers [Hetmaniuk and Barbosa and Hughes (1992)]. So that several Farhat (2003)]. Enforcing Neumann boundary conditions within a fictitious domain framework 1 University of Trieste, Mech. Eng. Dept., ITALY. 96 Copyright c 2007 Tech Science Press CMES, vol.17, no.2, pp.95-114, 2007 is not an easy task. To treat them within a as follows: fictitious domain framework least-squares for- find φ(x) such that mulations have been proposed by [Dean, Dihn, Glowinski, He, Pan, and Periaux (1992)], vector −φ = f inΩ (1) s dual formulations with Lagrange multipliers have φ = φ on Γφ (2) been presented in [Joly and Rhaouti (1999); Quar- ∇φ • nˆ = qs on Γ (3) teroni and Valli (1999)] and an algebraic fictitious n q domain approach in [Rossi and Toivanen (1999); where Γ = Γφ Γq and Γφ Γq = 0,/ f is the Makinen, Rossi, and Toivanen (2000)]. We have source term, nˆ is the outward unit normal on chosen to impose it via Lagrange multipliers, in- boundary Γ, φ s is the prescribed value of φ on troducing the gradient of the primal variable as Γ s boundary φ and qn is the prescribed normal flux an unknown and converting Neumann condition on boundary Γq. into a Dirichlet-like condition for this new vari- To enable the implementation of Neumann able. This technique seems to be very efficient, at boundary condition via Lagrange multipliers, we the expense of an increase of computational cost proceed by replacing the Poisson problem, Eq. 1- as it replaces a scalar problem by a vector prob- Eq. 3, with its equivalent first-order system, at the lem. expense of additional variables. The equivalent New approach, we present in this paper, is the problem writes as: coupling of fictitious domain together with an find φ(x) and u(x) such that high order method. To discretize the problem un- der study we use the spectral/hp element method, u−∇φ = 0inΩ (4) based on higher order functions, locally defined −∇• u = f inΩ (5) over finite size parts of domain. The advantage φ = φ s Γ of such kind of method, in comparison with tra- on φ (6) • = s Γ ditional finite element method, is its exponential u nˆ qn on q (7) convergence property with the increasing of poly- nomial order p. Moreover using fictitious domain where u is a vector valued function whose com- φ approach, where extended problem is defined on ponents are the fluxes of scalar function ,asde- a simple domain, enables the use of efficient com- fined in Eq. 4. putational grids, in our case just simple Cartesian We can write the system Eq. 4-Eq. 5 defined on Ω grids. domain in matrix form as: Good accuracy properties of the method are LΦ = F (8) demonstrated by numerical experiments. These ones are performed with several mesh size and where L is the matrix operator, Φ is the vector of polinomyal order of modal function to better unknowns and F is the vector of known terms. In quantify the performance of the proposed solution two dimensions it is: ⎡ ⎤ procedure. Finally, the calculation of the thermal ∂ ⎧ ⎫ ⎧ ⎫ 10− ⎨ φ ⎬ ⎨ ⎬ field for a heatsink fin illustrates the capabilities ⎢ ∂x ⎥ x 0 ⎣ 01− ∂ ⎦ φ = of the method in a practical engineering example. ∂y ⎩ y ⎭ ⎩ 0 ⎭ (9) − ∂ − ∂ φ f ∂x ∂y 0 2 Formulation of the problem: the Poisson φ = ∂φ φ = ∂φ equation with x ∂x y ∂y . Let Ω be the closure of an open bounded region 3 Fictitious domain method Ω in ℜn,wheren represents the number of space =( ,..., ) dimensions, and let x x1 xn be a point in Several variants of fictitious domain method ex- Ω = Ω ∂Ω,where∂Ω = Γ is the boundary of ist: the basic idea is to extend the operator and the Ω. We want to solve the Poisson problem stated domain into a larger simple shaped domain. The Fictitious Domain Approach for Spectral/hp ElementMethod 97

2 most important ways to do this are algebraic and Π ⊃ Ω with fΠ extension of f to L (Π) and im- functional analytic approaches. In algebraic fic- mersed constraints enforced via Lagrange mul- titious domain methods the problem is extended tipliers. The variational formulation of the new typically at algebraic level in such a way that the equivalent problem will be: solution of original problem is obtained directly as a restriction of the solution of extended prob-  ,  − ,∇φ + ,λ  = lem without any additional constraint. There are v u Π v Π v q Γq 0 (12) several variants of such an approach [Rossi and −ϕ,∇• uΠ +ϕ,λφ Γφ =(ϕ, f )Π (13) Toivanen (1999); Makinen, Rossi, and Toivanen μ ,uΓ = 0 (14) (2000)] and they can be rather efficient, but typi- q q μ ,φ = cally they are restricted to quite a narrow class of φ Γφ 0 (15) problems. where Γ = ∂Ω and Γ = Γφ Γ . The Lagrange More flexibility and better efficiency can be ob- q multiplier defined on Γφ is denoted by λφ , with μφ tained by using a functional analytic approach the associated weight function, and the Lagrange where the use of constraints ensures that the so- multiplier defined on Γ is denoted by λ , with μ lution of extended problem coincides with the so- q q q the associated weight function (see [Zienkiewicz lution of original problem. In our implementation and Taylor (2000)] for more details). we enforce constraints by Lagrange multipliers. The solution of Poisson problem, Eq. 1-Eq. 3, will For simplicity, let us consider the model problem be the restriction to Ω of the solution of Eq. 12- Eq. 4-Eq. 5 with homogeneous boundary condi- Eq. 15, which are defined on domain Π. tions. The standard approach to solve it is to search for the solution which minimizes the vari- 4 Discretization: spectral/hp element method ational problem, in practice: find (φ,u) ∈ X such that for all admissible weight- The problem Eq. 12-Eq. 15 can not be solved ing functions (ϕ,v) ∈ X analytically and therefore it is necessary to use a numerical method to get approximated solu- tion. The spectral/hp element method is a numeri-  ,  − ,∇φ = v u Ω v Ω 0 (10) cal technique for solving partial differential equa- −ϕ,∇• uΩ =(ϕ, f )Ω (11) tions based on variational formulation of bound- ary and initial value problems [Karniadakis and where ·,·Ω and (·,·)Ω denote the stand- = Sherwin (1999); Pontaza and Reddy (2003); Es- ard H1 and L2 inner products and X  1 1 kilsson and Sherwin (2005); Gerritsma and Maer- (φ,u) ∈ H (Ω) ×H (Ω) : φ|Γ = 0, u• nˆ|Γ = 0 . φ q schalck (2005); Wu, Liu, Scarpas, and Ge (2006); Mitra and Gopalakrishnan (2006)]. The solution Π is represented by a finite number of basis func- tions. Spectral/hp element method is based on higher order functions, which are locally defined Ω over finite size parts of domain (elements). The advantage of such kind of method respect to tra- Γ ditional finite element method is its exponential convergence property with the increasing of poly- nomial order p. Figure 1: Example of a fictitious rectangular do- Historically there is a distinction between hp-type main Π containing the original domain Ω FEM and cause of the expansion which can be modal or nodal. According to fictitious domain methodology the In hp-FEM the expansion basis is normally problem is extended to a simple shaped domain modal, i.e. the basis functions are of increasing 98 Copyright c 2007 Tech Science Press CMES, vol.17, no.2, pp.95-114, 2007 order (hierarchical) and the set of order p − 1is contained within the set of order p. In modal ap- ⎧ ⎪1 −ξ proach the expansion coefficients do not have any ⎪ for p = 0 ⎨⎪ 2 particular physical meaning. −ξ +ξ ψ = 1 1 α,β < < , ≥ In contrast in nodal spectral element methods the p ⎪ Pp−1 for 0 p P P 1 ⎪ 2 2 expansion basis are non-hierarchical and consists ⎩⎪1 +ξ for p = P of p +1 polynomial of order p. Moreover the ex- 2 pansion coefficients are associated with a set of (17) nodal points where only one basis function has non-zero value. Hence the expansion coefficients can be interpreted as the physical solution value at the nodal points. 1 1 ψ ψ The methods are mathematically equivalent, in 0 3 numerical practice however the two approches 0-1 0 1 0-1 0 1 do have different numerical properties in terms ξ ξ of implementation efficiency, ability to vary the polynomial order and conditioning of global -1 -1 1 1 sparse systems (see [Karniadakis and Sherwin ψ ψ (1999)] for more details). For this reason we 1 4 choose a modal approach. 0 0 -1 0ξ 1 -1 0ξ 1 We proceed to define a discrete problem by choos- ing appropriate finite element subspaces for φ, -1 -1 each of the components of the vector valued func- 1 1 tion u and Lagrange multipliers λ .Thereareno ψ ψ 2 5 restrictive compatibility conditions on the discrete spaces, so we choose the same finite element sub- 0 0 -1 0 1 -1 0 1 space for each of the primary variables φ and u. ξ ξ The only requirement on approximating spaces is that we choose continuous piecewise polynomials -1 -1 that are at least bi-linear in two dimensions or tri- linear in three dimensions. Figure 2: Shape of modal expansion modes for a Consider the two-dimensional case and let Ph be polynomial order of P = 5 a family of quadrilateral finite elements Ωe that make up the connected model Ωh.WemapΩe Ωˆ =[− , ] × [− , ] to a bi-unit square e 1 1 1 1 ,where and Δ are coefficients associated with each of (ξ,η) Ωˆ Ωˆ i is a point in e. Over a typical element e, the modes of hierarchical basis. In Eq. 17 we approximate φ by the expression α,β Pp are the Jacobi polynomials of order p (see Appendix A: Jacobi Polynomials for more de- tails), in particular ultraspheric polynomials cor- responding to the choice α = β with α = β = 1. n This choice is due to the considerations about the φ(ξ,η)= Δ ϕ (ξ,η) Ωˆ ∑ i i in e. (16) sparsity of the matrices we obtain discretizing the i=1 problem presented by [Karniadakis and Sherwin (1999)]. In Fig. 3 it is shown the construction of a two-dimensional modal expansion basis from the In modal expansion, ϕi are tensor products of the product of two one-dimensional expansions of or- one-dimensional C0 p-type hierarchical basis der P = 4. Fictitious Domain Approach for Spectral/hp ElementMethod 99

sociated with φ, u, λφ and λq. The system will be solved using a direct method.

5 Validation and application In the following we present numerical results ob- tained with the proposed formulation. The solved problems have been selected to assess the predic- tive capabilities on function and gradient using fictitious domain-spectral/hp element models. We verify the accuracy of numerical algorithm com- paring the result to exact solution. Next we con- Figure 3: Construction of a two-dimensional sider the one- and two-dimensional Poisson prob- modal expansion basis from the product of two lem and then the one dimensional diffusion prob- one-dimensional expansions of order P = 4 lem in a cooling fin where exact solution can be computed. In the last example we consider the diffusion problem for a two-dimensional heatsink profile where the exact solution has been com- We approximate the components of the vector val- puted using a finite element solver with a fine ued function u on Ωˆ in similar manner as we e mesh. did for φ in Eq. 16. The approximation of La- grange multipliers requires the discretization of 5.1 One-dimensional stationary Poisson prob- Γ the immersed boundary into curvilinear one- lem dimensional elements Γe, which are mapped to linear unit elements Γˆ e =[−1,1]. On these ele- We solve the one-dimensional boundary value ments the function λ is approximated by the ex- Poisson problem defined on Ω =[−1.0,1.0]: pression d2φ = π2sin(πx) (20) m dx2 λ (ξ)=∑ Δ ψ (ξ) onΓˆ (18) i i e with homogenous Dirichlet boundary conditions: i=1 where ψi are defined in Eq. 16 and Δi are the coef- φ(−1)=0 ficients associated with expansion modes of func- (21) tion λ . In this way we proceed to generate a sys- φ(1)=0. tem of linear algebraic equations at element level The analytical solution of the problem under using Eq. 12-Eq. 15. The integrals in these equa- study Eq. 20-Eq. 21 is φ(x)=sin(πx), whose tions are evaluated using Gauss quadrature rules. dφ ( )=−π (π ) derivative is dx x cos x ,asshownin In our implementation the Gauss-Legendre rules Fig. 4. are used for the modal expansions, and full inte- To solve problem Eq. 20 we employ the fictitious gration is used to evaluate the integrals. domain method, so the computational domain we The global system of equations is assembled from consider is Π =[−1.2,1.2], larger than the origi- the element contributions using the direct summa- nal one Ω (Π ⊃ Ω), and we impose the boundary tion approach. The assembled system of equa- constraints Eq. 21, which are now immersed in tions can be written as the domain, via Lagrange multipliers (Appendix C: Implementation of fictitious domain for one- GY = F (19) dimensional problems). In one-dimensional prob- lems the Lagrange multiplier is just a constant de- where Y are the modal unknown coefficients as- fined on the constrained point. To get the solution 100 Copyright c 2007 Tech Science Press CMES, vol.17, no.2, pp.95-114, 2007

10-1

function 3.0 2elements derivative 3elements 4elements 10-2 5elements 2.0

1.0 η 10-3

0.0

10-4 -1.0

-2.0 10-5 1 3 5 7 9 11 13 p -3.0

-1.0 -0.5 0.0 0.5 1.0 (a) function x

10-1

2elements Figure 4: Analytical solution of one-dimensional 3elements 4elements stationary Poisson test problem Eq. 20-Eq. 21 10-2 5elements

η 10-3 of the equivalent problem spectral elements have been employed. The domain Π has been meshed uniformly. To understand how the accuracy of so- 10-4 lution improves we have tested different grids, in . particular the grid size H has been varied from 1 2 10-5 1 3 5 7 9 11 13 to 0.48, that means Π has been divided into 2, 3, p 4 and 5 equal elements. (b) derivative In Fig. 5(a) we plot the relative energy norm η of φ as a function of the expansion order p of spec- Figure 5: Relative energy norm η of function φ tral elements comparing different grid size. dφ and derivative dx versus the expansion order p of The relative energy norm is defined as spectral elements for Poisson test problem Eq. 20- Eq. 21 [ (φ −φ )2dΩ]1/2 η = Ω numeric analytic (22) [ φ 2 Ω]1/2 Ω analyticd and its derivative. We have to remark that the CPU In Fig. 5(b) we perform the same analysis for the dφ time required to solve the problem increases faster gradient dx . with polynomial order of trial functions, rather During these tests we have observed that accu- than with grid size of fictitious domain. racy increases faster with polynomial order p than number of spectral elements, even if using a fic- titiuos domain approach the spectral convergence of η is lost. For the problem under study with 5.2 Two-dimensional stationary Poisson prob- high numbers of p the number of elements does lem not influence the accuracy at all. If p ≥ 5there- sults are significantly accurate for both function φ The Poisson problem under study is: Fictitious Domain Approach for Spectral/hp ElementMethod 101

−φ = 4onΩ φ(x,y)=1 −x2 −y2 (24) (23) ∇φ • nˆ +φ = −2onΓ whose derivatives are: with Ω = {(x,y) ∈ ℜ2 : x2 + y2 < 1} and Γ = {(x,y) ∈ ℜ2 : x2 + y2 = 1}. The boundary con- ∂φ Γ φ = (x,y)=−2x (25) dition on is Robin type. x ∂x ∂φ φ = ( , )=− y ∂ x y 2y (26) 1.00 y 0.95 1 0.90 0.85 0.80 0.75 as shown in Fig. 6. 0.5 0.70 0.65 0.60 0.55 We solve the problem Eq. 23 by fictitious domain 0.50 0 Y 0.45 0.40 method considering the square Π =[−1.2,1.2] × 0.35 0.30 -0.5 0.25 [− . , . ] 0.20 1 2 1 2 as computational domain, which in- 0.15 0.10 0.05 Ω -1 clude . 0.00

-1 -0.5 0 0.5 1 X The prescribed immersed constraints are included by means of Lagrange multiplier method which λ (a) function introduce an unknown function defined only on Γ. In the discretization process we have to use trial functions to describe both the function 2.00 1.80 1 1.60 φ, its partial derivatives and Lagrange multiplier 1.40 1.20 1.00 λ Π 0.5 0.80 . Fictitious domain is meshed uniformly 0.60 0.40 0.20 by square cells. To understand how the accu- 0.00 0 Y -0.20 -0.40 racy of solution improves we have tested differ- -0.60 -0.80 -0.5 -1.00 -1.20 ent grid steps and different expansion order for -1.40 -1.60 φ ∂φ/∂ -1.80 -1 modal polynomial of unknowns , x and -2.00 -1 -0.5 0 0.5 1 ∂φ/∂ Γ X y. The immersed boundary is meshed uniformly with one-dimensional curved elements on which the Lagrange multipliers are defined. (b) derivative in x The modal functions of Lagrange multipliers are piecewise linear. This means Lagrange multi-

2.00 1.80 pliers are discontinuous between contiguous im- 1 1.60 1.40 1.20 1.00 mersed elements. This choice is due to the analy- 0.5 0.80 0.60 0.40 sis of the results obtained for different problems. 0.20 0.00 0 Y -0.20 The behaviour of the algorithm has been investi- -0.40 -0.60 -0.80 -0.5 -1.00 gated varying the polynomial order of trial func- -1.20 -1.40 -1.60 tions for Lagrange multiplier. Moreover the ac- -1.80 -1 -2.00

-1 -0.5 0 0.5 1 curacy obtained using continuous or discontinuos X functions to approximate λ has been compared. We expected to find a relationship between the (c) derivative in y polynomial order of constraint and that one of multiplier, but the accuracy of solution was not influenced in the way we thought. In general the Figure 6: Analytical solution of two-dimensional best behaviour was obtained for functions piece- stationary Poisson test problem Eq. 23 wise linear to interpolate the Lagrange multiplier. The problem under study Eq. 24 is interesting be- The analytical solution of this problem is: cause it shows the great efficiency of the method. 102 Copyright c 2007 Tech Science Press CMES, vol.17, no.2, pp.95-114, 2007

ment number of immersed boundary mesh do not influence the accuracy of results. The values of Π relative energy norm in Tab. 1 are obtained using a grid of 9 elements for domain and 12 for Lagrange Γ multipliers (Fig. 7). If we increase these values we do not improve the accuracy of the model, but Ω we get the same accuracy obtained previously. It should be suitable to consider a more complex Poisson problem to show the efficiency of ficti- tious domain spectral/hp element algorithm. Let us consider the new problem:

−φ = −2π2 sin(πx) sin(πy) on Ω (27) Figure 7: Computational domain for Poisson test φ = sin(πx) sin(πy) on Γ problem Eq. 23. Domain spans the region −1 ≤ 2 2 2 2 x ≤ 1,−1 ≤ y ≤ 1intoNel = 9 equal quadrilateral with Ω = {(x,y) ∈ ℜ : x + y < 1.2 } and Γ = elements {(x,y) ∈ ℜ2 : x2 +y2 = 1.22}. The boundary con- dition on Γ is Dirichlet type. The analytical solu- tion of this problem is: Table 1: Relative energy norm η for the two- dimensional stationary Poisson problem Eq. 23, obtained using a grid of 9 elements for domain φ(x,y)= sin(πx) sin(πy) (28) and 12 for Lagrange multipliers, with second or- φ der polynomials to approximate the function whose partial derivatives are: and its derivatives and piecewise linear modal functions to approximate Lagrange multipliers ∂φ φ = ( , )=π (π ) (π ) x ∂ x y cos x sin y (29) ηφ η∂φ/∂x η∂φ/∂y x ∂φ 4.541E-07 6.825E-07 6.895E-07 φ = (x,y)=π sin(πx) cos(πy). (30) y ∂y

The analytical solution is shown in Fig. 8. We solve the problem (Eq. 27) by fictitious But it is not particularly attractive to illustrate domain method considering the square Π = the behaviour of the algorithm varying the refine- [−1.4,1.4] × [−1.4,1.4], which include Ω,as ment of discretization and the order of trial func- computational domain. Fictitious domain Π is tions. As the solution of problem under study meshed uniformly by square cells. The im- is a paraboloid, we expect to obtain really pre- mersed boundary Γ is meshed uniformly with cise results when expansion modes of spectral ele- one-dimensional curved elements on which the ments are second order polynomials. In Tab. 1 Lagrange multipliers are defined. The modal it is shown the accuracy of solution and gradi- functions of Lagrange multipliers are piecewise η ents according to definition of in Eq. 22. To linear. We have investigated how the accuracy of get such result we used second order polynomials the solution is influenced by the discretization of φ ∂φ/∂ for modal functions of unknowns , x and Lagrange multipliers. In particular we have con- ∂φ/∂y. sidered different values of ratio h/H,whereh is Cause of the simplicity of the problem different the length of the immersed element and H is the grid steps for fictitious domain and different ele- diagonal lenght of domain element. Morevover Fictitious Domain Approach for Spectral/hp ElementMethod 103

of the similarity of the derivatives. It is evident that the accuracy is influenced by the number of elements of domain, by the polynomial order p andbytheratioh/H which should be 0.3 ÷ 0.5. We can notice as η reaches an asymptotic value increasing p, value that is reached faster if we refine the grid of domain. About the mesh on immersed constraint if the refinement is too ex- cessive numerical errors are produced and the be- (a) function haviour of the algorithm with high values of p is out of control. Moreover we can deduce by results that if the function under study has a low variabil- ity a coarse mesh for domain is sufficient to get good results.

h/H = 0.5 h/H = 0.3 h/H = 0.1 Π Π Π

Ω Ω Ω

Γ Γ Γ (b) derivative in x

(a) Nel = 4 h/H = 0.5 h/H = 0.3 h/H = 0.1 Π Π Π

Ω Ω Ω

Γ Γ Γ

(b) Nel = 9 (c) derivative in y h/H = 0.5 h/H = 0.3 h/H = 0.1 Π Π Π

Figure 8: Analytical solution of two-dimensional Ω Ω Ω stationary Poisson test problem Eq. 27 Γ Γ Γ

we have tested different grid steps and differ- (c) Nel = 16 ent expansion order for modal polynomial of φ, ∂φ/∂x and ∂φ/∂y. Fig. 9 shows the tested com- Figure 9: Computational domain for Poisson test − . ≤ putational domains. Fig. 10, Fig. 11, Fig. 12 show problem Eq. 27. Domain spans the region 1 4 ≤ . ,− . ≤ ≤ . = , , the accuracy of results. x 1 4 1 4 y 1 4intoNel 4 9 16 equal quadrilateral elements Some remarks can be done observing the plots of relative energy norm η. We have obtained the same values of η for ∂φ/∂x and ∂φ/∂y because 104 Copyright c 2007 Tech Science Press CMES, vol.17, no.2, pp.95-114, 2007

104 104

103 h/H = 0.5 103 h/H = 0.5 h/H = 0.3 h/H = 0.3 h/H = 0.1 h/H = 0.1 102 102

101 101

0 0 η 10 η 10 10-1 10-1

10-2 10-2

10-3 10-3

10-4 10-4

10-5 10-5 2 3 4 5 6 7 8 9 10 11 2 3 4 5 6 7 8 9 10 11 p p

(a) function (a) function

104 104

103 103 h/H = 0.5 h/H = 0.3 h/H = 0.1 102 102

101 101 η 100 η 100 10-1 10-1

10-2 10-2

10-3 10-3 h/H = 0.5

-4 h/H = 0.3 -4 10 h/H = 0.1 10

10-5 10-5 2 3 4 5 6 7 8 9 10 11 2 3 4 5 6 7 8 9 10 11 p p

(b) derivative in x and derivative in y (b) derivative in x and derivative in y

Figure 10: Relative energy norm η of function Figure 11: Relative energy norm η of function φ ∂φ ∂φ φ ∂φ ∂φ ,derivative ∂x and derivative ∂y versus polyno- ,derivative ∂x and derivative ∂y versus polyno- mial order p of trial functions for Poisson prob- mial order p of trial functions for Poisson prob- lem Eq. 27. The solution is obtained for Nel = 4 lem Eq. 27. The solution is obtained for Nel = 9 and different immersed boundary discretizations, and different immersed boundary discretizations, as shown in Fig. 9(a) as shown in Fig. 9(b)

5.3 One-dimensional stationary diffusion problem in cooling fins θ θ −λ d = −λ d = θ To verify the accuracy of our numerical algorithm q0 and h (32) dx = dx = based on fictitious domain method we solve the x 0 x l equation of thermal diffusion in heatsink profiles where θ = T −T∞ is the relative temperature with with negligible thickness: T∞ the ambient temperature, s is the thickness of profile, λ the conduction coefficient, h the con- d2θ 2h vection coefficient and q0 is the inlet thermal flux. = θ (31) For giving generality to results it has been consid- dx2 sλ ered the adimensional conduction equation, intro- with ducing the Biot number. The Biot number Bi is a Fictitious Domain Approach for Spectral/hp ElementMethod 105

104

103 h/H = 0.5 Θ Θ h/H = 0.3 d d h/H = 0.1 = −Φ and = −BiΘ (34) 102 0 dX X=0 dX X=L 101

100 η hLc −5 q0Lc where we set Bi = = 10 , Φ0 = ∗ = 10-1 λ λΘ . , = l = -2 0 01 L 100, taken as example. The ana- 10 Lc 10-3 lytical solution of the problem, plotted in Fig. 13,

10-4 is given by equations:

10-5 2 3 4 5 6 7 8 9 10 11 p

Θ(X)= √ √ √ √ √ √ (a) function − − Φ0 (1+ Bi)e BiLe BiX +(1− Bi)e BiLe BiX √ √ √ √ √ (35) Bi (1+ Bi)e BiL−(1+ Bi)e− BiL 104

103 h/H = 0.5 h/H = 0.3 h/H = 0.1 102 dΘ 101 Φ(X)=− =

0 dX η 10 √ √ √ √ √ √ −( + ) BiL − BiX +( − ) − BiL BiX -1 1 Bi e e 1 Bi e e 10 Φ √ √ √ √ 0 ( + ) BiL−( + ) − BiL . (36) 10-2 1 Bi e 1 Bi e

10-3

10-4

10-5 2 3 4 5 6 7 8 9 10 11 p Θ(XX ) Φ( ) Θ( ) 10.2 X 0.010 (b) derivative in x and derivative in y Φ(X )

0.008 10.1 Figure 12: Relative energy norm η of function ∂φ ∂φ 0.006 φ 10.0 ,derivative ∂x and derivative ∂y versus polyno- mial order p of trial functions for Poisson prob- 0.004 9.9 lem Eq. 27. The solution is obtained for Nel = 16 and different immersed boundary discretizations, 0.002 9.8 as shown in Fig. 9(c) 0.000

9.7 0 20 40 60 80 100 X dimensionless number and relates the heat trans- fer resistance inside and at the surface of a body. Figure 13: Analytical solution of one- Values of the Biot number smaller than 0.1 im- dimensional stationary diffusion problem in ply that temperature gradients are negligible in- heatsink profile for Bi = 10−5 side the body. The adimensional problem writes as: For more details about thermal diffusion in heatsink profiles see [Kreith (1975); Bonacina, d2Θ Cavallini, and Mattarolo (1989)]. = BiΘ (33) dX2 To verify the accuracy of our algorithm, the nu- merical solution will be compared with the ana- with lytical one. The numerical solution is obtained 106 Copyright c 2007 Tech Science Press CMES, vol.17, no.2, pp.95-114, 2007 considering the fictitious domain Π =[−25,125], which has been meshed uniformly with a grid step 101

H varying from 30 to 75, that means it has been 100 2elements 3elements devided into 2, 3, 4 and 5 elements. The Neumann 4elements 10-1 5elements and Robin constraints have been imposed by La- grange multipliers. 10-2

In Fig. 14(a) we plot the relative energy norm of η 10-3 θ function as function of expansion order p,for 10-4 different grid steps. We perform the same analy- -5 sis for the specific flux q in Fig. 14(b). We can 10 observe that the results are significantly accurate 10-6 for p ≥ 5 for both the temperature and the flux, but 10-7 1 3 5 7 9 11 13 in general the accuracy of the numerical function p will be higher than that one of its derivative. It can (a) function be remarked that η has an asymptotic behaviour and it can not be improved, beyond its asymp- 10-3 totic value,increasing the number of spectral ele- 2elements ments or the polynomial order of trial functions. 3elements 10-4 4elements The asymptotic value, corresponding to machine 5elements round-off, is reached quickly, indicating a very 10-5 high accuracy of the method. η

10-6 5.4 Two-dimensional stationary diffusion problem in cooling fins 10-7 Employing the fictitious domain method we solve

10-8 the diffusion equation for a two-dimensional cool- 1 3 5 7 9 11 13 ing fin, which writes as: p ⎧ (b) derivative ⎨⎪−Θ = 0onΩ ∂Θ − = Φ on Γ (37) Figure 14: Relative energy norm η of temperature ⎩⎪ ∂n 0 b − ∂Θ = Θ Γ Θ and specific flux Φ versus the expansion order p ∂n Bi on a of spectral elements for thermal diffusion problem referring to adimensional form. The unknowns Eq. 33-Eq. 34 are the adimensional temperature Θ and the specific adimensional fluxes Φx = −∂Θ/∂X and 2 Φy = −∂Θ/∂Y. Ω ∈ ℜ is the domain shown in Fig. 15, Γb is the boundary of geometry in contact numerical solution to that one obtained by a finite with the body to cool and Γa the boundary of element solver using a fine unstructured mesh geometry immersed in a fluid ast temperature of 61952 elements (Lagrange quadratic type) − T∞. We set the Biot number at 10 4 and the inlet (Fig. 17). specific flux Φ0 on Γb at 0.1 (Fig. 16). The fictitious domain we consider is the rectangle The analytical solution of two-dimensional Π =[−2.5,12.5] × [−4.0,4.0] ⊃ Ω. The domain thermal conduction problem can be computed for Π is meshed by a cartesian grid with 8 rectangular simple geometries and boundary constraints, but cells, 4 along x and 2 along y (Fig. 18). The in general the employment of numerical methods aspect ratio of cells is 0.94. The immersed are required. For this reason we compare our boundary Γ on which the Lagrange multipliers Fictitious Domain Approach for Spectral/hp ElementMethod 107

167.68 167.64 167.60 167.56 167.52 167.48 167.44 167.40 167.36 3.6 1.4 167.32 167.28 167.24 167.20 167.16 167.12 10.0 167.08 167.04

(a) adimensional temperature Figure 15: Geometry of the two-dimensional

0.095 heatsink profile under study 0.090 0.085 0.080 0.075 0.070 0.065 0.060 0.055 0.050 Bi = 1E-04 0.045 0.040 Φ 0.035 0=1E-01 Θ 0.030 n +BiΘ =0 0.025 Γ 0.020 a Θ Θ Φ +BiΘ =0 + 0 =0 n n Ω Γ Γ b a (b) adimensional specific flux in x

Γa Θ +BiΘ =0 n 0.014 0.012 0.010 0.008 0.006 0.004 0.002 0.000 Figure 16: Boundary conditions for thermal dif- -0.002 -0.004 -0.006 fusion problem under study -0.008 -0.010 -0.012 -0.014 functions are defined is meshed uniformly with (c) adimensional specific flux in y one-dimensional elements. The modal functions defined on the immersed elements are piecewise linear. Figure 17: Finite element solution of two- dimensional stationary diffusion problem in Several remarks can be done on the obtained re- heatsink profile under study sults. In Fig. 19 and Fig. 20 relative energy norms of temperature and specific flux are plotted in function of polynomial order p of expansion modes in each direction and for different refine- logarithmic way and the CPU time drastically ments of immersed mesh. Fig. 21 shows the in- grows. This implies the need of efficient matrix verse of coefficient matrix condition number and solvers for high values of p. The CPU time re- Fig. 22 the CPU time required to solve the prob- quired for solving the problem with the developed lem. code is not comparable with that required by the We can observe that the results are significantly commercial code used to compute the reference accurate for p ≥ 5. The accuracy of the solution solution. Actually in this initial phase to imple- is influenced by ratio h/H. It seems that the algo- ment the algorithm, we have given more attention rithm has a better behaviour for h/H = 0.3 ÷0.4, to the methodology than the time perfomance of in particular for low values of p. Increasing the the code. That aspect will be the object of future polynomial order p the inverse of coefficient ma- work, in order to reduce CPU time significantly. trix condition number decrease approximatly in By the plots of relative energy norms it can be 108 Copyright c 2007 Tech Science Press CMES, vol.17, no.2, pp.95-114, 2007

Π

101

0 Ω 10 h/H = 0.4 Γ h/H = 0.3 10-1 h/H = 0.2

10-2 η10-3 (a) h/H = 0.4 10-4 10-5

Π 10-6

10-7 Ω 10-8 1 2 3 4 5 6 7 8 9 10 11 12 Γ p

Figure 19: Relative energy norm η of adimen- (b) h/H = 0.3 sional temperature Θ versus polynomial order p of trial functions for thermal diffusion problem Π under study Eq. 37. The solution is obtained for different immersed boundary discretizations, Ω shown in Fig. 18 Γ

employs a fictitious domain approach and for (c) h/H = 0.2 this reason its main advantage lies in the fact that only a cartesian mesh, that rapresents the enclosure, needs to be generated. The boundary Figure 18: Computational domain for thermal dif- constraints, immersed in the new simple shaped fusion problem under study Eq. 37. Domain spans computational domain, are forced by means of the region −2.5 ≤ x ≤ 12.5,−4.0 ≤ y ≤ 4.0into Lagrange multipliers. To enable all possible Nel = 8 quadrilateral elements with aspect ratio types of boundary constraints imposition, the 0.94 scalar problem must be rewritten as a vector problem introducing as further unknowns the derivatives of the function under study. This, at present, represent the major drowback of the noticed that the algorithm is not strongly stable . method. Computational cost to solve the problem Further study and additional tests are required to grows up in behalf of a great flexibility in studied better understand how the stability of algorithm geometries, avoiding the need of complicated is influenced by dimension of fictitious domain, mesh methodologies. its grid step, immersed mesh and order of modal Excellent accuracy properties of method are functions of Lagrange multipliers. demonstrated by numerical experiments. We have considered the one- and two-dimensional 6Conclusion Poisson problem and then the one-dimensional diffusion problem in a cooling fin where exact The main objective of this paper was to present solution can be computed. In the last example a new spectral element method for the analy- we have considered the heat conduction problem sis of second-order differential problems with for a two-dimensional heatsink profile where complex boundary domains. Our algorithm the solution has been compared with that one Fictitious Domain Approach for Spectral/hp ElementMethod 109

102 10-4

h/H = 0.4 -5 1 10 h/H = 0.4 10 h/H = 0.3 h/H = 0.3 h/H = 0.2 h/H = 0.2 10-6 100

10-7 η10-1 1/CN 10-8

10-2 10-9

10-3 10-10

10-4 10-11 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 p p (a) adimensional specific flux in x Figure 21: Inverse of coefficient matrix condition

103 number versus polynomial order p of trial func-

h/H = 0.4 tions for thermal diffusion problem under study 2 10 h/H = 0.3 h/H = 0.2 Eq. 37.

101

0 η 10 6000 10-1

h/H = 0.4 10-2 5000 h/H = 0.3 h/H = 0.2 10-3 4000

10-4 1 2 3 4 5 6 7 8 9 10 11 12 CPU p time 3000 (sec) (b) adimensional specific flux in y 2000

Figure 20: Relative energy norm η of adimen- 1000 Φ sional specific flux x and adimensional specific 0 1 2 3 4 5 6 7 8 9 10 11 12 flux Φy versus polynomial order p of trial func- p tions for thermal diffusion problem under study Eq. 37. The solution is obtained for different im- Figure 22: CPU time required to solve the ther- mersed boundary discretizations, shown in Fig. 18 mal diffusion problem under study Eq. 37 versus polynomial order p of trial functions. computed using a finite element solver with a fine mesh. methods for those numerical simulations which More tests and study are still required to under- involve evolving geometries. stand the behaviour of the algorithm, in particular It is easy to understand the great advantage of how the stability of algorithm is influenced by such kind of approach for numerical simula- dimensions of fictitious domain, grid step, im- tions which involve changing geometries, i.e. mersed mesh and order of Lagrange multipliers flow with moving bodies, shape optimization trial functions. In any case this approach should problems, elastic structures, etc. The standard represent an advantageous alternative to standard way to proceed in these cases is based on the 110 Copyright c 2007 Tech Science Press CMES, vol.17, no.2, pp.95-114, 2007 boundary variation technique which requires a Barbosa, H. J.; Hughes, T. J. R. (1992): . lot of computational time. A new domain is Boundary Lagrange multipliers in finite element constructed for each time step or optimization methods: Error analysis in natural norms. Nu- step. The use of a discretizing method for the merische Mathematik, vol. 62, no. 1, pp. 1–15. numerical computation of the problem means that after any change of shape, one has to remesh Bonacina, C.; Cavallini, A.; Mattarolo, L. the new configuration, then to recompute all data (1989): . Trasmissione del calore. CLEUP, defining the discrete problem, such as stiffness Padova, 3 edition. matrix,loadvector,etc.,andthentosolveanew de Hart, J.; Peters, G. W. M.; Schreurs, P. updated problem. In this sense the formulation J.G.;Baaijens,F.P.T.(2000): . A two- we propose presents a great advantage. We dimensional fluid-structure interaction model of offer a tool for numerical resolution of unsteady the aortic valve. J. Biomech., vol. 33, pp. 1079– problems where mesh is simple to construct and 1088. there is no need to create a different mesh for each new geometry of the problem. de Hart, J.; Peters, G. W. M.; Schreurs, P. J. G.; Baaijens, F. P. T. (2003): . A three- dimensional computational analysis of fluid- Acknowledgement: I would like to thank M. structure interaction in the aortic valve. J. Piller for initial support and Prof. E. Nobile and V. Biomech., vol. 36, pp. 103–112. Pediroda for their suggestions and useful advices. Dean, E. J.; Dihn, Q. V.; Glowinski, R.; He, This research has been supported by MIUR- J.; Pan, T. W.; Periaux, J. (1992): . Least COFIN 2004 founding, protocol 2004097349. squares/domain embedding methods for Neu- mann problems: applications to fluid dynamics. References In Fifth International Symposium on Domain Decomposition Methods for Partial Differential Abramowitz, M.; Stegun, I. A. (1972): . Hand- Equations, pp. 451–475, Philadelphia, PA. D. E. book of mathematical functions. Dover publica- Keyes and T. F. Chan and G. A. Meurant and J. S. tions, New York. Scroggs and R. G. Voigt, SIAM.

Arthurs, K. M.; Moore, L. C.; Peskin, C. S.; Eskilsson, C.; Sherwin, S. (2005): . An introduc- Pitman, E.; Layton, H. E. (1998): . Modeling tion to Spectral/hp element methods fo hyperbolic arteriolar flow and mass transport using the im- problems. In CFD-High Order Methods, Brux- mersed boundary method. J. Comput. Phys.,vol. elles. Lectures Series Von Karman Institute. 147, no. 2, pp. 402–440. Gerritsma, M.; Maerschalck, B. D. (2005): . Baaijens, F. (2001): . A fictitious domain/mortar The least-squares spectral element method. In element method for fluid-structure interaction. CFD-High Order Methods, Bruxelles. Lectures Int. J. Numer. Meth. Fluids, vol. 35, pp. 743–761. Series Von Karman Institute. Glowinski, R.; Pan, T.-W.; Hesla, T. I.; Joseph, Babuska, I. (1973): . The finite element method D. (1999): . A distributed Lagrange mul- with Lagrangian multipliers. Numer. Math.,vol. tiplier/fictitious domain method for particulate 20, pp. 179–192. flows. Int. J. Multiphase Flow, vol. 25, pp. 755– 794. Barbosa, H. J.; Hughes, T. J. R. (1991): . The fi- nite element method with Lagrange multipliers on Glowinski, R.; Pan, T.-W.; Hesla, T. I.; Joseph, the boundary: Circumventing the Babuka-Brezzi D. D.; Periaux, J. (1999): . A distributed condition. Computer Methods in Applied Me- Lagrange multiplier/fictitious domain method for chanics and Engineering, vol. 85, pp. 109–128. flows around moving rigid bodies: Application to Fictitious Domain Approach for Spectral/hp ElementMethod 111 particulate flow. Int. J. Numer. Methods Fluids, numerical solution of three-dimensional acoustic vol. 30, pp. 1043–1066. scattering problems. J. Comput. Acoust.,vol.7, pp. 161–183. Glowinski, R.; Pan, T.-W.; Hesla, T. I.; Joseph, D. D.; Periaux, J. (2000): . A distributed La- Hetmaniuk, U.; Farhat, C. (2002): . A ficti- grange multiplier/fictitiousdomain method for the tious domain decomposition method for the solu- simulation of flows around moving rigid bodies: tion of partially axisymmetric acoustic scattering Application to particulate flow. Comp. Meth. problems. Part 1: Dirichlet boundary conditions. Appl. Mech. Eng., vol. 184, pp. 241–268. International Journal for Numerical Methods in Engineering, vol. 54, pp. 1309–1332. Glowinski, R.; Pan, T.-W.; Hesla, T. I.; Joseph, D. D.; Periaux, J. (2001): . A fictitious domain Hetmaniuk, U.; Farhat, C. (2003): . A ficti- approach to the direct numerical simulation of in- tious domain decomposition method for the solu- compressible viscous flow past moving rigid bod- tion of partially axisymmetric acoustic scattering ies: Application to particulate flow. J. Comput. problems. Part 2: Neumann boundary conditions. Phys., vol. 169, pp. 363–427. International Journal for Numerical Methods in Glowinski, R.; Pan, T.-W.; Periaux, J. (1994): Engineering, vol. 58, pp. 63–81. . A fictitious domain method for external incom- Joly, P.; Rhaouti, L. (1999): . Domaines fictifs, pressible viscous flow modeled by Navier-Stokes elements finis H(div) et condition de Neumann: equations. Comp. Meth. Appl. Mech. Eng.,vol. le probleme de la condition inf-sup. C.R. Acad. 112, pp. 133–148. Sci. Paris, vol. 328, no. 12, pp. 1225–1230. Glowinski, R.; Pan, T.-W.; Periaux, J. (1995): . A Lagrange multiplier/fictitious domain method Jung,E.;Peskin,C.S.(2001): . Two- for the Dirichlet problem. Generalization to some Dimensional Simulations of Valveless Pumping flow problems. Japan J. Indust. Appl. Math.,vol. Using the . SIAM 12, pp. 87–108. J. Sci. Comput., vol. 23, no. 1, pp. 19–45.

Glowinski, R.; Pan, T.-W.; Periaux, J. (1997): . Karniadakis, G. E.; Sherwin, S. J. (1999): . A Lagrange multiplier/fictitious domain method Spectral/hp Element Methods for CFD. Oxford for the numerical simulation of incompressible University Press, Oxford. viscous flow around moving rigid bodies (I): The Kreith, F. (1975): . Principi di trasmissione del case where the rigid body motions are known a calore. Liguori, Napoli. priori. C. R. Acad. Sci. Paris, vol. 324, pp. 361– 369. Makinen, R. A. E.; Rossi, T.; Toivanen, J. Haslinger, J.; Maitre, J. F.; Tomas, L. (2001): . (2000): . A moving mesh fictitious domain ap- Fictitious domains methods with distribuited La- proch for shape optimization problems. Mathe- grange multipliers. Part I : application to the so- matical Modelling and Numerical Analysis,vol. lution of elliptic state problems. Mathematical 34, no. 1, pp. 31–45. Models and Methods In Applied Sciences, vol. 11, Maury, B. (2001): . A Fat Boundary Method for no. 3, pp. 521–547. the Poisson Equation in a Domain with Holes. J. Heikkola, E.; Kuznetsov, Y.; Neittanmaki, P.; of Sci. Computing, vol. 16, no. 3, pp. 319–339. Pironneau, O. (2003): . Numerical Methods for Scientific Computing. Variational Problems and Mitra, M.; Gopalakrishnan, S. (2006): . Applications.CIMNE. Wavelet Based 2-D Spectral Finite Element Formulation for Wave Propagation Analysis in Heikkola, E.; Kuznetsov, Y. A.; Lipnikov, K. Isotropic Plates. CMES: Computer Modeling in (1999): . Fictitious domain methods for the Engineering & Sciences, vol. 15, no. 1, pp. 49–68. 112 Copyright c 2007 Tech Science Press CMES, vol.17, no.2, pp.95-114, 2007

Pitkaranta, J. (1979): . Boundary subspaces for Wu, C.-Y.; Liu, X.-Y.; Scarpas, A.; Ge, X.-R. the finite element method with Lagrange multipli- (2006): . Spectral Element Approach for Forward ers. Numer. Math., vol. 33, pp. 273–289. Models of 3D Layered Pavement. CMES: Com- puter Modeling in Engineering & Sciences,vol. Pitkaranta, J. (1980): . Local stability conditions 12, no. 2, pp. 149–157. for the Babuska method of Lagrange multipliers. Math. Comput., vol. 35, pp. 1113–1129. Zienkiewicz, O. C.; Taylor, R. L. (2000): . The finite element method. Oxford, 5 edition. Pitkaranta, J. (1981): . The finite element method with Lagrange multipliers for domain Appendix A: Jacobi Polynomials with corners. Math. Comput., vol. 37, pp. 13– Jacobi polynomials represent a family of poly- 30. nomial solutions to the singular Sturm-Liouville problem. A significant feature of these polyno- Pontaza, J. P.; Reddy, J. N. (2003): . Spec- mials is that they are orthogonal in the interval tral/hp least-squares finite element formulation [−1,1] with respect to the function (1 − x)α (1 − for Navier-Stokes equations. Journal of Com- x)β (α,β > −1). These polynomials can be con- putational Physics, vol. 190, pp. 523–549. structed using a recursion relationship: Quarteroni, A.; Valli, A. (1999): . Domain Decomposition Methods for Partial Differential α,β ( )= P0 x 1 Equations. Oxford University Press, New York. α,β ( )=1 [α −β +(α +β + ) ] P1 x 2 x Ramiere, I.; Angot, P.; Belliard, M. (2005): . 2 1 α,β ( )=( 2 + 3 ) α,β ( ) − 4 α,β ( ) Fictitious domain methods to solve convection- anPn+1 x an anx Pn x anPn−1 x 1 = ( + )( +α +β + )( +α +β )) diffusion problems with general boundary con- an 2 n 1 n 1 2n ditions. In 17th Computational Fluid Dynam- a2 =(2n +α +β +1)(α2 −β 2) ics Conference - AIAA, pp. 2005–4709, Toronto, n 3 =( +α +β )( +α +β + )( +α +β + ) Canada. an 2n 2n 1 2n 2 4 = ( +α)( +β )( +α +β + ) an 2 n n 2n 2 Roma, A. M.; Peskin, C. S.; Berger, M. J. (1999): . An adaptive version of the immersed A class of symmetric polynomials, known as ul- boundary method. J. Comput. Phys., vol. 153, traspheric polynomials, corresponds to the choice no. 2, pp. 509–534. α = β . Well known ultraspheric polynomials are the Legendre polynomial (α = β = 0) and the Rossi,T.;Toivanen,J.(1999): . Parallel Fic- Chebychev polynomial (α = β = −1/2). titious Domain Method for a Nonlinear Elliptic Further formulae and properties for Jacobi poly- Neumann Boundary Value Problem. Numerical nomials can be found in [Abramowitz and Stegun linear algebra with applications, vol. 6, no. 1, pp. (1972); Karniadakis and Sherwin (1999)]. 51–60. Appendix B: Gauss-Legendre integration Saul’ev, V. K. (1963): . Solution of certain boundary-value problems on high-speed comput- To evaluate integrals of the form ers by the fictitious-domain method. Sibirsk. Mat. Z., vol. 4, pp. 912–925. 1 f (ξ)dξ (A:1) −1 Stenberg, R. (1995): . On some techniques for approximating boundary conditions in the finite by quadraure, the fundamental concept is the ap- element method. Journal of Computational and proximation of the integral by a finite summation Applied Mathematics, vol. 63, pp. 139–148. of the form Fictitious Domain Approach for Spectral/hp ElementMethod 113

The zeros of the Jacobi polynomial do not have an 1 Q−1 analytic form and to evaluate the abscissa the use f (ξ)dξ = ∑ ωi f (ξi)+ε( f ) (A:2) of a numerical algorithm is required (see [Karni- − 1 i=0 adakis and Sherwin (1999)]). Having determined the zeros, the weights can be evaluated from the where ω are specified weighting coefficients, ξ i i previous formulae. represent an abscissa of Q distinct points in the interval −1 ≤ ξ ≤ 1andε( f ) is the approxima- i Appendix C: Implementation of fictitious tion error. domain for one-dimensional There are many different types of numerical in- problems tegration. The Gaussian quadratures provide the flexibility of choosing not only the weight fac- Let us consider the one-dimensional boundary tors but also the locations where the functions value Poisson problem defined on Ω =[x1,x2] ∈ are evaluated, unlike the Newton-Cotes formulas, ℜ: which have uniformly spaced grid points. As a d2φ result, Gaussian quadratures yield twice as many = ( ) 2 f x (A:3) places of accuracy as that of the Newton-Cotes dx formulas with the same number of function eval- where f (x) is the source term. The solution has to uations. When the function is known and smooth, satisfy the boundary conditions: the Gaussian quadratures usually have decisive φ d (x )=u advantages in efficiency respect to other numer- dx 1 1 (A:4) ical integration formulae. φ(x2)=φ2. The most commonly used form of Gaussian The equivalent first-order system of Eq. A:3- quadratures is the Gauss-Legendre integration Eq. A:4 is: formula. Some numerical analysis books refer ⎧ to the Gauss-Legendre formula as the Gaussian ⎪ dφ ⎪u − = 0 quadratures’ definitive form. It is based on the ⎨⎪ dx , du = ( ) 0 0 dx f x Legendre polynomials PP (see Appendix A: Ja- (A:5) α,β ⎪ ( )= ξ ⎪u x1 u1 cobi Polynomials). Introducing i,P to denote the ⎩⎪ α,β φ(x2)=φ2. P zeros of the Pth order Jacobi polynomial PP such that To solve the problem by classical approach, the variational formulation on Ω is: α,β (ξ α,β )= = , ,..., − dφ PP i,P 0 i 0 1 P 1 vi udx− vi dx =0(A:6) Ω Ω dx where du ϕi dx = ϕi f (x)dx (A:7) Ω dx Ω ϕ ( ) ( ) = ξ α,β < ξ α,β < ... < ξ α,β for all the weighting functions i x , vi x , i 0,P 1,P P−1,P 1,Ndof. To find solution of the system, the domain Ω is discretized and unknowns φ and u approxi- we can define abscissae and weights, which ap- proximate the integral Eq. A:1, as : mated. The boundary conditions can be imposed by direct substitution. If we want to solve the problem by fictitious do- ξ = ξ 0,0 = ,..., − main method, the considered computational do- i i,Q i 0 Q 1 main is Π ⊃ Ω and the boundary constraints, −2 , 2 d , ω0 0 = P0 0 i = 0,...,Q −1 which are now immersed in the domain, are im- i −(ξ )2 ξ Q ξ=ξi 1 i d posed via Lagrange multipliers. So the varia- ε( f )=0iff (ξ) ∈ P2Q−1([−1,1]) tional formulation according to fictitious domain 114 Copyright c 2007 Tech Science Press CMES, vol.17, no.2, pp.95-114, 2007 approach is: dφ v udx− v dx+[v λ ] =0(A:8) i i i 1 x1 Π Π dx du ϕi dx+[ϕiλ2] = ϕi f (x)dx Π dx x2 Π (A:9) [u] =u (A:10) x1 1 [φ] =φ (A:11) x2 2 for all ϕi, vi, i = 1,Ndof,wherevi(x) and ϕi(x) are the weighting functions and φ(x), u(x), λ1 and λ2 the unknowns. Notice that in one-dimensional problems the Lagrange multipliers are just a con- stant defined on the constrained point. To get the solution of the equivalent problem spectral elements are employed. The computa- tional domain Π is discretized into Nel elements Πe.WemapΠe to Πe =[−1,1],where(ξ) is a point in Πe. Over a typical element Πe,weap- proximate the unknowns φ and u by the expres- sion

P φ = ϕe(ξ)φ e Π ∑ p p on e (A:12) p=0

P = e (ξ) e Π u ∑ vp up on e (A:13) p=0 where P is the polynomial order of the expansion ϕe(ξ) e (ξ) and p and vp are the weighting functions in adimensional coordinate ξ (the superscript de- notes the element in which the function is non- zero). The unknowns φ and u on Π will be given by:

Ndof Nel P φ = ϕ ( )φ = ϕe(ξ)φ e ∑ j x j ∑ ∑ p p (A:14) j=1 e=1 p=0

Ndof Nel P = ( ) = e (ξ) e u ∑ v j x u j ∑ ∑ vp up (A:15) j=1 e=1 p=0 which are obtained solving the discretized varia- tional problem, written in matrix form:

[G]{Y} = {F}. (A:16)