Transcript
Equation-Based Modeling
COMSOL Conference 2017 Singapore
Pratyush Sharma
copy Copyright 2017 COMSOL COMSOL the COMSOL logo COMSOL Multiphysics Capture the Concept COMSOL Desktop COMSOL Server and LiveLink are either registered trademarks or trademarks of COMSOL AB All other trademarks are the property of their respective owners and COMSOL AB and its subsidiaries and products are not affiliated with endorsed by sponsored by or supported by those trademark owners For a list of such trademark owners see wwwcomsolcomtrademarks
QTTuCt
TC
)(
vFSt
u
2
2
A Look Under the Hood
A Look Under the Hood
Modeling Approaches bull Insert predefined physics
bull Coupling physics (manual or automatic)
bull Insert predefined physicsbull Coupling physics (manual or automatic)
bull Enter user defined functions All expressions can depend on all the variables introduced (analytical interpolation from file )
bull Insert predefined physicsbull Coupling physics (manual or automatic)
bull Enter user defined functions All expressions can depend on all the variables introduced (analytical interpolation from file )
bull Add or change terms of the equations set in the physics (and multiphysics) nodes
fauu
uuc
t
ud
t
ue aa
)(
2
2
)( tuFdt
du
bull Insert predefined physicsbull Coupling physics (manual or automatic)
bull Enter user defined functions All expressions can depend on all the variables introduced (analytical interpolation from file )
bull Add or change terms of the equations set in the physics (and multiphysics) nodes
bull Insert your own equations with equation forms (and make it automatic with Physics Builder)
The Mathematics Interface
Equation-Based Modelingbull What
ndash ODE amp DAE interfaces PDE interfaces boundary conditions
bull Whyndash Lumped parameter systems continuous systems
bull Howndash Demo population dynamics thermal curing
bull Could I get myself in troublendash Verification amp validation
bull Hands on Coupling PDE with global and distributed ODE
What PDE ODE and DAE stand forbull Partial differential equations (PDE)
ndash Three main interfaces (form)
ndash Need boundary conditions
bull Ordinary differential equations (ODEs)
ndash Global (space indipendent)
ndash Distributed (space dependent)
ndash Distributed but not continuous
ndash (Always) time dependent
bull Algebraic equations
ndash As for ODE global or distributed
ndash Do not contain time (and often not even the space)
fuct
uda
)( tuFdt
du
012 u
Mechanics CFD EMhellip
Electricalcircuits
cinematism
Part I Lumped Parameter Systems
bull Global ODEs
bull Global Algebraic Equation
Lumped Parameter Systems
Contaminant concentration119888(119909 119910 119911 119905)
Contaminant amount 119862(119905)
Population dynamics Population dynamics
Lumped Parameter Systems
bull Balance lawsRate of change of some quantity = amount entering - leaving + production - consumption
1198981198892119906
1198891199052= minus119896119906 minus 119888
119889119906
119889119905
1198981198892119906
1198891199052+ 119896119906 + 119888
119889119906
119889119905= 0
119889119906
119889119905= 1198861119906 1 minus ൗ119906 119896 minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
Example 1 Dynamics Example 2 Prey-predator system
119889119906
119889119905minus 1198861119906 1 minus ൗ119906 119896 + 1198871119906119907 = 0
119889119907
119889119905+ 1198862119907 minus 1198872119906119907 = 0
Global ODEsbull Example Lotka-Volterra equations
119889119906
119889119905= 1198861119906(1 minus Τ119906 119896) minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
119906 0 = 119906119894119899119894 119907 0 = 119907119894119899119894
Global Algebraic Equationsbull Same template as Global ODEs
bull What are the initial values for
ndash Stationary solvers
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
Physics + Global Algebraic Equationsbull You can add extra degrees of freedom to a physics interface
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
bull Domain ODEs and DAEsbull Boundary ODEs and DAEsbull Edge ODEs and DAEsbull Point ODEs and DAEs
Part II Continuous SystemsWithout Spatial Interaction
Domain ODEs
Domain ODEsbull Problem parameters are spatially variable
ndash Initial conditions 119906 119909 0 = 119906119894119899119894(119909)hellip
ndash Carrying capacity is spatially variable 119896 = 119896(119909)
ndash Prey-predator interactions have different outcomes based on location bull 1198871 = 1198871 119909 1198872 = 1198872(119909)
ndash Climate effect 1198861 = 1198861 (119909 119879)
bull Every point evolves independent of neighborsndash No spatial derivatives in the equation
ndash No boundary conditions needed
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
QTTuCt
TC
)(
vFSt
u
2
2
A Look Under the Hood
A Look Under the Hood
Modeling Approaches bull Insert predefined physics
bull Coupling physics (manual or automatic)
bull Insert predefined physicsbull Coupling physics (manual or automatic)
bull Enter user defined functions All expressions can depend on all the variables introduced (analytical interpolation from file )
bull Insert predefined physicsbull Coupling physics (manual or automatic)
bull Enter user defined functions All expressions can depend on all the variables introduced (analytical interpolation from file )
bull Add or change terms of the equations set in the physics (and multiphysics) nodes
fauu
uuc
t
ud
t
ue aa
)(
2
2
)( tuFdt
du
bull Insert predefined physicsbull Coupling physics (manual or automatic)
bull Enter user defined functions All expressions can depend on all the variables introduced (analytical interpolation from file )
bull Add or change terms of the equations set in the physics (and multiphysics) nodes
bull Insert your own equations with equation forms (and make it automatic with Physics Builder)
The Mathematics Interface
Equation-Based Modelingbull What
ndash ODE amp DAE interfaces PDE interfaces boundary conditions
bull Whyndash Lumped parameter systems continuous systems
bull Howndash Demo population dynamics thermal curing
bull Could I get myself in troublendash Verification amp validation
bull Hands on Coupling PDE with global and distributed ODE
What PDE ODE and DAE stand forbull Partial differential equations (PDE)
ndash Three main interfaces (form)
ndash Need boundary conditions
bull Ordinary differential equations (ODEs)
ndash Global (space indipendent)
ndash Distributed (space dependent)
ndash Distributed but not continuous
ndash (Always) time dependent
bull Algebraic equations
ndash As for ODE global or distributed
ndash Do not contain time (and often not even the space)
fuct
uda
)( tuFdt
du
012 u
Mechanics CFD EMhellip
Electricalcircuits
cinematism
Part I Lumped Parameter Systems
bull Global ODEs
bull Global Algebraic Equation
Lumped Parameter Systems
Contaminant concentration119888(119909 119910 119911 119905)
Contaminant amount 119862(119905)
Population dynamics Population dynamics
Lumped Parameter Systems
bull Balance lawsRate of change of some quantity = amount entering - leaving + production - consumption
1198981198892119906
1198891199052= minus119896119906 minus 119888
119889119906
119889119905
1198981198892119906
1198891199052+ 119896119906 + 119888
119889119906
119889119905= 0
119889119906
119889119905= 1198861119906 1 minus ൗ119906 119896 minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
Example 1 Dynamics Example 2 Prey-predator system
119889119906
119889119905minus 1198861119906 1 minus ൗ119906 119896 + 1198871119906119907 = 0
119889119907
119889119905+ 1198862119907 minus 1198872119906119907 = 0
Global ODEsbull Example Lotka-Volterra equations
119889119906
119889119905= 1198861119906(1 minus Τ119906 119896) minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
119906 0 = 119906119894119899119894 119907 0 = 119907119894119899119894
Global Algebraic Equationsbull Same template as Global ODEs
bull What are the initial values for
ndash Stationary solvers
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
Physics + Global Algebraic Equationsbull You can add extra degrees of freedom to a physics interface
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
bull Domain ODEs and DAEsbull Boundary ODEs and DAEsbull Edge ODEs and DAEsbull Point ODEs and DAEs
Part II Continuous SystemsWithout Spatial Interaction
Domain ODEs
Domain ODEsbull Problem parameters are spatially variable
ndash Initial conditions 119906 119909 0 = 119906119894119899119894(119909)hellip
ndash Carrying capacity is spatially variable 119896 = 119896(119909)
ndash Prey-predator interactions have different outcomes based on location bull 1198871 = 1198871 119909 1198872 = 1198872(119909)
ndash Climate effect 1198861 = 1198861 (119909 119879)
bull Every point evolves independent of neighborsndash No spatial derivatives in the equation
ndash No boundary conditions needed
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
A Look Under the Hood
A Look Under the Hood
Modeling Approaches bull Insert predefined physics
bull Coupling physics (manual or automatic)
bull Insert predefined physicsbull Coupling physics (manual or automatic)
bull Enter user defined functions All expressions can depend on all the variables introduced (analytical interpolation from file )
bull Insert predefined physicsbull Coupling physics (manual or automatic)
bull Enter user defined functions All expressions can depend on all the variables introduced (analytical interpolation from file )
bull Add or change terms of the equations set in the physics (and multiphysics) nodes
fauu
uuc
t
ud
t
ue aa
)(
2
2
)( tuFdt
du
bull Insert predefined physicsbull Coupling physics (manual or automatic)
bull Enter user defined functions All expressions can depend on all the variables introduced (analytical interpolation from file )
bull Add or change terms of the equations set in the physics (and multiphysics) nodes
bull Insert your own equations with equation forms (and make it automatic with Physics Builder)
The Mathematics Interface
Equation-Based Modelingbull What
ndash ODE amp DAE interfaces PDE interfaces boundary conditions
bull Whyndash Lumped parameter systems continuous systems
bull Howndash Demo population dynamics thermal curing
bull Could I get myself in troublendash Verification amp validation
bull Hands on Coupling PDE with global and distributed ODE
What PDE ODE and DAE stand forbull Partial differential equations (PDE)
ndash Three main interfaces (form)
ndash Need boundary conditions
bull Ordinary differential equations (ODEs)
ndash Global (space indipendent)
ndash Distributed (space dependent)
ndash Distributed but not continuous
ndash (Always) time dependent
bull Algebraic equations
ndash As for ODE global or distributed
ndash Do not contain time (and often not even the space)
fuct
uda
)( tuFdt
du
012 u
Mechanics CFD EMhellip
Electricalcircuits
cinematism
Part I Lumped Parameter Systems
bull Global ODEs
bull Global Algebraic Equation
Lumped Parameter Systems
Contaminant concentration119888(119909 119910 119911 119905)
Contaminant amount 119862(119905)
Population dynamics Population dynamics
Lumped Parameter Systems
bull Balance lawsRate of change of some quantity = amount entering - leaving + production - consumption
1198981198892119906
1198891199052= minus119896119906 minus 119888
119889119906
119889119905
1198981198892119906
1198891199052+ 119896119906 + 119888
119889119906
119889119905= 0
119889119906
119889119905= 1198861119906 1 minus ൗ119906 119896 minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
Example 1 Dynamics Example 2 Prey-predator system
119889119906
119889119905minus 1198861119906 1 minus ൗ119906 119896 + 1198871119906119907 = 0
119889119907
119889119905+ 1198862119907 minus 1198872119906119907 = 0
Global ODEsbull Example Lotka-Volterra equations
119889119906
119889119905= 1198861119906(1 minus Τ119906 119896) minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
119906 0 = 119906119894119899119894 119907 0 = 119907119894119899119894
Global Algebraic Equationsbull Same template as Global ODEs
bull What are the initial values for
ndash Stationary solvers
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
Physics + Global Algebraic Equationsbull You can add extra degrees of freedom to a physics interface
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
bull Domain ODEs and DAEsbull Boundary ODEs and DAEsbull Edge ODEs and DAEsbull Point ODEs and DAEs
Part II Continuous SystemsWithout Spatial Interaction
Domain ODEs
Domain ODEsbull Problem parameters are spatially variable
ndash Initial conditions 119906 119909 0 = 119906119894119899119894(119909)hellip
ndash Carrying capacity is spatially variable 119896 = 119896(119909)
ndash Prey-predator interactions have different outcomes based on location bull 1198871 = 1198871 119909 1198872 = 1198872(119909)
ndash Climate effect 1198861 = 1198861 (119909 119879)
bull Every point evolves independent of neighborsndash No spatial derivatives in the equation
ndash No boundary conditions needed
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
A Look Under the Hood
Modeling Approaches bull Insert predefined physics
bull Coupling physics (manual or automatic)
bull Insert predefined physicsbull Coupling physics (manual or automatic)
bull Enter user defined functions All expressions can depend on all the variables introduced (analytical interpolation from file )
bull Insert predefined physicsbull Coupling physics (manual or automatic)
bull Enter user defined functions All expressions can depend on all the variables introduced (analytical interpolation from file )
bull Add or change terms of the equations set in the physics (and multiphysics) nodes
fauu
uuc
t
ud
t
ue aa
)(
2
2
)( tuFdt
du
bull Insert predefined physicsbull Coupling physics (manual or automatic)
bull Enter user defined functions All expressions can depend on all the variables introduced (analytical interpolation from file )
bull Add or change terms of the equations set in the physics (and multiphysics) nodes
bull Insert your own equations with equation forms (and make it automatic with Physics Builder)
The Mathematics Interface
Equation-Based Modelingbull What
ndash ODE amp DAE interfaces PDE interfaces boundary conditions
bull Whyndash Lumped parameter systems continuous systems
bull Howndash Demo population dynamics thermal curing
bull Could I get myself in troublendash Verification amp validation
bull Hands on Coupling PDE with global and distributed ODE
What PDE ODE and DAE stand forbull Partial differential equations (PDE)
ndash Three main interfaces (form)
ndash Need boundary conditions
bull Ordinary differential equations (ODEs)
ndash Global (space indipendent)
ndash Distributed (space dependent)
ndash Distributed but not continuous
ndash (Always) time dependent
bull Algebraic equations
ndash As for ODE global or distributed
ndash Do not contain time (and often not even the space)
fuct
uda
)( tuFdt
du
012 u
Mechanics CFD EMhellip
Electricalcircuits
cinematism
Part I Lumped Parameter Systems
bull Global ODEs
bull Global Algebraic Equation
Lumped Parameter Systems
Contaminant concentration119888(119909 119910 119911 119905)
Contaminant amount 119862(119905)
Population dynamics Population dynamics
Lumped Parameter Systems
bull Balance lawsRate of change of some quantity = amount entering - leaving + production - consumption
1198981198892119906
1198891199052= minus119896119906 minus 119888
119889119906
119889119905
1198981198892119906
1198891199052+ 119896119906 + 119888
119889119906
119889119905= 0
119889119906
119889119905= 1198861119906 1 minus ൗ119906 119896 minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
Example 1 Dynamics Example 2 Prey-predator system
119889119906
119889119905minus 1198861119906 1 minus ൗ119906 119896 + 1198871119906119907 = 0
119889119907
119889119905+ 1198862119907 minus 1198872119906119907 = 0
Global ODEsbull Example Lotka-Volterra equations
119889119906
119889119905= 1198861119906(1 minus Τ119906 119896) minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
119906 0 = 119906119894119899119894 119907 0 = 119907119894119899119894
Global Algebraic Equationsbull Same template as Global ODEs
bull What are the initial values for
ndash Stationary solvers
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
Physics + Global Algebraic Equationsbull You can add extra degrees of freedom to a physics interface
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
bull Domain ODEs and DAEsbull Boundary ODEs and DAEsbull Edge ODEs and DAEsbull Point ODEs and DAEs
Part II Continuous SystemsWithout Spatial Interaction
Domain ODEs
Domain ODEsbull Problem parameters are spatially variable
ndash Initial conditions 119906 119909 0 = 119906119894119899119894(119909)hellip
ndash Carrying capacity is spatially variable 119896 = 119896(119909)
ndash Prey-predator interactions have different outcomes based on location bull 1198871 = 1198871 119909 1198872 = 1198872(119909)
ndash Climate effect 1198861 = 1198861 (119909 119879)
bull Every point evolves independent of neighborsndash No spatial derivatives in the equation
ndash No boundary conditions needed
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Modeling Approaches bull Insert predefined physics
bull Coupling physics (manual or automatic)
bull Insert predefined physicsbull Coupling physics (manual or automatic)
bull Enter user defined functions All expressions can depend on all the variables introduced (analytical interpolation from file )
bull Insert predefined physicsbull Coupling physics (manual or automatic)
bull Enter user defined functions All expressions can depend on all the variables introduced (analytical interpolation from file )
bull Add or change terms of the equations set in the physics (and multiphysics) nodes
fauu
uuc
t
ud
t
ue aa
)(
2
2
)( tuFdt
du
bull Insert predefined physicsbull Coupling physics (manual or automatic)
bull Enter user defined functions All expressions can depend on all the variables introduced (analytical interpolation from file )
bull Add or change terms of the equations set in the physics (and multiphysics) nodes
bull Insert your own equations with equation forms (and make it automatic with Physics Builder)
The Mathematics Interface
Equation-Based Modelingbull What
ndash ODE amp DAE interfaces PDE interfaces boundary conditions
bull Whyndash Lumped parameter systems continuous systems
bull Howndash Demo population dynamics thermal curing
bull Could I get myself in troublendash Verification amp validation
bull Hands on Coupling PDE with global and distributed ODE
What PDE ODE and DAE stand forbull Partial differential equations (PDE)
ndash Three main interfaces (form)
ndash Need boundary conditions
bull Ordinary differential equations (ODEs)
ndash Global (space indipendent)
ndash Distributed (space dependent)
ndash Distributed but not continuous
ndash (Always) time dependent
bull Algebraic equations
ndash As for ODE global or distributed
ndash Do not contain time (and often not even the space)
fuct
uda
)( tuFdt
du
012 u
Mechanics CFD EMhellip
Electricalcircuits
cinematism
Part I Lumped Parameter Systems
bull Global ODEs
bull Global Algebraic Equation
Lumped Parameter Systems
Contaminant concentration119888(119909 119910 119911 119905)
Contaminant amount 119862(119905)
Population dynamics Population dynamics
Lumped Parameter Systems
bull Balance lawsRate of change of some quantity = amount entering - leaving + production - consumption
1198981198892119906
1198891199052= minus119896119906 minus 119888
119889119906
119889119905
1198981198892119906
1198891199052+ 119896119906 + 119888
119889119906
119889119905= 0
119889119906
119889119905= 1198861119906 1 minus ൗ119906 119896 minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
Example 1 Dynamics Example 2 Prey-predator system
119889119906
119889119905minus 1198861119906 1 minus ൗ119906 119896 + 1198871119906119907 = 0
119889119907
119889119905+ 1198862119907 minus 1198872119906119907 = 0
Global ODEsbull Example Lotka-Volterra equations
119889119906
119889119905= 1198861119906(1 minus Τ119906 119896) minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
119906 0 = 119906119894119899119894 119907 0 = 119907119894119899119894
Global Algebraic Equationsbull Same template as Global ODEs
bull What are the initial values for
ndash Stationary solvers
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
Physics + Global Algebraic Equationsbull You can add extra degrees of freedom to a physics interface
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
bull Domain ODEs and DAEsbull Boundary ODEs and DAEsbull Edge ODEs and DAEsbull Point ODEs and DAEs
Part II Continuous SystemsWithout Spatial Interaction
Domain ODEs
Domain ODEsbull Problem parameters are spatially variable
ndash Initial conditions 119906 119909 0 = 119906119894119899119894(119909)hellip
ndash Carrying capacity is spatially variable 119896 = 119896(119909)
ndash Prey-predator interactions have different outcomes based on location bull 1198871 = 1198871 119909 1198872 = 1198872(119909)
ndash Climate effect 1198861 = 1198861 (119909 119879)
bull Every point evolves independent of neighborsndash No spatial derivatives in the equation
ndash No boundary conditions needed
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
The Mathematics Interface
Equation-Based Modelingbull What
ndash ODE amp DAE interfaces PDE interfaces boundary conditions
bull Whyndash Lumped parameter systems continuous systems
bull Howndash Demo population dynamics thermal curing
bull Could I get myself in troublendash Verification amp validation
bull Hands on Coupling PDE with global and distributed ODE
What PDE ODE and DAE stand forbull Partial differential equations (PDE)
ndash Three main interfaces (form)
ndash Need boundary conditions
bull Ordinary differential equations (ODEs)
ndash Global (space indipendent)
ndash Distributed (space dependent)
ndash Distributed but not continuous
ndash (Always) time dependent
bull Algebraic equations
ndash As for ODE global or distributed
ndash Do not contain time (and often not even the space)
fuct
uda
)( tuFdt
du
012 u
Mechanics CFD EMhellip
Electricalcircuits
cinematism
Part I Lumped Parameter Systems
bull Global ODEs
bull Global Algebraic Equation
Lumped Parameter Systems
Contaminant concentration119888(119909 119910 119911 119905)
Contaminant amount 119862(119905)
Population dynamics Population dynamics
Lumped Parameter Systems
bull Balance lawsRate of change of some quantity = amount entering - leaving + production - consumption
1198981198892119906
1198891199052= minus119896119906 minus 119888
119889119906
119889119905
1198981198892119906
1198891199052+ 119896119906 + 119888
119889119906
119889119905= 0
119889119906
119889119905= 1198861119906 1 minus ൗ119906 119896 minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
Example 1 Dynamics Example 2 Prey-predator system
119889119906
119889119905minus 1198861119906 1 minus ൗ119906 119896 + 1198871119906119907 = 0
119889119907
119889119905+ 1198862119907 minus 1198872119906119907 = 0
Global ODEsbull Example Lotka-Volterra equations
119889119906
119889119905= 1198861119906(1 minus Τ119906 119896) minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
119906 0 = 119906119894119899119894 119907 0 = 119907119894119899119894
Global Algebraic Equationsbull Same template as Global ODEs
bull What are the initial values for
ndash Stationary solvers
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
Physics + Global Algebraic Equationsbull You can add extra degrees of freedom to a physics interface
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
bull Domain ODEs and DAEsbull Boundary ODEs and DAEsbull Edge ODEs and DAEsbull Point ODEs and DAEs
Part II Continuous SystemsWithout Spatial Interaction
Domain ODEs
Domain ODEsbull Problem parameters are spatially variable
ndash Initial conditions 119906 119909 0 = 119906119894119899119894(119909)hellip
ndash Carrying capacity is spatially variable 119896 = 119896(119909)
ndash Prey-predator interactions have different outcomes based on location bull 1198871 = 1198871 119909 1198872 = 1198872(119909)
ndash Climate effect 1198861 = 1198861 (119909 119879)
bull Every point evolves independent of neighborsndash No spatial derivatives in the equation
ndash No boundary conditions needed
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Equation-Based Modelingbull What
ndash ODE amp DAE interfaces PDE interfaces boundary conditions
bull Whyndash Lumped parameter systems continuous systems
bull Howndash Demo population dynamics thermal curing
bull Could I get myself in troublendash Verification amp validation
bull Hands on Coupling PDE with global and distributed ODE
What PDE ODE and DAE stand forbull Partial differential equations (PDE)
ndash Three main interfaces (form)
ndash Need boundary conditions
bull Ordinary differential equations (ODEs)
ndash Global (space indipendent)
ndash Distributed (space dependent)
ndash Distributed but not continuous
ndash (Always) time dependent
bull Algebraic equations
ndash As for ODE global or distributed
ndash Do not contain time (and often not even the space)
fuct
uda
)( tuFdt
du
012 u
Mechanics CFD EMhellip
Electricalcircuits
cinematism
Part I Lumped Parameter Systems
bull Global ODEs
bull Global Algebraic Equation
Lumped Parameter Systems
Contaminant concentration119888(119909 119910 119911 119905)
Contaminant amount 119862(119905)
Population dynamics Population dynamics
Lumped Parameter Systems
bull Balance lawsRate of change of some quantity = amount entering - leaving + production - consumption
1198981198892119906
1198891199052= minus119896119906 minus 119888
119889119906
119889119905
1198981198892119906
1198891199052+ 119896119906 + 119888
119889119906
119889119905= 0
119889119906
119889119905= 1198861119906 1 minus ൗ119906 119896 minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
Example 1 Dynamics Example 2 Prey-predator system
119889119906
119889119905minus 1198861119906 1 minus ൗ119906 119896 + 1198871119906119907 = 0
119889119907
119889119905+ 1198862119907 minus 1198872119906119907 = 0
Global ODEsbull Example Lotka-Volterra equations
119889119906
119889119905= 1198861119906(1 minus Τ119906 119896) minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
119906 0 = 119906119894119899119894 119907 0 = 119907119894119899119894
Global Algebraic Equationsbull Same template as Global ODEs
bull What are the initial values for
ndash Stationary solvers
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
Physics + Global Algebraic Equationsbull You can add extra degrees of freedom to a physics interface
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
bull Domain ODEs and DAEsbull Boundary ODEs and DAEsbull Edge ODEs and DAEsbull Point ODEs and DAEs
Part II Continuous SystemsWithout Spatial Interaction
Domain ODEs
Domain ODEsbull Problem parameters are spatially variable
ndash Initial conditions 119906 119909 0 = 119906119894119899119894(119909)hellip
ndash Carrying capacity is spatially variable 119896 = 119896(119909)
ndash Prey-predator interactions have different outcomes based on location bull 1198871 = 1198871 119909 1198872 = 1198872(119909)
ndash Climate effect 1198861 = 1198861 (119909 119879)
bull Every point evolves independent of neighborsndash No spatial derivatives in the equation
ndash No boundary conditions needed
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
What PDE ODE and DAE stand forbull Partial differential equations (PDE)
ndash Three main interfaces (form)
ndash Need boundary conditions
bull Ordinary differential equations (ODEs)
ndash Global (space indipendent)
ndash Distributed (space dependent)
ndash Distributed but not continuous
ndash (Always) time dependent
bull Algebraic equations
ndash As for ODE global or distributed
ndash Do not contain time (and often not even the space)
fuct
uda
)( tuFdt
du
012 u
Mechanics CFD EMhellip
Electricalcircuits
cinematism
Part I Lumped Parameter Systems
bull Global ODEs
bull Global Algebraic Equation
Lumped Parameter Systems
Contaminant concentration119888(119909 119910 119911 119905)
Contaminant amount 119862(119905)
Population dynamics Population dynamics
Lumped Parameter Systems
bull Balance lawsRate of change of some quantity = amount entering - leaving + production - consumption
1198981198892119906
1198891199052= minus119896119906 minus 119888
119889119906
119889119905
1198981198892119906
1198891199052+ 119896119906 + 119888
119889119906
119889119905= 0
119889119906
119889119905= 1198861119906 1 minus ൗ119906 119896 minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
Example 1 Dynamics Example 2 Prey-predator system
119889119906
119889119905minus 1198861119906 1 minus ൗ119906 119896 + 1198871119906119907 = 0
119889119907
119889119905+ 1198862119907 minus 1198872119906119907 = 0
Global ODEsbull Example Lotka-Volterra equations
119889119906
119889119905= 1198861119906(1 minus Τ119906 119896) minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
119906 0 = 119906119894119899119894 119907 0 = 119907119894119899119894
Global Algebraic Equationsbull Same template as Global ODEs
bull What are the initial values for
ndash Stationary solvers
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
Physics + Global Algebraic Equationsbull You can add extra degrees of freedom to a physics interface
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
bull Domain ODEs and DAEsbull Boundary ODEs and DAEsbull Edge ODEs and DAEsbull Point ODEs and DAEs
Part II Continuous SystemsWithout Spatial Interaction
Domain ODEs
Domain ODEsbull Problem parameters are spatially variable
ndash Initial conditions 119906 119909 0 = 119906119894119899119894(119909)hellip
ndash Carrying capacity is spatially variable 119896 = 119896(119909)
ndash Prey-predator interactions have different outcomes based on location bull 1198871 = 1198871 119909 1198872 = 1198872(119909)
ndash Climate effect 1198861 = 1198861 (119909 119879)
bull Every point evolves independent of neighborsndash No spatial derivatives in the equation
ndash No boundary conditions needed
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Part I Lumped Parameter Systems
bull Global ODEs
bull Global Algebraic Equation
Lumped Parameter Systems
Contaminant concentration119888(119909 119910 119911 119905)
Contaminant amount 119862(119905)
Population dynamics Population dynamics
Lumped Parameter Systems
bull Balance lawsRate of change of some quantity = amount entering - leaving + production - consumption
1198981198892119906
1198891199052= minus119896119906 minus 119888
119889119906
119889119905
1198981198892119906
1198891199052+ 119896119906 + 119888
119889119906
119889119905= 0
119889119906
119889119905= 1198861119906 1 minus ൗ119906 119896 minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
Example 1 Dynamics Example 2 Prey-predator system
119889119906
119889119905minus 1198861119906 1 minus ൗ119906 119896 + 1198871119906119907 = 0
119889119907
119889119905+ 1198862119907 minus 1198872119906119907 = 0
Global ODEsbull Example Lotka-Volterra equations
119889119906
119889119905= 1198861119906(1 minus Τ119906 119896) minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
119906 0 = 119906119894119899119894 119907 0 = 119907119894119899119894
Global Algebraic Equationsbull Same template as Global ODEs
bull What are the initial values for
ndash Stationary solvers
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
Physics + Global Algebraic Equationsbull You can add extra degrees of freedom to a physics interface
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
bull Domain ODEs and DAEsbull Boundary ODEs and DAEsbull Edge ODEs and DAEsbull Point ODEs and DAEs
Part II Continuous SystemsWithout Spatial Interaction
Domain ODEs
Domain ODEsbull Problem parameters are spatially variable
ndash Initial conditions 119906 119909 0 = 119906119894119899119894(119909)hellip
ndash Carrying capacity is spatially variable 119896 = 119896(119909)
ndash Prey-predator interactions have different outcomes based on location bull 1198871 = 1198871 119909 1198872 = 1198872(119909)
ndash Climate effect 1198861 = 1198861 (119909 119879)
bull Every point evolves independent of neighborsndash No spatial derivatives in the equation
ndash No boundary conditions needed
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Lumped Parameter Systems
Contaminant concentration119888(119909 119910 119911 119905)
Contaminant amount 119862(119905)
Population dynamics Population dynamics
Lumped Parameter Systems
bull Balance lawsRate of change of some quantity = amount entering - leaving + production - consumption
1198981198892119906
1198891199052= minus119896119906 minus 119888
119889119906
119889119905
1198981198892119906
1198891199052+ 119896119906 + 119888
119889119906
119889119905= 0
119889119906
119889119905= 1198861119906 1 minus ൗ119906 119896 minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
Example 1 Dynamics Example 2 Prey-predator system
119889119906
119889119905minus 1198861119906 1 minus ൗ119906 119896 + 1198871119906119907 = 0
119889119907
119889119905+ 1198862119907 minus 1198872119906119907 = 0
Global ODEsbull Example Lotka-Volterra equations
119889119906
119889119905= 1198861119906(1 minus Τ119906 119896) minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
119906 0 = 119906119894119899119894 119907 0 = 119907119894119899119894
Global Algebraic Equationsbull Same template as Global ODEs
bull What are the initial values for
ndash Stationary solvers
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
Physics + Global Algebraic Equationsbull You can add extra degrees of freedom to a physics interface
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
bull Domain ODEs and DAEsbull Boundary ODEs and DAEsbull Edge ODEs and DAEsbull Point ODEs and DAEs
Part II Continuous SystemsWithout Spatial Interaction
Domain ODEs
Domain ODEsbull Problem parameters are spatially variable
ndash Initial conditions 119906 119909 0 = 119906119894119899119894(119909)hellip
ndash Carrying capacity is spatially variable 119896 = 119896(119909)
ndash Prey-predator interactions have different outcomes based on location bull 1198871 = 1198871 119909 1198872 = 1198872(119909)
ndash Climate effect 1198861 = 1198861 (119909 119879)
bull Every point evolves independent of neighborsndash No spatial derivatives in the equation
ndash No boundary conditions needed
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Lumped Parameter Systems
bull Balance lawsRate of change of some quantity = amount entering - leaving + production - consumption
1198981198892119906
1198891199052= minus119896119906 minus 119888
119889119906
119889119905
1198981198892119906
1198891199052+ 119896119906 + 119888
119889119906
119889119905= 0
119889119906
119889119905= 1198861119906 1 minus ൗ119906 119896 minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
Example 1 Dynamics Example 2 Prey-predator system
119889119906
119889119905minus 1198861119906 1 minus ൗ119906 119896 + 1198871119906119907 = 0
119889119907
119889119905+ 1198862119907 minus 1198872119906119907 = 0
Global ODEsbull Example Lotka-Volterra equations
119889119906
119889119905= 1198861119906(1 minus Τ119906 119896) minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
119906 0 = 119906119894119899119894 119907 0 = 119907119894119899119894
Global Algebraic Equationsbull Same template as Global ODEs
bull What are the initial values for
ndash Stationary solvers
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
Physics + Global Algebraic Equationsbull You can add extra degrees of freedom to a physics interface
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
bull Domain ODEs and DAEsbull Boundary ODEs and DAEsbull Edge ODEs and DAEsbull Point ODEs and DAEs
Part II Continuous SystemsWithout Spatial Interaction
Domain ODEs
Domain ODEsbull Problem parameters are spatially variable
ndash Initial conditions 119906 119909 0 = 119906119894119899119894(119909)hellip
ndash Carrying capacity is spatially variable 119896 = 119896(119909)
ndash Prey-predator interactions have different outcomes based on location bull 1198871 = 1198871 119909 1198872 = 1198872(119909)
ndash Climate effect 1198861 = 1198861 (119909 119879)
bull Every point evolves independent of neighborsndash No spatial derivatives in the equation
ndash No boundary conditions needed
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Global ODEsbull Example Lotka-Volterra equations
119889119906
119889119905= 1198861119906(1 minus Τ119906 119896) minus 1198871119906119907
119889119907
119889119905= minus1198862119907 + 1198872119906119907
119906 0 = 119906119894119899119894 119907 0 = 119907119894119899119894
Global Algebraic Equationsbull Same template as Global ODEs
bull What are the initial values for
ndash Stationary solvers
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
Physics + Global Algebraic Equationsbull You can add extra degrees of freedom to a physics interface
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
bull Domain ODEs and DAEsbull Boundary ODEs and DAEsbull Edge ODEs and DAEsbull Point ODEs and DAEs
Part II Continuous SystemsWithout Spatial Interaction
Domain ODEs
Domain ODEsbull Problem parameters are spatially variable
ndash Initial conditions 119906 119909 0 = 119906119894119899119894(119909)hellip
ndash Carrying capacity is spatially variable 119896 = 119896(119909)
ndash Prey-predator interactions have different outcomes based on location bull 1198871 = 1198871 119909 1198872 = 1198872(119909)
ndash Climate effect 1198861 = 1198861 (119909 119879)
bull Every point evolves independent of neighborsndash No spatial derivatives in the equation
ndash No boundary conditions needed
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Global Algebraic Equationsbull Same template as Global ODEs
bull What are the initial values for
ndash Stationary solvers
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
Physics + Global Algebraic Equationsbull You can add extra degrees of freedom to a physics interface
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
bull Domain ODEs and DAEsbull Boundary ODEs and DAEsbull Edge ODEs and DAEsbull Point ODEs and DAEs
Part II Continuous SystemsWithout Spatial Interaction
Domain ODEs
Domain ODEsbull Problem parameters are spatially variable
ndash Initial conditions 119906 119909 0 = 119906119894119899119894(119909)hellip
ndash Carrying capacity is spatially variable 119896 = 119896(119909)
ndash Prey-predator interactions have different outcomes based on location bull 1198871 = 1198871 119909 1198872 = 1198872(119909)
ndash Climate effect 1198861 = 1198861 (119909 119879)
bull Every point evolves independent of neighborsndash No spatial derivatives in the equation
ndash No boundary conditions needed
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Physics + Global Algebraic Equationsbull You can add extra degrees of freedom to a physics interface
httpswwwcomsolcomblogsmodeling-hydrostatic-pressure-fluid-deformable-container
bull Domain ODEs and DAEsbull Boundary ODEs and DAEsbull Edge ODEs and DAEsbull Point ODEs and DAEs
Part II Continuous SystemsWithout Spatial Interaction
Domain ODEs
Domain ODEsbull Problem parameters are spatially variable
ndash Initial conditions 119906 119909 0 = 119906119894119899119894(119909)hellip
ndash Carrying capacity is spatially variable 119896 = 119896(119909)
ndash Prey-predator interactions have different outcomes based on location bull 1198871 = 1198871 119909 1198872 = 1198872(119909)
ndash Climate effect 1198861 = 1198861 (119909 119879)
bull Every point evolves independent of neighborsndash No spatial derivatives in the equation
ndash No boundary conditions needed
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
bull Domain ODEs and DAEsbull Boundary ODEs and DAEsbull Edge ODEs and DAEsbull Point ODEs and DAEs
Part II Continuous SystemsWithout Spatial Interaction
Domain ODEs
Domain ODEsbull Problem parameters are spatially variable
ndash Initial conditions 119906 119909 0 = 119906119894119899119894(119909)hellip
ndash Carrying capacity is spatially variable 119896 = 119896(119909)
ndash Prey-predator interactions have different outcomes based on location bull 1198871 = 1198871 119909 1198872 = 1198872(119909)
ndash Climate effect 1198861 = 1198861 (119909 119879)
bull Every point evolves independent of neighborsndash No spatial derivatives in the equation
ndash No boundary conditions needed
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Domain ODEs
Domain ODEsbull Problem parameters are spatially variable
ndash Initial conditions 119906 119909 0 = 119906119894119899119894(119909)hellip
ndash Carrying capacity is spatially variable 119896 = 119896(119909)
ndash Prey-predator interactions have different outcomes based on location bull 1198871 = 1198871 119909 1198872 = 1198872(119909)
ndash Climate effect 1198861 = 1198861 (119909 119879)
bull Every point evolves independent of neighborsndash No spatial derivatives in the equation
ndash No boundary conditions needed
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Domain ODEsbull Problem parameters are spatially variable
ndash Initial conditions 119906 119909 0 = 119906119894119899119894(119909)hellip
ndash Carrying capacity is spatially variable 119896 = 119896(119909)
ndash Prey-predator interactions have different outcomes based on location bull 1198871 = 1198871 119909 1198872 = 1198872(119909)
ndash Climate effect 1198861 = 1198861 (119909 119879)
bull Every point evolves independent of neighborsndash No spatial derivatives in the equation
ndash No boundary conditions needed
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Domain ODEs in Physicsbull Material evolution
120597120572
120597119905= 119860119890(minus ൗ119864119886
119877119879)(1 minus 120572)119899
120597120572
120597119905= 119860119890
(minus ൗ119864119886
119877119879(119909))(1 minus 120572)119899
bull Reaction kineticsndash Built-in if you use the Chemical Reaction Engineering Module
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
ODE or 1D PDE1198892119906
1198891199052minus 119886119906 + 119892 119905 = 0
1198892119906
1198891199092minus 119886119906 + 119892 119909 = 0
Spatial derivative use PDE interfaces
IVP = ODE
BVP = PDE
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Domain Algebraic Equations
bull Solve 1199063 = 119901(119909 119905 ) for 119906
bull Interface is the same as Domain ODE
httpswwwcomsolcomblogssolving-algebraic-field-equations
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Example IdealNon-ideal gas lawbull Assume u=(uvw) and p given by Navier-Stokes
bull Want to solve Convection-Conduction in gas
0u)( TCTk
bull Ideal gas 120588 given by
bull Easy - analytical
bull non-ideal gas law (needed for high molecular weight at very high pressures) 120588 solution of
bull Difficult ndash implicit equation
bull How to proceed
0)1)(( 2 DCBpA
RT
pM
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Example Non-ideal gas lawbull How to solve
bull Third order equation in
bull Pressure p is function of space
bull So this is an algebraic equation at each point in space Solution
0)1)(( 2 DCBpA
httpwwwcomsolcomblogssolving-algebraic-field-equations
DCBpAfde aa )1)((0 2
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Distributed Algebraic Equationbull What about non-linear equations with multiple solutionsbull Which solution do you getbull For simplicity consider the equation (u-2)^2-p=0 where p is a constantbull The solution you get will depend on the Initial Guess given by the PDE
Physics Interface
bull If we let p=xy and let our modeling region be the unit square then at (xy)=(00) we should get the unique solution u=2 but at (xy)=(11) we get 1 or 3 depending on our starting guess See next slide
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Distributed Algebraic Equationu=3
u=2
u=1
u=2
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
u=3
u=2
u=1
u=2
Distributed Algebraic Equation
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Part III Continuous Systemswith Spatial Interaction
Partial Differential Equations
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Prey-Predator System with Migrationbull PDEs
bull What if the second species does not migrate
ndash Domain ODE or PDE with 1198882 = 0
bull Can we have a convective term
bull What happens for negative 1198881 or 1198882
uvbvavct
v
uvbkuuauct
u
222
111
)(
)1()(
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Balance Laws Integral Formulationbull Balance laws for a continuous system
Rate of change of some quantity = amount entering or leaving through the boundary + production or consumption inside
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Balance Laws Differential Equations
119889
119889119905න119881
ϕ119889119881 = minusන119878
ԦΓ119899119889119878 + න119881
119891119889119881
V
S
119899Γ
න119881
120597ϕ
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
Divergence theorem
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Balance Laws Differential Equations
න119881
[120597ϕ
120597119905+ 119889119894119907 ԦΓ minus 119891]119889119881 = 0
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
Localization argument
V
S
119899Γ
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
General Form PDE
Usually 120601 = 119890120597119906
120597119905+ 119889119906
120597ϕ
120597119905+ 119889119894119907 ԦΓ = 119891
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
HT 120601 = 120588119888119901119879 120588119888119901120597119879
120597119905+ 119889119894119907 ԦΓ = 119891
Template
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Constitutive Assumptions
bull Take the usual form for the flux
ԦΓ = minus119888120571119906 minus 120572119906 + 120574
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
You specify 119888 120572 120574
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
bull Specify units for independent variable and source
Coefficient Form PDE Template
fauuuuct
ud
t
ue aa
)(
2
2
Mass Damping or mass
Conservative flux source
Diffusion
Conservative flux convection
Convection
Absorption
Source
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Coefficient Form PDEAcoustics Chemistry Black-Scholes Fischerrsquos Ecologic
Model
119958 Pressure Concentration Cost of option Population
119838119834 11205881198882
119941119834 1 1 1
119940 1120588 Diffusion coefminus1
212059021199092
Dispersal rate
120632 119902119889120588
120631 Velocity 119903119909 minus 1205902119909
119938 minus119903 119903( ൗ119906 119870 minus 1)
119943 119876119898 Reaction rate
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Helmholtz Equation Coefficient Form PDE
fauuuuct
ud
t
ue aa
)(
2
2
gukuc 2)(
Coefficient matching
119886 = minus1205812
119891 = 119892119886 = 0119891 = 119892 + 1205812119906
Option 1 Option 2
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Helmholtz Equation General Form PDE
gukuc 2)(
Match terms
1198901205972119906
1205971199052+ 119889
120597119906
120597119905+ 119889119894119907 ԦΓ = 119891
119891 = 119892 + 1198962119906
ԦΓ = minus119888120571119906
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
fauuuuct
ud
t
ue aa
)(
2
2
02
12
222
ru
x
urx
x
ux
t
u
httpswwwcomsolcommodelthe-black-scholes-equation-82
0][)2
1( 222
ru
x
uxrx
x
ux
xt
u
raxrx
xcda
2
11
2
22
Coefficient matching
x
uxrxf
ra
xcda
)(
0
2
11
2
22
Alternative
Black-Scholes Equation Coefficient Form PDE
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Weak Form PDE
bull NO TEMPLATE
bull Extreme flexibility
119862120597119906
120597119905+ 120571 ∙ minus120581120571119906 minus 119876 = 0
න 119862120597119906
120597119905119908 + 120581120571119908 ∙ 120571119906 119889Ω = න119876119908119889Ω +න119908119902119899119889119878 forall119908
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
PDE in Weak formulationbull Weak = Integral based on variational formulation (conservation law)
bull Most of COMSOL (and other toolsrsquo) physics use such a formulation since most versatile
bull It is the base of finite element (but also used within other schemes)
bull Understanding how it works is the way to master what COMSOL does under the hood
F Γ
dVFdV
Γ
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Weak Form Stationarybull General form 120571 ∙ Γ = 119865bull Multiply by test function v
and integrate Ω 119907120571 ∙ Γ119889119860 = Ω 119907119865119889119860
bull Perform integration by parts
on left-hand side 120597Ω 119907Γ ∙ 119899 119889119904 minus Ω 120571119907 ∙ Γ 119889119860 = Ω 119907119865 119889119860
bull Rearrange 0 = Ω 120571119907 ∙ Γ + 119907119865 119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Remember
ndash For Poissonrsquos eq Γ = [119906119909 119906119910] F = 1 R = u - 0(u constrained to 0 on boundaries)
ndash Subdomain integral above is entered in the ldquoweakrdquo field -test(ux)ux - test(uy)uy + test(u)F
ndash On the boundary set constraint expression u
120571 ∙ Γ = 119865
Ω
120597Ω
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Weak Form Time Dependentbull Same development as stationary but start from
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
bull And arrive at0 = Ω 120571119907 ∙ Γ + 119907119865 minus 119889119886119907
120597119906
120597119905119889119860 + Ω minus119907Γ ∙ 119899 119889119904
bull Subdomain integral in the weak field-test(ux)ux - test(uy)uy + test(u)F ndash datest(u) ut
119889119886120597119906
120597119905+ 120571 ∙ Γ = 119865
Ω
120597Ω
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Using the Weak Form PDE Interface
httpswwwcomsolcomblogsimplementing-the-weak-form-in-comsol-multiphysics httpswwwcomsolcoinblogsbrief-
introduction-weak-form
httpswwwcomsolcomblogsstrength-weak-form
httpswwwcomsolcoinblogsdiscretizing-the-weak-form-equations
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
DerivativesSolution field u
Spatial 1st derivatives ux uy uz
Spatial 2nd derivatives uxx uxy hellip uyz uzz
Time derivatives ut utt
Mixed derivatives uxt uytt
Derivatives tangent to surfaces uTx uTy uTz
Derivatives of quantities other than the primary dependent variable
d(qt)d(qx)
More ldquoDifferentiation Operatorsrdquo in the COMSOL Multiphysics Reference Manual
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Integrated Demo Thermal Curing Physics
Heated mold
Thermoset in the cavity
T α
x
Image by Joe Haupt mdash Own work Licensed under CC BY-SA 20 via Wikimedia Commons
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Thermal Curing Mathematical Model
bull Initial conditions room temperature zero curing
bull Boundary conditions heat flux of 10 ΤkW m2
bull Step 1 Pick appropriate Mathematics interfaces
ndash PDE + Domain ODE
bull Step 2 Fit the equations into the templates
tHT
t
TC rp
)(
nRTEaAet
)1()(
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
tHT
t
TC rp
)(
nRTEaAet
)1()(
ft
dt
e aa
2
2
Domain ODE
nRTE
aaAefd )1(1
)(
Thermal Curing Choosing the Interface
fauuuuct
ud
t
ue aa
)(
2
2
tHfcCd rpa
PDE
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Thermal Curing Heat Transfer Interface
httpswwwcomsolcomblogsmodeling-the-thermal-curing-process
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Part IV Boundaries and Interfaces
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
The World Versus Your World
Image by Strebe mdash Own work Licensed under CC BY-SA 30 via Wikimedia Commons
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Jump and Boundary Conditions
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
න119881
120597ϕ
120597119905119889119881 = minusන
119881
119889119894119907( ԦΓ) 119889119881 + න119881
119891119889119881
Canrsquot do this
1 Stay with the integral equation2 Focus
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Jump and Boundary Conditions
S
1198991 rarr 119899 1198992 rarr minus119899
119899 1198991
1198992 S
න119881
120597120601
120597119905119889119881 = minusන
119878
ԦΓ119899119889119878 + න119881
119891119889119881
119881 rarr 0 119878 ne 0
න119878
ԦΓ119899119889119878 = 0
න119878
( ԦΓ1minusԦΓ2)119899119889119878 = 0
ԦΓ ∙ 119899=0
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Jump and Boundary Conditions
bull Think about what is outside
bull We have NOT considered surface production here
119899
S
119894 119900minusԦΓ119894 ∙ 119899=minusԦΓ119900 ∙ 119899
Inward flux
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Boundary Conditions 1 Flux
bull Example Heat Transfer in Solids
bull Natural (Neumann) boundary conditions
119899120595
minusԦΓ119894 ∙ 119899 = 120595
Inward flux
minus(minus120581120571119879) ∙ 119899 = 1199020
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Boundary Conditions Mixedbull A constitutive assumption about the outside
bull Example Heat Transfer in Solids
bull Mixed (Robin) boundary conditions
minusԦΓ119894 ∙ 119899 = 120595
120595 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
minus(minus120581120571119879) ∙ 119899 = ℎ(119879119890119909119905 minus 119879)
119899120595119906119890119909119905
119906
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Boundary Conditions Extremes
bull Temperature voltage displacement
119899120595119906119890119909119905
119906
minusԦΓ119894 ∙ 119899 = 120595
minus(minus120581120571119906) ∙ 119899 =120581119900119871119890119909119905
(119906119890119909119905 minus 119906)
(120581
120581119900119871119890119909119905120571119906) ∙ 119899 = (119906119890119909119905 minus 119906)
120581119900 ≫ 120581 rArr 119906 = 119906119890119909119905
bull Dirichlet boundary conditions
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
More on Boundary Conditions
bull Built-in spring foundation bull DIY boundary condition119891 = 119891(119906 ሶ119906)
httpswwwcomsolcomblogshow-to-make-boundary-conditions-conditional-in-your-simulationhttpswwwcomsolcomblogsmodeling-natural-and-forced-convection-in-comsol-multiphysics
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Part V Surface Phenomena
bull Boundary PDEs
bull Edge PDEs
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Lower Dimension PDE Interfaces
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Built-In Interfaces for Lower Dimensional Physics
bull Fluid Flow
ndash Pipe Flow (pfl)
ndash Water Hammer (whtd)
ndash Thin-Film Flow Shell (tffs)
bull Heat Transfer
ndash Heat Transfer in Pipes (htp)
ndash Heat Transfer in Thin Shell (htsh)
ndash Heat Transfer in Thin Films (htsh)
ndash Heat Transfer in Fractures (htsh)
bull Structural Mechanics
ndash Shell (shell)
ndash Membrane (mbrn)
ndash Beam (beam)
ndash Truss (truss)
bull ACDC
ndash Electric Currents Shell (ecs)
bull RF
ndash Transmission Line (tl)
bull Chemical and Reaction Engineering
ndash Surface Reactions (sr)
bull Electrochemistry
ndash Electrode Shell (els)
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Part VI Miscellaneous
bull PDEs in axisymmetric componentsbull Integrodifferential equationsbull Nonlocal interactionsbull Verification and validationbull Stabilization
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
PDEs in Axisymmetric Componentsbull In the PDE interfaces differential operators do not have tensorial meanings
bull The source term is your friend
120571 ∙ Γ = 119876
1
119903
120597(119903Γ119903)
120597119903+120597Γ120601
120597120601+120597Γ119911120597119911
= 119876
Axisymmetry
120597Γ119903120597119903
+120597Γ119911120597119911
+Γ119903119903= 119876 120597Γ119903
120597119903+120597Γ119911120597119911
= 119891
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
bull Guidelines for Equation-Based Modeling in Axisymmetric Components
ndash httpswwwcomsolcomblogsguidelines-for-equation-based-modeling-in-axisymmetric-components
COMSOL Blog Post
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Integrodifferential Equations
119868 = න
0
119871
119888119860119889119909 Integration Coupling Operator
119868(119904) = න
0
119904
119888119860119889119909
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Variable Limits of Integration
119868(119904) = 0119904119888119860119889119909=0
119871119896(119904 119909)119888119860119889119909
Integration Coupling operator
119868(119904) = 0119904119888119860119889119909=0
119871119896(119889119890119904119905(119909) 119909)119888119860119889119909
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Solving Integrodifferential Equations
120588119862119901120597119879
120597119909+
120597
120597119909minus120581
120597119879
120597119909= 1198861198794 minus 119887න
0
119871
119870 119909 119904 119879(119904)4119889119904
Source 1 aT^4
Source 2 -bintop1(K(dest(x)x)T^4)
httpswwwcomsolcomblogsintegrals-with-moving-limits-and-solving-integro-differential-equations
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Nonlocal Interactions Component Coupling Operators
Purpose bull Pass data from one part of a component to
anotherbull Pass data between different components
119902119889 119909119889 = 119891 119902119904 119909119904119879 119909119889 rarr 119909119904
Usage bull Define operator in the source
componententitybull Use in the destination componententity
httpswwwcomsolcomblogspart-2-mapping-variables-with-general-extrusion-operators
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Verification amp Validationbull Exact solutionsbull Benchmarksbull Analogous modules in COMSOL Multiphysicsreg
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
VerificationMethod of manufactured solutions1 Assume a solution2 Plug in PDE to get source term
3 Find initial amp boundary conditions4 Compute with IC BC and source term 5 Compare assumed and computed solution
fauuuc )(
httpswwwcomsolcomblogsverify-simulations-with-the-method-of-manufactured-solutions
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Stabilizationbull Convection dominated
transport problems are numerically unstable
bull Sophisticated techniques implemented in physics interfaces
bull A simple stabilization technique for convective transport problems
fubut
fucubut )(
httpswwwcomsolcomblogsunderstanding-stabilization-methods
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Hands-on 1
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
3D time dependentUse General form PDE
Computing integrals over time and space(Adding ODE global or distributed)
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
General Form ndash A more compact formulation
bull Inside domain
bull On domain boundary
Ru
RG
T
0
n
Ft
ud
t
ue aa
2
2
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Coefficient form
c=1
General form
ux uy uz
ldquoCoolingrdquo (0 at ends)
coefficient from u=0
general form uR
ldquoHeat Sourcerdquo
Transient 0-gt100 s
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
2
2( )a a
u ue d c u u u au f
u t
Transient Diffusion Equation + ODE
integral volumeof integral e tim
solution of integral volume
dtUw
dVuU
t
V
What if we wish to measure the global accumulation of ldquoheatrdquo over time
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
2
2( )a a
u ue d c u u u au f
u t
Adding a ODETransient Diffusion Equation + ODE
0
][ 10
Uwt
Udt
dwdtUw
dVuU
ttt
V
=gt This is a Global ODE in the global state variable w
What if we wish to measure the global accumulation of ldquoheatrdquo over time
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Global Equation ODE
Same time-dependent problem as earlier
Time-dependent 0-100
Volume integration of u
ODE wt-U
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
PDEs + Distributed ODEs
(what if the ODE is depending on space)(comment on continuity of the solution)
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Transient Diffusion Equation + Distributed ODE
dtzyxuzyxPt
)( )(
What if we get ldquodamagerdquo from local accumulation of ldquoheatrdquo
Example of real application bioheating
local time
integral of solution
We want to visualize the P-field to assess local damage
Letrsquos assume damage happens where Pgt20
spacein point each at udt
dP
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
solution of integral timelocal udt
dP
But this can be seen as a PDE with no spatial derivatives =
= Distributed ODE
Use coefficient form with unknown field P c = 0 f = u da=1
Let all other coefficients be zero
Or use new Domain ODEs and DAEs interface
Transient Diffusion Equation +Distributed ODE
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Use of logical operators
Volume where Pgt20 and we get damage
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Questions
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
Letrsquos comparebull derived valuesbull with the value obtained using the operator ldquotimeintrdquoWhatrsquos timeint
top related