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.

solution as initial values for the next study

Please login with a confirmed email address before reporting spam

Hallo everybody,
i have got a problem with my simulation setup that has been keeping me busy for a week now.

what i am trying to do is to simulate an additive manufacturing process on the basis of the heat transfer physics. therefore i created a matlab routine that both aktivates/deactivates geometries and changes the heatsource position in every defined cycle. So far so good.
The routine must be created via matlab!!

now my problem is:
with every cycle the simulation resets the temperature distribution to default, which is totally incorrect for my attempt. I need to find a way to restart every simulation cycle with the initial values of the last study solution.
Has anybody got an idea how to solve that problem. Any workaround routines any suggestions?
i would be very appreciated

kind regards
Florian

3 Replies Last Post 14 dic 2016, 16:45 GMT-5

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 14 dic 2016, 10:03 GMT-5
Hello,

I also have a simulation which is controlled by MATLAB. And the solver also
needs to use his previously computed solution. I don't change the geometry within the
loop in MATLAB and the mesh also remains the same.

So I'm not sure if this solution can be used for your problem.
Because COMSOL has to map a solution from one geometry
to another, and also on a different mesh if have correctly understood you.

I would change settings in the Study - Step setup such that
the solver uses the previous solution as initial solution.
under "Values of Dependent Variables " ( see attached files)
- Initial values of variables solved for
- Values of variables not solved for
Hello, I also have a simulation which is controlled by MATLAB. And the solver also needs to use his previously computed solution. I don't change the geometry within the loop in MATLAB and the mesh also remains the same. So I'm not sure if this solution can be used for your problem. Because COMSOL has to map a solution from one geometry to another, and also on a different mesh if have correctly understood you. I would change settings in the Study - Step setup such that the solver uses the previous solution as initial solution. under "Values of Dependent Variables " ( see attached files) - Initial values of variables solved for - Values of variables not solved for


Please login with a confirmed email address before reporting spam

Posted: 8 years ago 14 dic 2016, 12:28 GMT-5
Hallo Jurij,
thank you for your reply. I know this funktion already but in my understanding this only works if you create several studies in one file that you run one at the time.

What i am lookink for is: I need to find a way to extract solution data from one simulated cycle and use those as initial value for the next cycle. this must be done through a matlab for loop and can't be done via several studies in Comsol itself.
Hallo Jurij, thank you for your reply. I know this funktion already but in my understanding this only works if you create several studies in one file that you run one at the time. What i am lookink for is: I need to find a way to extract solution data from one simulated cycle and use those as initial value for the next cycle. this must be done through a matlab for loop and can't be done via several studies in Comsol itself.

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 14 dic 2016, 16:45 GMT-5
Hello Florian,

So you basically have several COMSOL models ( say A and B) which have to exchange solution data.

Something like a for or while loop in MATLAB where you repeat several steps
1. solve COMSOL model A
2. Extract solution data from COMSOL model A
3. Import extracted solution data to COMSOL model B and set it as initial value
4. solve COMSOL model B
3. Extract solution data from COMSOL model B
4. Import extracted solution data to COMSOL model A and set it as initial value

or my second guess

some kind of loop in MATLAB
1. solve cycle A
2. extract solution data from cycle A
3. import solution data to cycle B
4. solve cycle B
5. extract solution data from cycle B
6. import solution data to cycle A

Hello Florian, So you basically have several COMSOL models ( say A and B) which have to exchange solution data. Something like a for or while loop in MATLAB where you repeat several steps 1. solve COMSOL model A 2. Extract solution data from COMSOL model A 3. Import extracted solution data to COMSOL model B and set it as initial value 4. solve COMSOL model B 3. Extract solution data from COMSOL model B 4. Import extracted solution data to COMSOL model A and set it as initial value or my second guess some kind of loop in MATLAB 1. solve cycle A 2. extract solution data from cycle A 3. import solution data to cycle B 4. solve cycle B 5. extract solution data from cycle B 6. import solution data to cycle A

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.