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.

How to use dependent variable from one physics in another physics

Please login with a confirmed email address before reporting spam

Hello. I am doing research on chemical reactions on an electrode surface. I am using Electric Currents physics to solve for the voltage distribution over the electrode (dependent variable = V) and Transport of Diluted Species physics to solve the chemical reactions.

The chemical reaction rates depend on the voltage distribution. This means the voltage distribution must be solved before the reactions can be solved.

For example, one equation rate equation is the following:

kf1 = (k01)exp((1-alpha)nfa(V-E01))

where kf1 is the reaction rate, k01, alpha, n, fa, and E01 are parameters that have been defined, and V is the voltage solved for in the Electric Currents physics.

For the equation above, I get the warning "V is an unknown variable" even though it is defined as the dependent variable for the Electric Currents physics.

I have read from another thread that the way to solve this is with 2 different studies: one that solves for V and one that solves the reactions. However, I can not find how to pass the dependent variable V into the reactions study. How is this done?


3 Replies Last Post 2018年4月11日 GMT-4 04:29

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 2018年4月10日 GMT-4 11:49

Hi,

Go to the second study -> step 1 -> Value of dependent variables -> Check the "Values of variables not solved for" box and in method select "Solution" and in study choose "Study 1"

Best regards, Nichal

Hi, Go to the second study -> step 1 -> Value of dependent variables -> Check the "Values of variables not solved for" box and in method select "Solution" and in study choose "Study 1" Best regards, Nichal

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 2018年4月10日 GMT-4 16:54

Thank you. Now when I compute Study 2 after Study 1 I get an error "Undefined variable. - Variable: V - Geometry: geom1 - Domain: 1."

I have attached my program and a screenshot of the error.
Thank you. Now when I compute Study 2 after Study 1 I get an error "Undefined variable. - Variable: V - Geometry: geom1 - Domain: 1." I have attached my program and a screenshot of the error.


Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 2018年4月11日 GMT-4 04:29

Hi,

The error that you see comes from the use of the field variable V in the global Variables node. Such space-dependent variables cannot be used as global variables. If you instead define the variables in a Variables node under** Component 1>Definitions**, then you can compute Study 2. The species concentrations seem to be constant in that solutions though; that is not something that I have investigated.

Best regards, Magnus Ringh, COMSOL

Hi, The error that you see comes from the use of the field variable *V* in the global **Variables** node. Such space-dependent variables cannot be used as global variables. If you instead define the variables in a **Variables** node under** Component 1>Definitions**, then you can compute **Study 2**. The species concentrations seem to be constant in that solutions though; that is not something that I have investigated. Best regards, Magnus Ringh, COMSOL

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.