|
Coordinate Scaling |
Top Previous Next |
|
FlexPDE treats all spatial coordinates on an equal footing, and tries to create meshes that are balanced in size in all coordinates. Sometimes, though, there are problems in which one dimension is expected to have much less variation that the others, and fully meshing the domain with equilateral cells creates an enormous and expensive mesh. In these cases, it would be advantageous to scale the long dimension to bring the coordinate sizes into balance. Similarly, in semiconductor problems, for example, the structure is extremely thin, and would benefit from an expansion of the Z thickness coordinate.
It is possible that FlexPDE will eventually implement automatic coordinate scaling, but in the meantime, users can implement it manually.
Consider as an example the heat equation
div(k*grad(T))+Q = C*dt(T)
with k the conductivity, Q a source and C the heat capacity.
Define a coordinate transformation,
z = s*w
where w is the physical coordinate, z is the FlexPDE coordinate, and s is a scaling factor.
We can transform the heat equation using this transformation and observing that
dw(f) = s*dz(f)
The result is
dx(k*dx(T)) + dy(k*dy(T)) + s*dz(k*s*dz(T)) + Q = C*dt(T).
In forming the finite element model for this equation, FlexPDE assumes continuity of the surface integrals generated by integration-by-parts of the second-order terms (equivalent in this case to the Divergence Theorem). This is the Natural Boundary Condition for the equation, as discussed elsewhere in the FlexPDE documentation.
The z-directed flux terms in the transformed equation therefore assume that s^2*k*dz(T) is continuous across cell interfaces. This is equivalent to flux conservation in the physical system as long as s is constant throughout the domain.
In order to guarantee conservation of flux in the presence of differing scale factors in layers, we must have the following equality across an interface between materials 1 and 2:
k1*s1*dz(T)1 = k2*s2*dz(T)2
This will be satisfied if we divide our transformed equation by s:
[dx(k*dx(T)) + dy(k*dy(T))]/s + dz(k*s*dz(T)) + Q/s = C*dt(T)/s.
Dividing the equation by s requires dividing the all the Natural boundary conditions by s as well (not just the Z components).
See the example problem "Samples | Misc | 3D_Domains | Scaled_Z.pde" for an implementation of this technique. "Samples | Misc | 3D_Domains | UnScaled_Z.pde" provides an unscaled reference.
|