Enforcing a discontinuous initial condition

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Enforcing a discontinuous initial condition

peteri
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

 







Reply | Threaded
Open this post in threaded view
|

Re: Enforcing a discontinuous initial condition

Precise Simulation
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.
Reply | Threaded
Open this post in threaded view
|

Re: Enforcing a discontinuous initial condition

peteri
Thank you very much; I appreciate the quick response.  I’ll try this workaround.  I didn’t see an option to define constants and expressions that are specific to a subdomain.   How do I specify that?
Reply | Threaded
Open this post in threaded view
|

Re: Enforcing a discontinuous initial condition

Precise Simulation
Administrator
peteri wrote
I didn’t see an option to define constants and expressions that are specific to a subdomain. How do I specify that?
It simply that you separate the constant expression by spaces, for example "1 2 3" and it will be split into subdomains sequentially. Its not quite documented as its not quite a robust way (there should ideally be an edit field per subdomain, but that doesn't scale well with many >= 10 subdomains).