Kristian Ejlebjærg Jensen
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
8 months ago
2024年12月17日 GMT+8 16:49
Updated:
6 months ago
2025年1月30日 GMT+8 21:49
Hi
You need gradient based optimization for topology optimization and that does not support use of the withsol() operator in the objective function. You can open the tesla_microvalve_transient_optimization library model and see how it uses an ODE to define a time average objective.
Your case is a bit more difficult, because you need the time average of an expression involving another time average, so I suggest that you double the time and use separate physics interfaces to perform the two integrations. This would involve:
Add two ODE to your model
Duplicate the Heat Transfer interface (or whatever you use to compute the temperature). Possibly you also have to duplicate all other interfaces, but you need setup the 2nd set of interfaces to start up half way through the simulation, so that you can
Use the first ODE to compute the average temperature of the 1st set of interfaces during the first half of the simulation
Use the 2nd ODE to compute the average deviation of the temperature in the 2nd set of interface from the average just computed, but this would then be done during the 2nd half of the simulation.
It is not exactly pretty, but I think it is your only hope of getting this working. Alternatives could be to.
A: Minimize the average time derivative of the temperature as that would also prevent your temperature from fluctuating too much. Note however that time derivatives cannot be used explicitly in the objective function, but I guess you would be using an ODE to compute the time average and then there would be no problem (you get a warning about it, if it is a problem).
B: Instead of minimizing the difference to the average, you can minimize the difference to a predefined temperature. With a bit of trial and error you can probably get the predefined temperature very close to the average.
I know that it is not what you asked, but I would definitely go for B here.
Best regards,
Kristian E. Jensen
Technical Product Manager, Optimization
Hi
You need gradient based optimization for topology optimization and that does not support use of the withsol() operator in the objective function. You can open the tesla_microvalve_transient_optimization library model and see how it uses an ODE to define a time average objective.
Your case is a bit more difficult, because you need the time average of an expression involving another time average, so I suggest that you double the time and use separate physics interfaces to perform the two integrations. This would involve:
1. Add two ODE to your model
2. Duplicate the Heat Transfer interface (or whatever you use to compute the temperature). Possibly you also have to duplicate all other interfaces, but you need setup the 2nd set of interfaces to start up half way through the simulation, so that you can
3. Use the first ODE to compute the average temperature of the 1st set of interfaces during the first half of the simulation
4. Use the 2nd ODE to compute the average deviation of the temperature in the 2nd set of interface from the average just computed, but this would then be done during the 2nd half of the simulation.
It is not exactly pretty, but I think it is your only hope of getting this working. Alternatives could be to.
A: Minimize the average time derivative of the temperature as that would also prevent your temperature from fluctuating too much. Note however that time derivatives cannot be used explicitly in the objective function, but I guess you would be using an ODE to compute the time average and then there would be no problem (you get a warning about it, if it is a problem).
B: Instead of minimizing the difference to the average, you can minimize the difference to a predefined temperature. With a bit of trial and error you can probably get the predefined temperature very close to the average.
I know that it is not what you asked, but I would definitely go for B here.
Best regards,
Kristian E. Jensen
Technical Product Manager, Optimization