Non-linear diffusion calculaton

I am a relatively inexperienced Mecway user, and am wondering if it is possible to solve Fick's law for non-linear (concentration dependent diffusivity) in Mecway using CCX solver?
Thanks!
Tom

Comments

  • Hi,

    I don't think that MECWAY solves Fick's Law but Fick's Law is mathematically identical to Fourier's Law I believe (heat equation). MECWAY does seem to allow for temperature dependent thermal conductivity and specific heat so I think you could solve this using the Thermal Transient study and apply a temperature dependent thermal conductivity in the material. The only thing you would need to be cognizant of is that:

    - temperature represents concentration
    - thermal diffusivity represents the diffusion coefficient

    Since thermal diffusivity is the ratio of thermal conductivity to the product of density and specific heat you would just need to specify the thermal conductivity as your diffusion coefficient and its dependence on temperature (concentration). Then you could just set the density and specific heat to one. This should result in the same behavior I believe but maybe Victor could chime in.
  • Oh, that's a good point cmmcnamara. I don't see a problem with that. The CCX manual has a little table listing the relationship between thermal and diffusion variables too.
  • This is interesting, but what would be really powerful would be to create the equations, BC's, constants, IC's etc. via the formula entry chart, for a custom equation/solution, and solve. It seems like most of software infrastructure is already there, and Mecway could turn into a really powerful multiphysics solution program. The geometry, setup, flow, and solvers are already there. What do you think?
    In the case of my question, which I will try, per the comments, you already have the capability to create a profile (deposition), and then use that as input for redistribution diffusion.
  • cmmcnamara, I looked at what you suggested, and I'm not seeing how I can do what I want to do. When I ask for temperature dependent thermal, it only gives the option to construct a temp vs thermal conductivity graph relation, and what I want to do is construct an equation relating conductivity to temp to apply to the time step calculation. Am I missing something, or can't this be done?
  • tk1537, I think you are correct that it would be nice for MECWAY to support this kind of behavior and I think it does in certain locations (eg, you can define BC's such as 5*sin(5*t) to vary with simulation time). It would be similar to how COMSOL allows for this I believe. However I think Victor is trying to make these easier by exposing some of this via the upcoming Python API I've seen mentioned.

    You are also correct in what you are seeing. To mimic diffusion with the heat transfer analysis, you'll want to input thermal conductivity vs temperature but it would actually be diffusion coefficient vs concentration. Then you would set the density and specific heat to one. This would guarantee that thermal diffusion is equal to the diffusion coefficient in the model equations.

    For the time stepping, MECWAY (or CCX) should apply this relationship locally at each time step so once the relationship is entered, the time stepping portion should be handled automatically by the solver.
  • cmmcnamara, I understand I what you are saying about how thermal conductivity vs temp will work, but I want to just add an equation instead of a table of points to describe the relationship to Mecway, such as D = D0*(1+C/C0). This does not yet seem possible.
    Where can I read about this Python API you mentioned? One thing I like about Mecway is the GUI interface. There are plenty of other FEM apps out there who rely on terminal programming interface to create a problem, but with Mecway you have a user friendly GUI to create the problem which is intuitive and makes the work a lot simpler, not to mention the built it ccx multi core capabilities for big problems. I'd love to see Mecway eventually be capable of general multiphysics PDE problems with BC/IC/constants definition by either numbers, tables or equations. That would be powerful indeed.
  • have you tried flexpde. it might be better for what you want. certainly comsol as well. the python scripting isn't out yet. victor was saying that it would be in version 13 which might be out at the end of this month.
  • tk1537 I do see what you’re saying. I do agree that I like MECWAYs environment for its GUI and would like the capability of accessing CCX’s other solver capability including surface to surface radiation and it’s CFD as well. CCX has a lot of apparent capability that I think isn’t being utilized because lack of a GUI for it much like OpenFOAM.

    It would also be nice for writing in expression to accomplish different BCs, material behavior etc. I imagine some of the same logic used for the formulas in the loads might be able to be replicated in those other input fields but it’s probably quite a bit of effort to accomplish as well, especially when there is only a single developer (I think). I think that’s why MECWAY opts for the numeric table input because it would be needed regardless to input general data that might come from test (like stress and strain) but can still also support functions like yours by inputting the numeric result directly for the range you’re interested in.
  • prop_design, I'm familiar with the packages you suggest, but flexpde in anything other than 1D student is expensive and still is scripted, and comsol is beyond expensive. It will be interesting what comes out in Mecway 13.
    cmmcnamara, I know Victor is a one man show, and what he has done so far is fantastic and very powerful. Mecway is by far the easiest FEM software I've ever used to get quick yet accurate results, especially with imported STEP files from cad. I'm just talking out loud about features I'm hoping for that would make it even more fantastic.
  • I don't intend to make it a more general PDE solver like COMSOL/etc.

    But CCX's radiation between surfaces would certainly be a good fit. Not quite yet though. For now, you'd still have to define that by hand.
  • hi tk1537,

    yeah i was turned off by flexpde scripting as well. when comsol made a gui and started specializing that was much more attractive. however, i tried the demo once and couldn't even use it. the gui didn't fit well on a small laptop screen. also the amount of inputs for everything was not like normal fea. the only other program i can think of would be maple. they have an affordable home use license. however, it's not exactly scripting but it's not a gui either. i haven't used it personally.

    mecway's cost, ease of use, and customer service set it far above everyone else. you won't find anything like mecway. there is no way i could even use ccx at all if it wasn't for mecway. open source stuff tends to be a nightmare as far as documentation and learning how to use it. i can't think of any open source software with an easy to use gui. that is their general short coming.

    ccx hasn't been in mecway long and already victor has made great use of it. i think it will only grow with time. i honestly wasn't for the change. i liked the built in solver. but i have grown to like ccx more and use it exclusively now. i only use the gui in mecway. so i'm with you as far as adding as much as possible to the gui. i'm not into scripting, coding, etc... i do what i absolutely have to and that's it. a well designed gui is the best thing as far as i'm concerned.

    you can also use any thermal solver for electromagnetics. you just have to do some conversions on your inputs and outputs but it works fine.

    anthony
  • Victor, believe me, I understand your comments about making Mecway a general PDE solver - one can only ask. Mecway is already excellent for the price. Please consider, however, at least adding formula creation for temp dependent variables.

    Prop_design, I pretty much agree with everything you said.

    Tom
  • I will say, though, I'm really looking forward to Mecway using CCX's upcoming implementation of Hextreme, when and if it happens. Speculation is ccx 5.0.
  • edited February 2020
    CCX 5.0?????? Or Gmsh 5.0?
  • tk1537, I don't see why not, it just hasn't come up much. You can write the formula in a spreadsheet though and copy and paste the table to Mecway. You have to put a column of commas between the two values though.
  • Sergio, Sorry, I did mean Gmsh 5.0.
  • I´m waiting the Hextreme integration too, looks interesting, but in my opinion for a good hexa still we will need to do the work by hands. I saw several of this automatic tools, and for complex geometries they create too much elements, or fail to recreate the corners of the geometry.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!