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.
How to change solving order of equations during calculation without ''Circular variable dependency'' ?
Posted Jun 14, 2012, 4:19 p.m. EDT Materials, Parameters, Variables, & Functions, Studies & Solvers Version 4.2a 1 Reply
Please login with a confirmed email address before reporting spam
Dear colleagues,
I have a question about COMSOL logic concerning circular variable dependency.
Let's say I have 6 simple equations (just variables definitions) and I want to change the order in which they are solved when a certain condition is met during simulation. How do I write this down without getting said error?
Context:
I have a particle that releases gas and thus decreases in density, but stays the same volume. When combustion starts (the condition), the density stays the same, but now the volume decreases. I have defined the volume and density everywhere in my model so I want to keep those names the same. But in the first situation, I know the volume so I calculate the density, while in the second situation I know the density, but I want the calculate the volume. I tried to use dummy variables, but COMSOL won't let me use it.
What I tried was I defined a switch as:
switch = if(condition,1,0)
dummy_rho_1 = calculation method 1
dummy_rho_2 = calculation method 2
rho = (method for situation 1)*switch + (method for situation 2)*(1-switch)
dummy_volume_1 = calculation method 1
dummy_volume_2 = calculation method 2
volume = (method for situation 1)*switch + (method for situation 2)*(1-switch)
But because parts of the dummy variables are dependent on each other (even though I separated them by the switch method), COMSOL states the circ. var. dep. So, does anyone have a good idea or hint or suggestion to tackle this? It would be much appreciated.
Thanks a lot and kind regards,
Ray
PS. I wanted to include the actual equations, but because the forum doesn't allow me to attach a text file, I will post them in the next reply box. Maybe they can help. :)
I have a question about COMSOL logic concerning circular variable dependency.
Let's say I have 6 simple equations (just variables definitions) and I want to change the order in which they are solved when a certain condition is met during simulation. How do I write this down without getting said error?
Context:
I have a particle that releases gas and thus decreases in density, but stays the same volume. When combustion starts (the condition), the density stays the same, but now the volume decreases. I have defined the volume and density everywhere in my model so I want to keep those names the same. But in the first situation, I know the volume so I calculate the density, while in the second situation I know the density, but I want the calculate the volume. I tried to use dummy variables, but COMSOL won't let me use it.
What I tried was I defined a switch as:
switch = if(condition,1,0)
dummy_rho_1 = calculation method 1
dummy_rho_2 = calculation method 2
rho = (method for situation 1)*switch + (method for situation 2)*(1-switch)
dummy_volume_1 = calculation method 1
dummy_volume_2 = calculation method 2
volume = (method for situation 1)*switch + (method for situation 2)*(1-switch)
But because parts of the dummy variables are dependent on each other (even though I separated them by the switch method), COMSOL states the circ. var. dep. So, does anyone have a good idea or hint or suggestion to tackle this? It would be much appreciated.
Thanks a lot and kind regards,
Ray
PS. I wanted to include the actual equations, but because the forum doesn't allow me to attach a text file, I will post them in the next reply box. Maybe they can help. :)
1 Reply Last Post Jun 14, 2012, 4:19 p.m. EDT