Diffusion through solid 1, gas phase,... Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » Diffusion through solid 1, gas phase, then solid 2 « Previous Next »

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Kyle D. Frischknecht (kyle)
New member
Username: kyle

Post Number: 1
Registered: 08-2006
Posted on Friday, August 25, 2006 - 03:17 pm:   

Using the 1-D diffusion equation in FlexPDE notation:
div(D_H2O*grad(c)) = dt(c),
where D_H2O is the diffusion coefficient for the species water, and c is the concentration having units of mass of diffusing species per volume of material, how can FlexPDE handle a boundary change from diffusion through a solid to diffusion through a gas (say nitrogen at 1 atm.)? It is not sufficient to assign a different value of D_H2O in "Region 2" of the script because the concentration definition also changes from mass per volume solid to mass per volume gas. The flux must be continuous over the boundary (diffusing material is not created or destroyed), but the concentration will be discontinuous (step change) according the different solubility limits in the different Regions. The relationship between the two regions could be locked through Henry’s law: [Concentration in solid] = [Solubility Coefficient]*[Concentration in the gas]. How can this be addressed in FlexPDE?
Top of pagePrevious messageNext messageBottom of page Link to this message

Bouke Tuinstra (bouke)
Member
Username: bouke

Post Number: 6
Registered: 04-2006
Posted on Monday, August 28, 2006 - 09:17 am:   

Kyle,

I don't think you can calculate "c" directly if there is a step in the concentration, because the gradient will be infinite at the interface. I guess you could define a solubility coefficient "K" that has some value in the solid region and the value 1 in the gas region and then you substitute K*c for c in your equation. (On hindsight, you should probably change your diffusion coefficients too).

In this way, K*c will be continuous and there will be a step in c at the interface. I attached a simple script to demonstrate this.

Does this help?
application/octet-streamsimple script
test.pde (0.9 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 676
Registered: 06-2003
Posted on Monday, August 28, 2006 - 01:26 pm:   

Have you considered using a "Contact Resistance" boundary condition? This allows a flux determination based on a value jump at the surface. See "Contact" in the Help Index.
Top of pagePrevious messageNext messageBottom of page Link to this message

Bouke Tuinstra (bouke)
Member
Username: bouke

Post Number: 7
Registered: 04-2006
Posted on Thursday, August 31, 2006 - 07:25 am:   

That is what I thought at first, too. But there is a difference between the contact resistance case and what Kyle descibes.
In the contact resistance case, the size of the jump will depend on the flux, i.e., if there is no flux the concentration field will be uniform.

In Kyle's case, the concentration in the solid and in the gas will be different also if there is no flux.

In fact this is more or less caused by the definition of the concentration variable, since the chemical potential field *will* be uniform (i.e., solid-gas equilibrium so the chemical potential of the compound in the solid will be equal to the chemical potential in the gas). I think my "K*c" variable is in fact a simple representation of the chemical potential.

Maybe it would be possible to use a CONTACT boundary with a flux-independent jump?
Top of pagePrevious messageNext messageBottom of page Link to this message

Kyle (kyle)
New member
Username: kyle

Post Number: 2
Registered: 08-2006
Posted on Monday, September 04, 2006 - 12:41 am:   

Hi Bouke and Robert:

Thank you very much for responding to my post.

You guys are right about the "Contact Resistance" boundary condition - it won't work in this case because the "jump" remains even when the flux goes to zero (equilibrium), which is not the case for "Contact Resistance."

I think the "K*c" approach is a really great idea. I will try out the script with the "K*c" term and report back later.

What do you think about another idea of trying to define unique variables for the concentration in the solid and gas - "c_solid", "c_gas" - setting up two different diffusion equations, one for each variable, and trying to couple them at the interface through some sort of conservation of mass? Does this have any merit?

Best Regards,

Kyle
Top of pagePrevious messageNext messageBottom of page Link to this message

Kyle (kyle)
Junior Member
Username: kyle

Post Number: 3
Registered: 08-2006
Posted on Friday, September 15, 2006 - 06:13 pm:   

Hi All:

I have now tested out the proposed "K*c" approach for diffusion across a gas-solid interface for both steady-state and time dependent cases.

The results are this approach works great for all the steady-state cases I tried, but the time dependent cases are very sensitive - some work and most don't. I manually refined the mesh at regions where the "K" values jump by adding thin "Dummy Regions" that specify a finer mesh_spacing with some success, but this does not always solve the problem.

Unfortunately, I have some VALUE boundary conditions that are a central part of my diffusion modeling and the SAWGE function doesn't seem to eliminate the problem. I think I will need to express the initial condition in a better way to reduce startup sensitivity, but in 2D this rather difficult for my geometry. The SWAGE function would have been my choice for startup if it had worked.

Overall though, I think this is a generally suitable approach for treating diffusion across gas-solid interfaces.

Thank you and Best Regards,

Kyle
Top of pagePrevious messageNext messageBottom of page Link to this message

Kyle (kyle)
Member
Username: kyle

Post Number: 4
Registered: 08-2006
Posted on Friday, September 15, 2006 - 06:15 pm:   

Hi All:

I have now tested out the proposed "K*c" approach for diffusion across a gas-solid interface for both steady-state and time dependent cases.

The results are this approach works great for all the steady-state cases I tried, but the time dependent cases are very sensitive - some work and most don't. I manually refined the mesh at regions where the "K" values jump by adding thin "Dummy Regions" that specify a finer mesh_spacing with some success, but this does not always solve the problem.

Unfortunately, I have some VALUE boundary conditions that are a central part of my diffusion modeling and the SAWGE function doesn't seem to eliminate the problem. I think I will need to express the initial condition in a better way to reduce startup sensitivity, but in 2D this rather difficult for my geometry. The SWAGE function would have been my choice for startup if it had worked.

Overall though, I think this is a generally suitable approach for treating diffusion across gas-solid interfaces.

Thank you and Best Regards,

Kyle

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action:

Topics | Last Day | Last Week | Tree View | Search | Help/Instructions | Program Credits Administration