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.

N-layer iteration model with time-varying boundary conditions

Please login with a confirmed email address before reporting spam

Hi,
I've read previous threads about time-varying BC, but I need a little help in slightly different case:

I am simulating the heating of a polymer layer by INFRARED bulbs taking into account a partial phase change (Enthalpy method) from solid to liquid phase. Then after the cooling, I want to add another layer of the same polymer with the same properties and thickness and re-do the same operation of heating and cooling until I have completed my N-layer model.

Until now, i succeeded to simulate the heating of one layer in time-dependent mode, The TRICK is I don't know how to implement the geometry build-up in each iteration and how to force the solution of layer "N" to be the BC for layer "N+1"

PS:
- Using COMSOL 4.0a - Heat transfer in solids
-Some elements aren't taken into account (convective cooling at free surface, radiation interaction with the metal container...) but I will do it later after I know how to get through this.

Any idea, clue or help is greatly appreciated. Thanks in advance !
Ali

11 Replies Last Post Jun 18, 2012, 9:22 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 19, 2011, 11:17 p.m. EDT
Hi,

Please find attached my model (N-layer polymer.mph) and an image (concept.png) describing what I am trying to simulate here.

Ali
Hi, Please find attached my model (N-layer polymer.mph) and an image (concept.png) describing what I am trying to simulate here. Ali


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 21, 2011, 5:07 a.m. EDT
Hi Ali,

I think I underdstand your problem, the thing you have to do:

1) Solve your first iration, only with the 1 layer geometry (save your model as .mph)

2) With the same model still opened: add the next layer of the geomtry and add an initial condition for the temperature, set this init2 with the value "T" and apply it to the first layer

3) Apply init1 = 255.15 K to the new, second layer.

4) Go to Solver 1 > Dependent Variables > and set: Method to "Initial Expression" and set Solution to "Solver 1"

5) Solve it again and repeat steps 2, 3 and 4 untill your done.


In my opinion, that is the way to go.

Regards,

Peter
Hi Ali, I think I underdstand your problem, the thing you have to do: 1) Solve your first iration, only with the 1 layer geometry (save your model as .mph) 2) With the same model still opened: add the next layer of the geomtry and add an initial condition for the temperature, set this init2 with the value "T" and apply it to the first layer 3) Apply init1 = 255.15 K to the new, second layer. 4) Go to Solver 1 > Dependent Variables > and set: Method to "Initial Expression" and set Solution to "Solver 1" 5) Solve it again and repeat steps 2, 3 and 4 untill your done. In my opinion, that is the way to go. Regards, Peter

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 22, 2011, 8:10 p.m. EDT
Hi Peter,

Thank you for your reply, it worked successfully as you advised. Having solved this issue, I want to take your opinion in the following:

Is it possibe (and I think it is) to make this process automatic, without having each time to repeat the same tasks of adding identical geometry and boundary conditions at each iteration ? Because my plan is to go further, up to 10 layers or more. I think it's done by a batch command ...

Any clue or hint would be useful for me to start digging somewhere in this topic.
Thanks again for your fast reply.

*****
For whom it may concern, I found it more useful, at least in this case (my N-layer model), to work in the "Mathematics - PDE" module with the coefficient form than to work with the pre-defined "Heat transfer" module since I wanted to add a system of 4 PDE's (Schneider equations) that are essential in simulating the crystallization process (during the cooling phase).

I wonder why was the feature of showing the Heat equation omitted in the new versions >= 4.0 ? its "visibility" was useful somehow in the old 3.5 versions !
*****

Ali
Hi Peter, Thank you for your reply, it worked successfully as you advised. Having solved this issue, I want to take your opinion in the following: Is it possibe (and I think it is) to make this process automatic, without having each time to repeat the same tasks of adding identical geometry and boundary conditions at each iteration ? Because my plan is to go further, up to 10 layers or more. I think it's done by a batch command ... Any clue or hint would be useful for me to start digging somewhere in this topic. Thanks again for your fast reply. ***** For whom it may concern, I found it more useful, at least in this case (my N-layer model), to work in the "Mathematics - PDE" module with the coefficient form than to work with the pre-defined "Heat transfer" module since I wanted to add a system of 4 PDE's (Schneider equations) that are essential in simulating the crystallization process (during the cooling phase). I wonder why was the feature of showing the Heat equation omitted in the new versions >= 4.0 ? its "visibility" was useful somehow in the old 3.5 versions ! ***** Ali

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 23, 2011, 3:11 a.m. EDT
Hi,

Yes, perhaps a batch command should work, however I haven't any experience with that.

What I usually do, but that is somewhat more difficult I guess, is use the Matlab Livelink and run and adapt the model with a m-file script. You can easily create the m-file for your model by clicking File>Save as m-file. (perhaps click File>Reset History first, else your m-file is a mess).

It takes some time to figure out, but I think the m-file method is very convenient.

However, as said before, maybe an batch (I really don't know) is better/easier but I don't know that.

Succes,

Regards,

Peter.
Hi, Yes, perhaps a batch command should work, however I haven't any experience with that. What I usually do, but that is somewhat more difficult I guess, is use the Matlab Livelink and run and adapt the model with a m-file script. You can easily create the m-file for your model by clicking File>Save as m-file. (perhaps click File>Reset History first, else your m-file is a mess). It takes some time to figure out, but I think the m-file method is very convenient. However, as said before, maybe an batch (I really don't know) is better/easier but I don't know that. Succes, Regards, Peter.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 23, 2011, 10:39 a.m. EDT
Hi,

Thanks for your concern, I will try searching how to implement this with Matlab. I will post the method once I get grip of it.

Regards
---
Ali
Hi, Thanks for your concern, I will try searching how to implement this with Matlab. I will post the method once I get grip of it. Regards --- Ali

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 1, 2011, 11:28 a.m. EDT
Hi Peter,

You showed me earlier how to set a solution as an initial value when I add geometry.
Does it work the same way in the following case:

I have a similar model (with simple one rectangle as geometry) but this time, I have 2 different studies, within the Heat Transfer module, the first is a heating transient study (from 0 to 20 seconds) the second is a cooling transient study (from 20 to 400 secs) so I want the solution of the first study to be the initial value for the second study

At first I tried study steps, and following your tutorial, I couldn't get through since now I have 2 variables, T1 and T2.
Any suggestions ?

Thanks in advance
--
Ali
Hi Peter, You showed me earlier how to set a solution as an initial value when I add geometry. Does it work the same way in the following case: I have a similar model (with simple one rectangle as geometry) but this time, I have 2 different studies, within the Heat Transfer module, the first is a heating transient study (from 0 to 20 seconds) the second is a cooling transient study (from 20 to 400 secs) so I want the solution of the first study to be the initial value for the second study At first I tried study steps, and following your tutorial, I couldn't get through since now I have 2 variables, T1 and T2. Any suggestions ? Thanks in advance -- Ali

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 4, 2011, 7:12 a.m. EDT
I'm no expert, but I think you should be able to just use 'T1' and/or 'T2' in the field 'init1'.
If not you could try to use the same HT modules, but changing the setting manually in between the steps/studies.


I'm no expert, but I think you should be able to just use 'T1' and/or 'T2' in the field 'init1'. If not you could try to use the same HT modules, but changing the setting manually in between the steps/studies.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 4, 2011, 7:40 a.m. EDT
Hi

there are several was to test your case:

1) if your geometry is not changing, just the heat flux/source then run your solver for the full time range and change your heat source term to a time dependent one: multiply by a "step" function set up such to be 1 from start and "0" after time t=end_of_heating_time

2) you define one model but two sequential transient solutions with a "store solution" in between, then you restart the second solver with the initial conditions set to start from "stored solution" (but you cannot chain them automatically if you do not set a boolean equation for your heat source, or you must change it by hand)

All this is far easier in the latest version as the store solution restart is implemented automatically if you chain two solver sequences


--
Good luck
Ivar
Hi there are several was to test your case: 1) if your geometry is not changing, just the heat flux/source then run your solver for the full time range and change your heat source term to a time dependent one: multiply by a "step" function set up such to be 1 from start and "0" after time t=end_of_heating_time 2) you define one model but two sequential transient solutions with a "store solution" in between, then you restart the second solver with the initial conditions set to start from "stored solution" (but you cannot chain them automatically if you do not set a boolean equation for your heat source, or you must change it by hand) All this is far easier in the latest version as the store solution restart is implemented automatically if you chain two solver sequences -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 21, 2012, 5:23 a.m. EST
Hi,

I have been studying this interesting example of the N-layer polymer.
I opened it in comsol 4.2a to see the details of the model.
Now I have a question about the function 'f', which is a stepfunction defining the liquid fraction based on the average of the melting-point temperatures. I saw that the function 'f' is used in the material property definition of the heat capacity (Cp), conductivity etc. Here 'f' is defined as a function (argument) of x. I assumed that x would be a position/coordiinate, is this correct? I would assume that 'f' should be a function of temperature T.
Can you comment on this? Maybe I just misunderstand.

many thanks in advance,

Madesh.
Hi, I have been studying this interesting example of the N-layer polymer. I opened it in comsol 4.2a to see the details of the model. Now I have a question about the function 'f', which is a stepfunction defining the liquid fraction based on the average of the melting-point temperatures. I saw that the function 'f' is used in the material property definition of the heat capacity (Cp), conductivity etc. Here 'f' is defined as a function (argument) of x. I assumed that x would be a position/coordiinate, is this correct? I would assume that 'f' should be a function of temperature T. Can you comment on this? Maybe I just misunderstand. many thanks in advance, Madesh.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 21, 2012, 6:06 a.m. EST
Hi

in most function definitions the argument lettre/name is arbitrary. One tend to use an argument name thatis related to the physical property, but these are fully decoupled. So an x as argument for an operator definition is in fact any argument, made unitless (except for cetain unit-dimensional operators now possible in 4.2) by the operator call

f(x) in the definition can be called by an f(T[1/K]) with a temperature expressed in kelvin, as well as an f(t[1/s]) a time expressed in seconds. All depends what the "f" was intended for (while f(T[1/degC]) id the function called with a n8umber expresed in temperature but on a °C scale ...

--
Good luck
Ivar
Hi in most function definitions the argument lettre/name is arbitrary. One tend to use an argument name thatis related to the physical property, but these are fully decoupled. So an x as argument for an operator definition is in fact any argument, made unitless (except for cetain unit-dimensional operators now possible in 4.2) by the operator call f(x) in the definition can be called by an f(T[1/K]) with a temperature expressed in kelvin, as well as an f(t[1/s]) a time expressed in seconds. All depends what the "f" was intended for (while f(T[1/degC]) id the function called with a n8umber expresed in temperature but on a °C scale ... -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 18, 2012, 9:22 a.m. EDT
Hi Ali,
I read about your N-layer problem and I am interested in it. I have a question about the modeling of your N-layer model.
After simulating the first layer, the first layer cools down, and becomes a solid polymer layer with some deformation, which means the geometry of the solid layer is not the same with the geometry model of its original liquid layer. Therefore, when building the second layer, the geometry model of the second liquid layer should also account for the deformed part of the first solid layer in addition to the regular geometry model of the second layer(regular model: rectangle).
My question is: have you taken into account the fact that the first layer can be deformed? if so, the geometry model of the second layer should not be a regular rectangular model.

Thanks in advance for your help.


Kai




Hi,
I've read previous threads about time-varying BC, but I need a little help in slightly different case:

I am simulating the heating of a polymer layer by INFRARED bulbs taking into account a partial phase change (Enthalpy method) from solid to liquid phase. Then after the cooling, I want to add another layer of the same polymer with the same properties and thickness and re-do the same operation of heating and cooling until I have completed my N-layer model.

Until now, i succeeded to simulate the heating of one layer in time-dependent mode, The TRICK is I don't know how to implement the geometry build-up in each iteration and how to force the solution of layer "N" to be the BC for layer "N+1"

PS:
- Using COMSOL 4.0a - Heat transfer in solids
-Some elements aren't taken into account (convective cooling at free surface, radiation interaction with the metal container...) but I will do it later after I know how to get through this.

Any idea, clue or help is greatly appreciated. Thanks in advance !
Ali


Hi Ali, I read about your N-layer problem and I am interested in it. I have a question about the modeling of your N-layer model. After simulating the first layer, the first layer cools down, and becomes a solid polymer layer with some deformation, which means the geometry of the solid layer is not the same with the geometry model of its original liquid layer. Therefore, when building the second layer, the geometry model of the second liquid layer should also account for the deformed part of the first solid layer in addition to the regular geometry model of the second layer(regular model: rectangle). My question is: have you taken into account the fact that the first layer can be deformed? if so, the geometry model of the second layer should not be a regular rectangular model. Thanks in advance for your help. Kai [QUOTE] Hi, I've read previous threads about time-varying BC, but I need a little help in slightly different case: I am simulating the heating of a polymer layer by INFRARED bulbs taking into account a partial phase change (Enthalpy method) from solid to liquid phase. Then after the cooling, I want to add another layer of the same polymer with the same properties and thickness and re-do the same operation of heating and cooling until I have completed my N-layer model. Until now, i succeeded to simulate the heating of one layer in time-dependent mode, The TRICK is I don't know how to implement the geometry build-up in each iteration and how to force the solution of layer "N" to be the BC for layer "N+1" PS: - Using COMSOL 4.0a - Heat transfer in solids -Some elements aren't taken into account (convective cooling at free surface, radiation interaction with the metal container...) but I will do it later after I know how to get through this. Any idea, clue or help is greatly appreciated. Thanks in advance ! Ali [/QUOTE]

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.