Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Solute concentration distribution: Matlab to Comsol

Please login with a confirmed email address before reporting spam

Dear Colleagues

I had some problems implementing the Matlab results into the Comsol simulation. I'm a beginner of Comsol, so I don't really get the feeling how to link the results between Matlab and Comsol. I'll discuss the problem based on the pdf file that I attached below. The Comsol model, with which I'm working, evaluates the fluid pressure inside of the specimen depending on the osmotic pressure. The governing equation of osmotic pressure, which is called delta_p, is given in page 1 of the document. The parameter, which I'm trying to modifiy, is the beta_0. Until now, it was considered to be just one fixed value, but now I'm trying to make this parameter as variable. The parameter beta_0 is related to diffusion of solute (here you can just think beta_0 as solute concentration). In the page 3, you can see the initial condition of solute concentration. Then after certain time, the solute concentration changes, as you can see in the profile in the page 4. In other words, I calculate the values of beta_0 in Matlab with a diffusion model for each time step "delta_t". Each node of the mesh in the profile is assigned to a beta_0 value. So I get for each time step a matrix with the values of beta_0 as inserts in Matlab. Now, what I don't understand is how to insert these values of beta_0 from the matrix, that I obtain from Matlab, into the governing equation in the Comsol. Do you have any suggestions to this problem?

Thanks for your time to investigate this problem.



2 Replies Last Post 1 lug 2019, 05:26 GMT-4
Sven Friedel COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 1 lug 2019, 05:02 GMT-4
Updated: 5 years ago 1 lug 2019, 05:02 GMT-4

Hi Jacopo,

this is actually a user driven forum and COMSOL people do typically not post here, but I feel in your case I have to. Can you explain, what makes you solving the transport problem in Matlab at all? There may be very elegant ways to solve the complete coupled problem within COMSOL.

Best regards Sven Friedel

Hi Jacopo, this is actually a user driven forum and COMSOL people do typically not post here, but I feel in your case I have to. Can you explain, what makes you solving the transport problem in Matlab at all? There may be very elegant ways to solve the complete coupled problem within COMSOL. Best regards Sven Friedel

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 1 lug 2019, 05:26 GMT-4
Updated: 5 years ago 1 lug 2019, 05:26 GMT-4

Hi Jacopo,

this is actually a user driven forum and COMSOL people do typically not post here, but I feel in your case I have to. Can you explain, what makes you solving the transport problem in Matlab at all? There may be very elegant ways to solve the complete coupled problem within COMSOL.

Best regards Sven Friedel

Dear Sven

Oh.. I didn't know that. Thanks for your reply. This is part of the Master project and my supervisor told me to approach this way. Therefore, for the moment I would like to stick to this approach, instead of restarting the diffusion model with Comsol. Anyways, would you have any idea how to implement the results of Matlab into Comsol? Any suggestions would be helpful.

Kind regards, JC

>Hi Jacopo, > >this is actually a user driven forum and COMSOL people do typically not post here, but I feel in your case I have to. Can you explain, what makes you solving the transport problem in Matlab at all? There may be very elegant ways to solve the complete coupled problem within COMSOL. > >Best regards >Sven Friedel Dear Sven Oh.. I didn't know that. Thanks for your reply. This is part of the Master project and my supervisor told me to approach this way. Therefore, for the moment I would like to stick to this approach, instead of restarting the diffusion model with Comsol. Anyways, would you have any idea how to implement the results of Matlab into Comsol? Any suggestions would be helpful. Kind regards, JC

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.