- #1
py_engineer
- 12
- 0
Hi,
I am using COMSOL Script and I am trying to figure out something.
Let's say I am only solving one PDE which solution is 'phi'. And I am doing a parametric study, so I am solving it for different biases 'Va' from 0V to -1V. My geometry is simply a rectangle.
As part of the PDE, I have a parameter 'equ.f' which I set to be equal to 'Rec'. 'Rec' is defined in 'fem.globalexpr'.
For Va=0 (initial solution), I set 'Rec' to be 0. But then, for all the following steps, I want 'Rec' to be a function of the solution 'phi' found by COMSOL at Va=0. Is there a way to do that? Basically, I want to be able to use the initial solution in order to define an expression which is to be used in all the following steps..
I tried to solve for Va=0, then save the FEM structure, and use it to define 'Rec' by doing something like Rec=posteval(fem,'phi','solnum'1), and then solve again for the following steps. But it seems the format is not compatible. I get an error like 'cannot evaluate 'Rec', etc. So it didn't work.. (or maybe I didn't do it right..)
Any ideas would be GREATLY appreciated! Thanks!
I am using COMSOL Script and I am trying to figure out something.
Let's say I am only solving one PDE which solution is 'phi'. And I am doing a parametric study, so I am solving it for different biases 'Va' from 0V to -1V. My geometry is simply a rectangle.
As part of the PDE, I have a parameter 'equ.f' which I set to be equal to 'Rec'. 'Rec' is defined in 'fem.globalexpr'.
For Va=0 (initial solution), I set 'Rec' to be 0. But then, for all the following steps, I want 'Rec' to be a function of the solution 'phi' found by COMSOL at Va=0. Is there a way to do that? Basically, I want to be able to use the initial solution in order to define an expression which is to be used in all the following steps..
I tried to solve for Va=0, then save the FEM structure, and use it to define 'Rec' by doing something like Rec=posteval(fem,'phi','solnum'1), and then solve again for the following steps. But it seems the format is not compatible. I get an error like 'cannot evaluate 'Rec', etc. So it didn't work.. (or maybe I didn't do it right..)
Any ideas would be GREATLY appreciated! Thanks!