# Enforcing a discontinuous initial condition

4 messages
Open this post in threaded view
|

## Enforcing a discontinuous initial condition

 Hello, I have a domain with two subdomains, one box within another (see plot below).  My problem is a convection/diffusion problem, but one of my variables just undergoes decay with no transport by convection or diffusion (u = 0; D = 0). Its only purpose is to serve as a source for other variables that are being simulated.  The initial condition (concentration) for this variable is 1 inside the inner subdomain box, and zero in the outer subdomain box. I am having trouble to get FEAtool to respect the discontinuous initial condition of this variable.  Instead, it smooths the variable across the edges between the inner and outer subdomains, which compromises the rest of the simulation.  See plot below for t = 0.  Note that I am plotting with the gradient smoothing option turned off in the post-processing menu, so I presume that the smoothing is internal to the calculation and not a plotting issue.  How can I enforce the sharp discontinuity in the initial condition at the edge of the inner and outer domain? Thanks, Peter
Open this post in threaded view
|

## Re: Enforcing a discontinuous initial condition

 Administrator I believe this is an effect of how initial conditions are evaluated for conforming element types. Since there are nodes on the shared interface between the subdomains they will get averaged values. If you have a known analytical expression for the decay you can define this as a "Constant" in "Subdomain mode" with for example "Expression" values "0 2*sin(pi*t)", so that the expression has value 0 in subdomain 1 and 1*sin(pi*t) in subdomain 2. Alternatively, this can also be defined with logical switch expressions as something like "2*sin(pi*t)(x>2)*(x<8)*(y>1)...". If you absolutely need to use a dependent variable for this you would need to use the "sf_disc0" piecewise constant shape functions as they are not connected through the edges or vertices. Unfortunately they are not selectable in the GUI by default so you would likely have to save and run the model as a m-file to use them.