Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Updating variables in user defined settings: connecting concentration to conductivity.

Please login with a confirmed email address before reporting spam

I am using the Microfluidics module to model the electric field when different buffer plugs are loaded into a capillary. Because each buffer plug has significantly different resistance values I cannot use the same conductance value for the entire 2D-channel. To try and resolve this I created a buffer plug using a rectangular pulse function in the Transport of Diluted Species module. Under "Electric Current>>Current Conservation>>Conductance" I set the conductance using a user defined setting by subtracting the concentration (c) from some nominal background value. This works great and I'm able to calculate the electric field, creeping flow w/ electroosmosis to see the buffer plug move in a time dependent study.

My problem is that conductance does not update with the moving buffer plug when I use it in a time-depedent study or in a separate sequential study. My expression for conductance in the user defined function is (sigma-(c*sigma/a) where sigma is a nominal conductance value (S/m), c is concentration,a is a scalar to normalize the conductance. I assumed that c was a global variable for concentration and would use the current value in the solver from the Transport of Diluted species. But regardless it always uses the intial location of the buffer plug to determine conductance.

Is there a better way to connect a variable to a user defined setting?
Do I have to explicitly update a concentration variable with each new iteration of the Transport of Diluted species?

I am fairly new to Comsol so any advice would be appreciated!



2 Replies Last Post 04.11.2016, 09:45 GMT-4
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 04.11.2016, 08:30 GMT-4
Hello Brae,
I am not sure that you posted the file you intended.
In the file you posted, the electric conductivity is set to "conduct" through the Current Conservation 1 node, and "conduct" is undefined - hence the error message when you try to compute Study 1. Your model does define a variable you called "conduct2", but even that is only a function of x and some constants. Your model also includes a Current Conservation 2 node but it is both disabled and not assigned to any domain and therefore does not contribute to the model.

Poking around your file, I also noticed that in your variables you define variables "c" and "c2" and assign them some definitions. "c" and "c2" are already the names of two of the three concentrations in your Transport of Diluted Species interface.

As a new user, you can work through some of the tutorials contained in the Application Libraries to get more familiar with the software's interface. Thepdf files for these examples include step-by-step instructions so that you can use them for self-training. COMSOL also offers training courses: www.comsol.com/events/training-courses .
Best,
Jeff

Hello Brae, I am not sure that you posted the file you intended. In the file you posted, the electric conductivity is set to "conduct" through the Current Conservation 1 node, and "conduct" is undefined - hence the error message when you try to compute Study 1. Your model does define a variable you called "conduct2", but even that is only a function of x and some constants. Your model also includes a Current Conservation 2 node but it is both disabled and not assigned to any domain and therefore does not contribute to the model. Poking around your file, I also noticed that in your variables you define variables "c" and "c2" and assign them some definitions. "c" and "c2" are already the names of two of the three concentrations in your Transport of Diluted Species interface. As a new user, you can work through some of the tutorials contained in the Application Libraries to get more familiar with the software's interface. Thepdf files for these examples include step-by-step instructions so that you can use them for self-training. COMSOL also offers training courses: https://www.comsol.com/events/training-courses . Best, Jeff

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 04.11.2016, 09:45 GMT-4
Hey Jeff thanks for the quick reply!

The code I posted was not the one I wanted to post, I was just trying different things. But thank you for looking through the mess anyways and giving me some feedback.

I've been going over tutorials this morning and noticed that the Solver configurations were all different from mine. I think the tutorial I followed to start my model had me adjust the Solver configuration manually at some point but I had not been updating the Solvers as I adjusted my studies. I went back to my 'clean' model and reset the Solver to the default configurations and lo and behold I can get a second stationary study to plot conductance based off of the solution from the first study.

Thank you for your help! I'd love to take a training session in the future and maybe I can work that into the budget.

Brae

I've attached a cleaner version with the solver solution working.


--
Hey Jeff thanks for the quick reply! The code I posted was not the one I wanted to post, I was just trying different things. But thank you for looking through the mess anyways and giving me some feedback. I've been going over tutorials this morning and noticed that the Solver configurations were all different from mine. I think the tutorial I followed to start my model had me adjust the Solver configuration manually at some point but I had not been updating the Solvers as I adjusted my studies. I went back to my 'clean' model and reset the Solver to the default configurations and lo and behold I can get a second stationary study to plot conductance based off of the solution from the first study. Thank you for your help! I'd love to take a training session in the future and maybe I can work that into the budget. Brae I've attached a cleaner version with the solver solution working. --

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.