SubdomainFacetBasis in action #862
gatling-nrl
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Some snippets and plots to demonstrate
SubdomainFacetBasis
.Edit: This class is in #851
The toy problem here of 2D concentric circles. The inner one is at
1 V
and the outer one at0 V
. The conductivity (sigma) is specified between them,1e6
for the conductor and1
between the conductor and the outside wall. I want to know the current (in A/m since this is 2D) between the inner and outer ring. Note that as long as the inner boundary is enclosed, it shouldn't matter to the integral what path encloses it. For the stated values, the analytic answer is21.84072595706403
and COMSOL calculates21.840744824811342
. COMSOL gets this kind of accuracy even with a very coarse mesh, but I don't know the element its using (or any other trickery its up to).The mesh
The mesh is rather coarse, and I'm only going to use quadratic elements here, giving up on accuracy but making it easier to draw some of the plots for this demonstration.
circle_domain.zip
The solution to Laplace's equation.
Calculate Current
The now-familiar
asm
side effects plotter.The plotting code
And the results.
Note how the innermost subdomain is used as a Dirichlet boundary condition and should have zero gradient (and thus that integral should be zero, which it is, yay!)
Notwithstanding the loss in accuracy from the coarse mesh and quadratic element, the current is equal and opposite. It will be this way for any closed contour around the source.
For example, I can also integrate around a really wonky boundary and get the same result.
Finally, integrating around a contour that doesn't enclose a source gives zero. Hurray Gauss's Law.
Beta Was this translation helpful? Give feedback.
All reactions