Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2013年6月18日 GMT-4 21:56
I managed to solve this problem using Matlab. However, now I have another problem with respect to extracting result data.
Imagine that you have tens of transient solvers each corresponding to a different time period of the problem. In COMSOL, is it possible to combine these results and get continuous data?
My solver configuration looks like:
Solver 1: range(0, 15[min], 6[h])
Solver 2: range(6[h], 15[min], 24[h])
Solver 3: range(24[h], 15[min], 30[h])
Solver 4: range(30[h], 15[min], 48[h])
....
Can I extract the data, i.e. integration of heat flux over a certain boundary for the total period (0 to 48 hours)? Right now I can only do it per solution within COMSOL. I think this is also doable by writing a script in Matlab, but I was wondering if there is a practical way to do it within COMSOL.
Thanks,
--
Tolga
I managed to solve this problem using Matlab. However, now I have another problem with respect to extracting result data.
Imagine that you have tens of transient solvers each corresponding to a different time period of the problem. In COMSOL, is it possible to combine these results and get continuous data?
My solver configuration looks like:
[quote]Solver 1: range(0, 15[min], 6[h])
Solver 2: range(6[h], 15[min], 24[h])
Solver 3: range(24[h], 15[min], 30[h])
Solver 4: range(30[h], 15[min], 48[h])
....[/quote]
Can I extract the data, i.e. integration of heat flux over a certain boundary for the total period (0 to 48 hours)? Right now I can only do it per solution within COMSOL. I think this is also doable by writing a script in Matlab, but I was wondering if there is a practical way to do it within COMSOL.
Thanks,
--
Tolga
Henrik Sönnerlind
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2013年6月19日 GMT-4 02:59
Hi,
There is a simple trick to do this. For the first day write your prescribed temperature as
if(t<6[h],T0,T)
where T0 is your prescribed temperature, and T is the name of the temperature degree of freedom. The 'if' condition has to be generalized to cover more days of course.
This reason that this works is that the constraint applied is T-T_prescribed = 0. So if we set the prescribed temperature to T itself, no constraint is generated since T-T cancels.
Now you can run all in one study, and can avoid the problems with merging results.
Regards,
Henrik
Hi,
There is a simple trick to do this. For the first day write your prescribed temperature as
if(t
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2013年6月19日 GMT-4 03:05
Hi Henrik,
Thank you so much for the trick. I couldn't imagine that this would work.
I was struggling with writing code in Matlab to generate the needed study steps and extract result data. I've been successful so far, but the trick you provided will make things way easier and faster.
--
Tolga
Hi Henrik,
Thank you so much for the trick. I couldn't imagine that this would work.
I was struggling with writing code in Matlab to generate the needed study steps and extract result data. I've been successful so far, but the trick you provided will make things way easier and faster.
--
Tolga
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2013年6月19日 GMT-4 03:50
Here is my solution as per Henrik's suggestion:
I set the prescribed temperature as follows: (Works perfectly, thanks again!)
if(mod(t/3600, 24) <= 6, T0, T)
For the Matlab solution, the trick is to conditionally toggle the Temperature BC node:
model.physics('ht').feature('temp1').active(true);
model.physics('ht').feature('temp1').active(false);
and in order to extract data from the model:
% get the heat flux magnitude for current solver step
totalHeatFluxMagnitudeOfPipeInnerBoundaryForCurrentStep = mphint2(model, {'ht.tfluxMag'}, 'line', 'dataset', solutionSet, 'selection', 'sel5');
% Merge the data: Only for the first step, directly assign it to current data
totalHeatFluxMagnitudeOfPipeInnerBoundary = totalHeatFluxMagnitudeOfPipeInnerBoundaryForCurrentStep;
% Merge the data: For other steps, add current data and obtain cumulative data
totalHeatFluxMagnitudeOfPipeInnerBoundary = [totalHeatFluxMagnitudeOfPipeInnerBoundary totalHeatFluxMagnitudeOfPipeInnerBoundaryForCurrentStep];
Here solutionSet is the name of the solution set, which you will need to iterate in your loop, i.e. 'dset1', 'dset2', ...
--
Tolga
Here is my solution as per Henrik's suggestion:
I set the prescribed temperature as follows: (Works perfectly, thanks again!)
[quote]if(mod(t/3600, 24)
Please login with a confirmed email address before reporting spam
Posted:
10 years ago
2014年12月22日 GMT-5 15:31
Understanding that set u=u means to switch off the constraint
another way to do this is
T-T*(t<0.6[h])+T0*(t<0.6[h])
this is useful when the switch is based on randomly-changing variables (say you want to switch to insulation when temperature(x,y,z) reaches 90 [degC])
Understanding that set u=u means to switch off the constraint
another way to do this is
T-T*(t
Please login with a confirmed email address before reporting spam
Posted:
10 years ago
2015年1月2日 GMT-5 19:21
I found this switching BC worked fine when switch from temperature to insulation. However, when switch from insulation to temperature, it does not converge. Is there any solution to this?
I found this switching BC worked fine when switch from temperature to insulation. However, when switch from insulation to temperature, it does not converge. Is there any solution to this?
Please login with a confirmed email address before reporting spam
Posted:
8 years ago
2017年1月5日 GMT-5 01:35
Can someone explain me how does exactly work "mod(t,24)"?
Can someone explain me how does exactly work "mod(t,24)"?