+ All Categories
Home > Documents > A quick-and-dirty guide to solving PDEs with regularised ... ·...

A quick-and-dirty guide to solving PDEs with regularised ... ·...

Date post: 02-Aug-2020
Category:
Upload: others
View: 3 times
Download: 0 times
Share this document with a friend
44
A quick-and-dirty guide to solving PDEs with regularised singularities Tom Montenegro-Johnson Early Career Workshop, UoB 1 / 12
Transcript
Page 1: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

A quick-and-dirty guide to solving PDEs withregularised singularities

Tom Montenegro-JohnsonEarly Career Workshop, UoB

1 / 12

Page 2: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

吀�e method of regularised stokesletsIn this primarily practical workshop, we will focus on numericallysolving the Stokes flow equations for microscale fluid dynamics ap-plications with potentially complex geometries

∇2𝐮 − ∇𝑝 = 𝟎, ∇ ⋅ 𝐮 = 0,

where 𝐮 is the flow velocity and 𝑝 is the pressure.

吀�eway we will solve for the flow driven by biological filaments etc isvia the method of regularised Stokeslets. Some example systems thatcan be readily solved with this method are:

• Microscale swimming problems, eg human sperm, algae etc.

• Pumping flow problems, eg the flow pumping by cilia.

• Flow in microfluidic devices.

2 / 12

Page 3: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

吀�e method of regularised stokesletsIn this primarily practical workshop, we will focus on numericallysolving the Stokes flow equations for microscale fluid dynamics ap-plications with potentially complex geometries

∇2𝐮 − ∇𝑝 = 𝟎, ∇ ⋅ 𝐮 = 0,

where 𝐮 is the flow velocity and 𝑝 is the pressure.

吀�eway we will solve for the flow driven by biological filaments etc isvia the method of regularised Stokeslets. Some example systems thatcan be readily solved with this method are:

• Microscale swimming problems, eg human sperm, algae etc.

• Pumping flow problems, eg the flow pumping by cilia.

• Flow in microfluidic devices.

2 / 12

Page 4: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

吀�e method of regularised stokesletsIn this primarily practical workshop, we will focus on numericallysolving the Stokes flow equations for microscale fluid dynamics ap-plications with potentially complex geometries

∇2𝐮 − ∇𝑝 = 𝟎, ∇ ⋅ 𝐮 = 0,

where 𝐮 is the flow velocity and 𝑝 is the pressure.

吀�eway we will solve for the flow driven by biological filaments etc isvia the method of regularised Stokeslets. Some example systems thatcan be readily solved with this method are:

• Microscale swimming problems, eg human sperm, algae etc.

• Pumping flow problems, eg the flow pumping by cilia.

• Flow in microfluidic devices.

2 / 12

Page 5: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

吀�e method of regularised stokesletsIn this primarily practical workshop, we will focus on numericallysolving the Stokes flow equations for microscale fluid dynamics ap-plications with potentially complex geometries

∇2𝐮 − ∇𝑝 = 𝟎, ∇ ⋅ 𝐮 = 0,

where 𝐮 is the flow velocity and 𝑝 is the pressure.

吀�eway we will solve for the flow driven by biological filaments etc isvia the method of regularised Stokeslets. Some example systems thatcan be readily solved with this method are:

• Microscale swimming problems, eg human sperm, algae etc.

• Pumping flow problems, eg the flow pumping by cilia.

• Flow in microfluidic devices.

2 / 12

Page 6: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

吀�e method of regularised stokesletsIn this primarily practical workshop, we will focus on numericallysolving the Stokes flow equations for microscale fluid dynamics ap-plications with potentially complex geometries

∇2𝐮 − ∇𝑝 = 𝟎, ∇ ⋅ 𝐮 = 0,

where 𝐮 is the flow velocity and 𝑝 is the pressure.

吀�eway we will solve for the flow driven by biological filaments etc isvia the method of regularised Stokeslets. Some example systems thatcan be readily solved with this method are:

• Microscale swimming problems, eg human sperm, algae etc.

• Pumping flow problems, eg the flow pumping by cilia.

• Flow in microfluidic devices.

2 / 12

Page 7: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

吀�e method of regularised stokeslets• 吀�e essential idea is to model boundaries driving the flow, suchas beating filaments, as regularised forces driving flow.

• Since Stokes flow is linear, once we know the solution for oneforce, we can add up appropriate linear combinations of thissolution to find the flow.

Consider a regularised force 𝜙u�(𝐱 − 𝐱0)𝐅 located at 𝐱u� driving amicroscale flow at a general point 𝐱

∇2𝐮(𝐱) − ∇𝑝(𝐱) = 𝜙u�(𝐱 − 𝐱0)𝐅,

where 𝜙u�(𝐱 − 𝐱0) is a regularised version of the Dirac delta func-tion. 吀�en the flow at any point can be found using the appropriateregularised stokeslet 𝐺u�

u�u� for the regularisation 𝜙u�,

𝑢u� = 𝐺u�u�u�𝐹u�.

3 / 12

Page 8: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

吀�e method of regularised stokeslets• 吀�e essential idea is to model boundaries driving the flow, suchas beating filaments, as regularised forces driving flow.

• Since Stokes flow is linear, once we know the solution for oneforce, we can add up appropriate linear combinations of thissolution to find the flow.

Consider a regularised force 𝜙u�(𝐱 − 𝐱0)𝐅 located at 𝐱u� driving amicroscale flow at a general point 𝐱

∇2𝐮(𝐱) − ∇𝑝(𝐱) = 𝜙u�(𝐱 − 𝐱0)𝐅,

where 𝜙u�(𝐱 − 𝐱0) is a regularised version of the Dirac delta func-tion. 吀�en the flow at any point can be found using the appropriateregularised stokeslet 𝐺u�

u�u� for the regularisation 𝜙u�,

𝑢u� = 𝐺u�u�u�𝐹u�.

3 / 12

Page 9: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

吀�e method of regularised stokeslets• 吀�e essential idea is to model boundaries driving the flow, suchas beating filaments, as regularised forces driving flow.

• Since Stokes flow is linear, once we know the solution for oneforce, we can add up appropriate linear combinations of thissolution to find the flow.

Consider a regularised force 𝜙u�(𝐱 − 𝐱0)𝐅 located at 𝐱u� driving amicroscale flow at a general point 𝐱

∇2𝐮(𝐱) − ∇𝑝(𝐱) = 𝜙u�(𝐱 − 𝐱0)𝐅,

where 𝜙u�(𝐱 − 𝐱0) is a regularised version of the Dirac delta func-tion.

吀�en the flow at any point can be found using the appropriateregularised stokeslet 𝐺u�

u�u� for the regularisation 𝜙u�,

𝑢u� = 𝐺u�u�u�𝐹u�.

3 / 12

Page 10: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

吀�e method of regularised stokeslets• 吀�e essential idea is to model boundaries driving the flow, suchas beating filaments, as regularised forces driving flow.

• Since Stokes flow is linear, once we know the solution for oneforce, we can add up appropriate linear combinations of thissolution to find the flow.

Consider a regularised force 𝜙u�(𝐱 − 𝐱0)𝐅 located at 𝐱u� driving amicroscale flow at a general point 𝐱

∇2𝐮(𝐱) − ∇𝑝(𝐱) = 𝜙u�(𝐱 − 𝐱0)𝐅,

where 𝜙u�(𝐱 − 𝐱0) is a regularised version of the Dirac delta func-tion. 吀�en the flow at any point can be found using the appropriateregularised stokeslet 𝐺u�

u�u� for the regularisation 𝜙u�,

𝑢u� = 𝐺u�u�u�𝐹u�.

3 / 12

Page 11: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

A specific choice of “blob”In 2005, Cortez showed that for a regularisation function of the form

𝜙u�(𝐱 − 𝐱0) = 15𝜖4

8𝜋𝑟7u�

, 𝑟2u� = 𝑟2 + 𝜖2,

where 𝑟u� = (𝐱 −𝐱0)u�, 𝑟 = |𝐱 −𝐱0| and 𝜖 is the regularisation width,the regularised stokeslet is then

𝐺u�u�u�(𝐱, 𝐱0) =

𝛿u�u�(𝑟2 + 2𝜖2) + 𝑟u�𝑟u�

8𝜋𝑟3u�

.

吀�is regularised stokeslet has been coded up in the matlab functionreg_stokeslet3D.m, which we will now peruse.

4 / 12

Page 12: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Live coding: Finding the forceFor most applications, you will know the velocity of a boundary, andyouwill need to find the unknown force that gives rise to this velocity.For a single force, you need to solve the simple matrix system

⎛⎜⎝

𝐺u�u� 𝐺u�u� 𝐺u�u�𝐺u�u� 𝐺u�u� 𝐺u�u�𝐺u�u� 𝐺u�u� 𝐺u�u�

⎞⎟⎠

⎛⎜⎝

𝐹u�𝐹u�𝐹u�

⎞⎟⎠

= ⎛⎜⎝

𝑢u�(𝐱u�)𝑢u�(𝐱u�)𝑢u�(𝐱u�)

⎞⎟⎠

where the argument of 𝐺u�u� is (𝐱u�, 𝐱0).

吀�e collocation point 𝐱u� isthe point in the flow where the velocity is known - with regularisedStokeslets, this is usually the same position as the Stokeslet.

Once you know the force, you can calculate the flow everywhere, notjust at the location where it is known.

5 / 12

Page 13: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Live coding: Finding the forceFor most applications, you will know the velocity of a boundary, andyouwill need to find the unknown force that gives rise to this velocity.For a single force, you need to solve the simple matrix system

⎛⎜⎝

𝐺u�u� 𝐺u�u� 𝐺u�u�𝐺u�u� 𝐺u�u� 𝐺u�u�𝐺u�u� 𝐺u�u� 𝐺u�u�

⎞⎟⎠

⎛⎜⎝

𝐹u�𝐹u�𝐹u�

⎞⎟⎠

= ⎛⎜⎝

𝑢u�(𝐱u�)𝑢u�(𝐱u�)𝑢u�(𝐱u�)

⎞⎟⎠

where the argument of 𝐺u�u� is (𝐱u�, 𝐱0). 吀�e collocation point 𝐱u� isthe point in the flow where the velocity is known - with regularisedStokeslets, this is usually the same position as the Stokeslet.

Once you know the force, you can calculate the flow everywhere, notjust at the location where it is known.

5 / 12

Page 14: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Live coding: Finding the forceFor most applications, you will know the velocity of a boundary, andyouwill need to find the unknown force that gives rise to this velocity.For a single force, you need to solve the simple matrix system

⎛⎜⎝

𝐺u�u� 𝐺u�u� 𝐺u�u�𝐺u�u� 𝐺u�u� 𝐺u�u�𝐺u�u� 𝐺u�u� 𝐺u�u�

⎞⎟⎠

⎛⎜⎝

𝐹u�𝐹u�𝐹u�

⎞⎟⎠

= ⎛⎜⎝

𝑢u�(𝐱u�)𝑢u�(𝐱u�)𝑢u�(𝐱u�)

⎞⎟⎠

where the argument of 𝐺u�u� is (𝐱u�, 𝐱0). 吀�e collocation point 𝐱u� isthe point in the flow where the velocity is known - with regularisedStokeslets, this is usually the same position as the Stokeslet.

Once you know the force, you can calculate the flow everywhere, notjust at the location where it is known.

5 / 12

Page 15: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

A Regularised Stokeslet SphereIn the far field, it is clear that we can think of a translating sphere aspoint/regularised force driving the flow, but for a sphere of radius 𝑎,how should we choose an appropriate regularisation?

We apply collocation at the centre of the regularised stokeslet, andadjust the regularisation until the force matches Stokes’ law

𝑈u� = 𝐺u�u�(𝐱0, 𝐱0)𝑓u� =𝛿u�u�2𝜖2

8𝜋𝜖3 ,

since 𝑟 = 0. From Stokes’ law, we have 𝑓u� = 6𝜋𝑎𝑈u�, so that se琀�ing𝐔 = [𝑈, 0, 0]u� we recover,

14𝜖

6𝜋𝑎𝑈 = 𝑈, ⇒ 𝜖 = 32

𝑎.

6 / 12

Page 16: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

A Regularised Stokeslet SphereIn the far field, it is clear that we can think of a translating sphere aspoint/regularised force driving the flow, but for a sphere of radius 𝑎,how should we choose an appropriate regularisation?

We apply collocation at the centre of the regularised stokeslet, andadjust the regularisation until the force matches Stokes’ law

𝑈u� = 𝐺u�u�(𝐱0, 𝐱0)𝑓u� =𝛿u�u�2𝜖2

8𝜋𝜖3 ,

since 𝑟 = 0.

From Stokes’ law, we have 𝑓u� = 6𝜋𝑎𝑈u�, so that se琀�ing𝐔 = [𝑈, 0, 0]u� we recover,

14𝜖

6𝜋𝑎𝑈 = 𝑈, ⇒ 𝜖 = 32

𝑎.

6 / 12

Page 17: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

A Regularised Stokeslet SphereIn the far field, it is clear that we can think of a translating sphere aspoint/regularised force driving the flow, but for a sphere of radius 𝑎,how should we choose an appropriate regularisation?

We apply collocation at the centre of the regularised stokeslet, andadjust the regularisation until the force matches Stokes’ law

𝑈u� = 𝐺u�u�(𝐱0, 𝐱0)𝑓u� =𝛿u�u�2𝜖2

8𝜋𝜖3 ,

since 𝑟 = 0. From Stokes’ law, we have 𝑓u� = 6𝜋𝑎𝑈u�, so that se琀�ing𝐔 = [𝑈, 0, 0]u� we recover,

14𝜖

6𝜋𝑎𝑈 = 𝑈, ⇒ 𝜖 = 32

𝑎.

6 / 12

Page 18: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Live coding: Two spheres sedimentingFor two spheres/reg stokeslets, located at 𝐱1, 𝐱2, moving at velocities𝐮1, 𝐮2, let’s write a code to find the unknown forces the spheres exerton the fluid.

We have the matrix system:

(𝐆(𝐱1, 𝐱1) 𝐆(𝐱1, 𝐱2)𝐆(𝐱2, 𝐱1) 𝐆(𝐱2, 𝐱2)) (𝐅1

𝐅2) = (𝐮1(𝐱1)

𝐮2(𝐱2))

where each entry is a 3 × 3 or 3 × 1 tensor. 吀�e flow at any generalpoint 𝐱 is then simply evaluated:

𝐮(𝐱) = 𝐆(𝐱, 𝐱1)𝐅1 + 𝐆(𝐱, 𝐱2)𝐅2.Generalises by modelling solid bodies as collections of spheres:

7 / 12

Page 19: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Live coding: Two spheres sedimentingFor two spheres/reg stokeslets, located at 𝐱1, 𝐱2, moving at velocities𝐮1, 𝐮2, let’s write a code to find the unknown forces the spheres exerton the fluid. We have the matrix system:

(𝐆(𝐱1, 𝐱1) 𝐆(𝐱1, 𝐱2)𝐆(𝐱2, 𝐱1) 𝐆(𝐱2, 𝐱2)) (𝐅1

𝐅2) = (𝐮1(𝐱1)

𝐮2(𝐱2))

where each entry is a 3 × 3 or 3 × 1 tensor.

吀�e flow at any generalpoint 𝐱 is then simply evaluated:

𝐮(𝐱) = 𝐆(𝐱, 𝐱1)𝐅1 + 𝐆(𝐱, 𝐱2)𝐅2.Generalises by modelling solid bodies as collections of spheres:

7 / 12

Page 20: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Live coding: Two spheres sedimentingFor two spheres/reg stokeslets, located at 𝐱1, 𝐱2, moving at velocities𝐮1, 𝐮2, let’s write a code to find the unknown forces the spheres exerton the fluid. We have the matrix system:

(𝐆(𝐱1, 𝐱1) 𝐆(𝐱1, 𝐱2)𝐆(𝐱2, 𝐱1) 𝐆(𝐱2, 𝐱2)) (𝐅1

𝐅2) = (𝐮1(𝐱1)

𝐮2(𝐱2))

where each entry is a 3 × 3 or 3 × 1 tensor. 吀�e flow at any generalpoint 𝐱 is then simply evaluated:

𝐮(𝐱) = 𝐆(𝐱, 𝐱1)𝐅1 + 𝐆(𝐱, 𝐱2)𝐅2.

Generalises by modelling solid bodies as collections of spheres:

7 / 12

Page 21: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Live coding: Two spheres sedimentingFor two spheres/reg stokeslets, located at 𝐱1, 𝐱2, moving at velocities𝐮1, 𝐮2, let’s write a code to find the unknown forces the spheres exerton the fluid. We have the matrix system:

(𝐆(𝐱1, 𝐱1) 𝐆(𝐱1, 𝐱2)𝐆(𝐱2, 𝐱1) 𝐆(𝐱2, 𝐱2)) (𝐅1

𝐅2) = (𝐮1(𝐱1)

𝐮2(𝐱2))

where each entry is a 3 × 3 or 3 × 1 tensor. 吀�e flow at any generalpoint 𝐱 is then simply evaluated:

𝐮(𝐱) = 𝐆(𝐱, 𝐱1)𝐅1 + 𝐆(𝐱, 𝐱2)𝐅2.Generalises by modelling solid bodies as collections of spheres:

7 / 12

Page 22: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Code review: Beating filament吀�is code is like the 𝑁 -spheres generalisation of the previous slide1. Create arclength preserving filament,

𝐱(𝑠, 𝑡) = ∫u�

0𝐭(𝜓( 𝑠, 𝑡)) d 𝑠,

2. Distribute stokeslets on centreline,3. Collocation points and velocities,

𝐮(𝑠, 𝑡) = ∫u�

0

𝜓( 𝑠, 𝑡)𝐧(𝜓( 𝑠, 𝑡)) d 𝑠,

4. Create matrix of regularised stokeslets,5. RHS of collocation velocities, and solve matrix system,

𝐆 ⋅ 𝐅 = 𝐮(𝐱)

6. Plot solution,7. Use known solution to calculate flow in a grid.

8 / 12

Page 23: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Code review: Beating filament吀�is code is like the 𝑁 -spheres generalisation of the previous slide1. Create arclength preserving filament,

𝐱(𝑠, 𝑡) = ∫u�

0𝐭(𝜓( 𝑠, 𝑡)) d 𝑠,

2. Distribute stokeslets on centreline,

3. Collocation points and velocities,

𝐮(𝑠, 𝑡) = ∫u�

0

𝜓( 𝑠, 𝑡)𝐧(𝜓( 𝑠, 𝑡)) d 𝑠,

4. Create matrix of regularised stokeslets,5. RHS of collocation velocities, and solve matrix system,

𝐆 ⋅ 𝐅 = 𝐮(𝐱)

6. Plot solution,7. Use known solution to calculate flow in a grid.

8 / 12

Page 24: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Code review: Beating filament吀�is code is like the 𝑁 -spheres generalisation of the previous slide1. Create arclength preserving filament,

𝐱(𝑠, 𝑡) = ∫u�

0𝐭(𝜓( 𝑠, 𝑡)) d 𝑠,

2. Distribute stokeslets on centreline,3. Collocation points and velocities,

𝐮(𝑠, 𝑡) = ∫u�

0

𝜓( 𝑠, 𝑡)𝐧(𝜓( 𝑠, 𝑡)) d 𝑠,

4. Create matrix of regularised stokeslets,5. RHS of collocation velocities, and solve matrix system,

𝐆 ⋅ 𝐅 = 𝐮(𝐱)

6. Plot solution,7. Use known solution to calculate flow in a grid.

8 / 12

Page 25: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Code review: Beating filament吀�is code is like the 𝑁 -spheres generalisation of the previous slide1. Create arclength preserving filament,

𝐱(𝑠, 𝑡) = ∫u�

0𝐭(𝜓( 𝑠, 𝑡)) d 𝑠,

2. Distribute stokeslets on centreline,3. Collocation points and velocities,

𝐮(𝑠, 𝑡) = ∫u�

0

𝜓( 𝑠, 𝑡)𝐧(𝜓( 𝑠, 𝑡)) d 𝑠,

4. Create matrix of regularised stokeslets,

5. RHS of collocation velocities, and solve matrix system,

𝐆 ⋅ 𝐅 = 𝐮(𝐱)

6. Plot solution,7. Use known solution to calculate flow in a grid.

8 / 12

Page 26: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Code review: Beating filament吀�is code is like the 𝑁 -spheres generalisation of the previous slide1. Create arclength preserving filament,

𝐱(𝑠, 𝑡) = ∫u�

0𝐭(𝜓( 𝑠, 𝑡)) d 𝑠,

2. Distribute stokeslets on centreline,3. Collocation points and velocities,

𝐮(𝑠, 𝑡) = ∫u�

0

𝜓( 𝑠, 𝑡)𝐧(𝜓( 𝑠, 𝑡)) d 𝑠,

4. Create matrix of regularised stokeslets,5. RHS of collocation velocities, and solve matrix system,

𝐆 ⋅ 𝐅 = 𝐮(𝐱)

6. Plot solution,7. Use known solution to calculate flow in a grid.

8 / 12

Page 27: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Code review: Beating filament吀�is code is like the 𝑁 -spheres generalisation of the previous slide1. Create arclength preserving filament,

𝐱(𝑠, 𝑡) = ∫u�

0𝐭(𝜓( 𝑠, 𝑡)) d 𝑠,

2. Distribute stokeslets on centreline,3. Collocation points and velocities,

𝐮(𝑠, 𝑡) = ∫u�

0

𝜓( 𝑠, 𝑡)𝐧(𝜓( 𝑠, 𝑡)) d 𝑠,

4. Create matrix of regularised stokeslets,5. RHS of collocation velocities, and solve matrix system,

𝐆 ⋅ 𝐅 = 𝐮(𝐱)

6. Plot solution,

7. Use known solution to calculate flow in a grid.

8 / 12

Page 28: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Code review: Beating filament吀�is code is like the 𝑁 -spheres generalisation of the previous slide1. Create arclength preserving filament,

𝐱(𝑠, 𝑡) = ∫u�

0𝐭(𝜓( 𝑠, 𝑡)) d 𝑠,

2. Distribute stokeslets on centreline,3. Collocation points and velocities,

𝐮(𝑠, 𝑡) = ∫u�

0

𝜓( 𝑠, 𝑡)𝐧(𝜓( 𝑠, 𝑡)) d 𝑠,

4. Create matrix of regularised stokeslets,5. RHS of collocation velocities, and solve matrix system,

𝐆 ⋅ 𝐅 = 𝐮(𝐱)

6. Plot solution,7. Use known solution to calculate flow in a grid.

8 / 12

Page 29: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Decoupling the force unknowns from the stokesletsNote that along our filament, the force changes slowly, whereas eachregularised stokeslet varies very rapidly.

So instead of having oneunknown force for each stokeslet, why not have multiple stokesletsfor each force? We are solving an approximation to the line integral,

𝐮(𝐱u�) = ∫u�

0𝐆(𝐱u�, 𝐱(𝑠)) ⋅ 𝐟 (𝐱(𝑠)) d𝑠.

By breaking up the filament into 𝑁 elements, over each of which𝐸[1], … , 𝐸[𝑁] the force is piecewise constant 𝑓u�[1], … , 𝑓u�[𝑁], we re-cover a matrix system of the form

𝑢u�(𝐱u�) =u�

∑u�=1

𝑓u�[𝑛] ∫u�[u�]

𝐺u�u�u�(𝐱, 𝐱0) d𝑆u�, 𝐱u� ∈ 𝐸[𝑚], (1)

where 𝐱u� is the centroid of element 𝐸[𝑚], with 𝑚 = 1, … , 𝑁 and𝑖, 𝑗, = 1, 2, 3. 吀�is yields 3𝑁 equations for the 3𝑁 unknown forces,and thus results in a much smaller matrix to solve.

9 / 12

Page 30: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Decoupling the force unknowns from the stokesletsNote that along our filament, the force changes slowly, whereas eachregularised stokeslet varies very rapidly. So instead of having oneunknown force for each stokeslet, why not have multiple stokesletsfor each force?

We are solving an approximation to the line integral,

𝐮(𝐱u�) = ∫u�

0𝐆(𝐱u�, 𝐱(𝑠)) ⋅ 𝐟 (𝐱(𝑠)) d𝑠.

By breaking up the filament into 𝑁 elements, over each of which𝐸[1], … , 𝐸[𝑁] the force is piecewise constant 𝑓u�[1], … , 𝑓u�[𝑁], we re-cover a matrix system of the form

𝑢u�(𝐱u�) =u�

∑u�=1

𝑓u�[𝑛] ∫u�[u�]

𝐺u�u�u�(𝐱, 𝐱0) d𝑆u�, 𝐱u� ∈ 𝐸[𝑚], (1)

where 𝐱u� is the centroid of element 𝐸[𝑚], with 𝑚 = 1, … , 𝑁 and𝑖, 𝑗, = 1, 2, 3. 吀�is yields 3𝑁 equations for the 3𝑁 unknown forces,and thus results in a much smaller matrix to solve.

9 / 12

Page 31: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Decoupling the force unknowns from the stokesletsNote that along our filament, the force changes slowly, whereas eachregularised stokeslet varies very rapidly. So instead of having oneunknown force for each stokeslet, why not have multiple stokesletsfor each force? We are solving an approximation to the line integral,

𝐮(𝐱u�) = ∫u�

0𝐆(𝐱u�, 𝐱(𝑠)) ⋅ 𝐟 (𝐱(𝑠)) d𝑠.

By breaking up the filament into 𝑁 elements, over each of which𝐸[1], … , 𝐸[𝑁] the force is piecewise constant 𝑓u�[1], … , 𝑓u�[𝑁], we re-cover a matrix system of the form

𝑢u�(𝐱u�) =u�

∑u�=1

𝑓u�[𝑛] ∫u�[u�]

𝐺u�u�u�(𝐱, 𝐱0) d𝑆u�, 𝐱u� ∈ 𝐸[𝑚], (1)

where 𝐱u� is the centroid of element 𝐸[𝑚], with 𝑚 = 1, … , 𝑁 and𝑖, 𝑗, = 1, 2, 3. 吀�is yields 3𝑁 equations for the 3𝑁 unknown forces,and thus results in a much smaller matrix to solve.

9 / 12

Page 32: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Decoupling the force unknowns from the stokesletsNote that along our filament, the force changes slowly, whereas eachregularised stokeslet varies very rapidly. So instead of having oneunknown force for each stokeslet, why not have multiple stokesletsfor each force? We are solving an approximation to the line integral,

𝐮(𝐱u�) = ∫u�

0𝐆(𝐱u�, 𝐱(𝑠)) ⋅ 𝐟 (𝐱(𝑠)) d𝑠.

By breaking up the filament into 𝑁 elements, over each of which𝐸[1], … , 𝐸[𝑁] the force is piecewise constant 𝑓u�[1], … , 𝑓u�[𝑁], we re-cover a matrix system of the form

𝑢u�(𝐱u�) =u�

∑u�=1

𝑓u�[𝑛] ∫u�[u�]

𝐺u�u�u�(𝐱, 𝐱0) d𝑆u�, 𝐱u� ∈ 𝐸[𝑚], (1)

where 𝐱u� is the centroid of element 𝐸[𝑚], with 𝑚 = 1, … , 𝑁 and𝑖, 𝑗, = 1, 2, 3.

吀�is yields 3𝑁 equations for the 3𝑁 unknown forces,and thus results in a much smaller matrix to solve.

9 / 12

Page 33: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Decoupling the force unknowns from the stokesletsNote that along our filament, the force changes slowly, whereas eachregularised stokeslet varies very rapidly. So instead of having oneunknown force for each stokeslet, why not have multiple stokesletsfor each force? We are solving an approximation to the line integral,

𝐮(𝐱u�) = ∫u�

0𝐆(𝐱u�, 𝐱(𝑠)) ⋅ 𝐟 (𝐱(𝑠)) d𝑠.

By breaking up the filament into 𝑁 elements, over each of which𝐸[1], … , 𝐸[𝑁] the force is piecewise constant 𝑓u�[1], … , 𝑓u�[𝑁], we re-cover a matrix system of the form

𝑢u�(𝐱u�) =u�

∑u�=1

𝑓u�[𝑛] ∫u�[u�]

𝐺u�u�u�(𝐱, 𝐱0) d𝑆u�, 𝐱u� ∈ 𝐸[𝑚], (1)

where 𝐱u� is the centroid of element 𝐸[𝑚], with 𝑚 = 1, … , 𝑁 and𝑖, 𝑗, = 1, 2, 3. 吀�is yields 3𝑁 equations for the 3𝑁 unknown forces,and thus results in a much smaller matrix to solve.

9 / 12

Page 34: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Code review: Free-swimming 3-stokeslet ChlamyWe proceed as with the filament and 2 sedimenting spheres case, bycreating a matrix of regularised stokeslets,

however, we have an ad-ditional unknown swimming speed in the x-direction 𝐔,

𝐮u� + 𝐔 = 𝐆 ⋅ 𝐅

1. 吀�e RHS is a vector of the known body frame velocities at thecollocation points,

2. 吀�e unknown swimming velocity forms an additional columnof the matrix,

3. 吀�e additional velocity unknown is constrained by an additionalmatrix row ensuring that the net force on the swimmer is zero,

𝐟1 + 𝐟2 + 𝐟3 = 𝟎.

吀�is code is implemented only for free-swimming in the x-direction,but generalises to fully 3D swimming with 6 unknowns (also needtorque balance constraint).

10 / 12

Page 35: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Code review: Free-swimming 3-stokeslet ChlamyWe proceed as with the filament and 2 sedimenting spheres case, bycreating a matrix of regularised stokeslets, however, we have an ad-ditional unknown swimming speed in the x-direction 𝐔,

𝐮u� + 𝐔 = 𝐆 ⋅ 𝐅

1. 吀�e RHS is a vector of the known body frame velocities at thecollocation points,

2. 吀�e unknown swimming velocity forms an additional columnof the matrix,

3. 吀�e additional velocity unknown is constrained by an additionalmatrix row ensuring that the net force on the swimmer is zero,

𝐟1 + 𝐟2 + 𝐟3 = 𝟎.

吀�is code is implemented only for free-swimming in the x-direction,but generalises to fully 3D swimming with 6 unknowns (also needtorque balance constraint).

10 / 12

Page 36: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Code review: Free-swimming 3-stokeslet ChlamyWe proceed as with the filament and 2 sedimenting spheres case, bycreating a matrix of regularised stokeslets, however, we have an ad-ditional unknown swimming speed in the x-direction 𝐔,

𝐮u� + 𝐔 = 𝐆 ⋅ 𝐅

1. 吀�e RHS is a vector of the known body frame velocities at thecollocation points,

2. 吀�e unknown swimming velocity forms an additional columnof the matrix,

3. 吀�e additional velocity unknown is constrained by an additionalmatrix row ensuring that the net force on the swimmer is zero,

𝐟1 + 𝐟2 + 𝐟3 = 𝟎.

吀�is code is implemented only for free-swimming in the x-direction,but generalises to fully 3D swimming with 6 unknowns (also needtorque balance constraint).

10 / 12

Page 37: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Code review: Free-swimming 3-stokeslet ChlamyWe proceed as with the filament and 2 sedimenting spheres case, bycreating a matrix of regularised stokeslets, however, we have an ad-ditional unknown swimming speed in the x-direction 𝐔,

𝐮u� + 𝐔 = 𝐆 ⋅ 𝐅

1. 吀�e RHS is a vector of the known body frame velocities at thecollocation points,

2. 吀�e unknown swimming velocity forms an additional columnof the matrix,

3. 吀�e additional velocity unknown is constrained by an additionalmatrix row ensuring that the net force on the swimmer is zero,

𝐟1 + 𝐟2 + 𝐟3 = 𝟎.

吀�is code is implemented only for free-swimming in the x-direction,but generalises to fully 3D swimming with 6 unknowns (also needtorque balance constraint).

10 / 12

Page 38: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Code review: Free-swimming 3-stokeslet ChlamyWe proceed as with the filament and 2 sedimenting spheres case, bycreating a matrix of regularised stokeslets, however, we have an ad-ditional unknown swimming speed in the x-direction 𝐔,

𝐮u� + 𝐔 = 𝐆 ⋅ 𝐅

1. 吀�e RHS is a vector of the known body frame velocities at thecollocation points,

2. 吀�e unknown swimming velocity forms an additional columnof the matrix,

3. 吀�e additional velocity unknown is constrained by an additionalmatrix row ensuring that the net force on the swimmer is zero,

𝐟1 + 𝐟2 + 𝐟3 = 𝟎.

吀�is code is implemented only for free-swimming in the x-direction,but generalises to fully 3D swimming with 6 unknowns (also needtorque balance constraint).

10 / 12

Page 39: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Code review: Free-swimming 3-stokeslet ChlamyWe proceed as with the filament and 2 sedimenting spheres case, bycreating a matrix of regularised stokeslets, however, we have an ad-ditional unknown swimming speed in the x-direction 𝐔,

𝐮u� + 𝐔 = 𝐆 ⋅ 𝐅

1. 吀�e RHS is a vector of the known body frame velocities at thecollocation points,

2. 吀�e unknown swimming velocity forms an additional columnof the matrix,

3. 吀�e additional velocity unknown is constrained by an additionalmatrix row ensuring that the net force on the swimmer is zero,

𝐟1 + 𝐟2 + 𝐟3 = 𝟎.

吀�is code is implemented only for free-swimming in the x-direction,but generalises to fully 3D swimming with 6 unknowns (also needtorque balance constraint).

10 / 12

Page 40: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Live coding: Simple fluid-structure interactionConsider a sphere a琀�ached to a Hookean spring which is pinned atone end in free-space. We will extend the spring, and calculate itsreturn to equilibrium at 𝐱 = 𝟎.

𝟎 𝐱

𝐹spr = −𝑘𝐱 𝐹sph

Force balance in Stokes flow dictates 𝐹spr−𝐹sph = 𝟎, where 𝐹sph is theforce that the sphere exerts on the fluid. By Hooke’s law, 𝐹spr = −𝑘𝐱,and since 𝐮 = d𝐱/d𝑡, we have

d𝑥u�d𝑡

= −𝑘𝐺u�u�(𝐱, 𝐱)𝑥u�

which we can solve via explicit time integration and compare with theanalytical solution 𝐱 = 𝐱0 exp(−𝑘𝑡/6𝜋𝑎). 吀�is approach generalisessimply to multiple spheres.

11 / 12

Page 41: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Live coding: Simple fluid-structure interactionConsider a sphere a琀�ached to a Hookean spring which is pinned atone end in free-space. We will extend the spring, and calculate itsreturn to equilibrium at 𝐱 = 𝟎.

𝟎 𝐱

𝐹spr = −𝑘𝐱 𝐹sph

Force balance in Stokes flow dictates 𝐹spr−𝐹sph = 𝟎, where 𝐹sph is theforce that the sphere exerts on the fluid.

By Hooke’s law, 𝐹spr = −𝑘𝐱,and since 𝐮 = d𝐱/d𝑡, we have

d𝑥u�d𝑡

= −𝑘𝐺u�u�(𝐱, 𝐱)𝑥u�

which we can solve via explicit time integration and compare with theanalytical solution 𝐱 = 𝐱0 exp(−𝑘𝑡/6𝜋𝑎). 吀�is approach generalisessimply to multiple spheres.

11 / 12

Page 42: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Live coding: Simple fluid-structure interactionConsider a sphere a琀�ached to a Hookean spring which is pinned atone end in free-space. We will extend the spring, and calculate itsreturn to equilibrium at 𝐱 = 𝟎.

𝟎 𝐱

𝐹spr = −𝑘𝐱 𝐹sph

Force balance in Stokes flow dictates 𝐹spr−𝐹sph = 𝟎, where 𝐹sph is theforce that the sphere exerts on the fluid. By Hooke’s law, 𝐹spr = −𝑘𝐱,and since 𝐮 = d𝐱/d𝑡, we have

d𝑥u�d𝑡

= −𝑘𝐺u�u�(𝐱, 𝐱)𝑥u�

which we can solve via explicit time integration and compare with theanalytical solution 𝐱 = 𝐱0 exp(−𝑘𝑡/6𝜋𝑎).

吀�is approach generalisessimply to multiple spheres.

11 / 12

Page 43: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Live coding: Simple fluid-structure interactionConsider a sphere a琀�ached to a Hookean spring which is pinned atone end in free-space. We will extend the spring, and calculate itsreturn to equilibrium at 𝐱 = 𝟎.

𝟎 𝐱

𝐹spr = −𝑘𝐱 𝐹sph

Force balance in Stokes flow dictates 𝐹spr−𝐹sph = 𝟎, where 𝐹sph is theforce that the sphere exerts on the fluid. By Hooke’s law, 𝐹spr = −𝑘𝐱,and since 𝐮 = d𝐱/d𝑡, we have

d𝑥u�d𝑡

= −𝑘𝐺u�u�(𝐱, 𝐱)𝑥u�

which we can solve via explicit time integration and compare with theanalytical solution 𝐱 = 𝐱0 exp(−𝑘𝑡/6𝜋𝑎). 吀�is approach generalisessimply to multiple spheres.

11 / 12

Page 44: A quick-and-dirty guide to solving PDEs with regularised ... · Decouplingtheforceunknownsfromthestokeslets Notethatalongourfilament,theforcechangesslowly,whereaseach regularised

Useful online codeDave Smith nearest-neighbour (meshless) regularised boundary inte-gral method.

Article: https://arxiv.org/pdf/1704.09022.pdfCode: https://github.com/djsmithbham/NearestStokeslets

TDMJ RegBEM Phoretic, linear panel boundary integral method (forphoretic problems, solves Laplace as well as Stokes).

Article: https://arxiv.org/pdf/1511.03078.pdfCode: https://uk.mathworks.com/matlabcentral/

fileexchange/53909-regbem-phoretic

Pozrikidis BEMLIB - singular Green’s functions, lots of useful func-tions.

Code: http://dehesa.freeshell.org/BEMLIB/

12 / 12


Recommended