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.

initialize timestep and Temperature to use prev()

Please login with a confirmed email address before reporting spam

Hello, to calculate the current cooling rate I use the formula (T-prev(T,1))/(t-prev(t,1)). However. In the first step I cannot use the prev() command, as there are no values before the first step. Can I somehow initialize these values? Or can I even calculate the cooling rate more elegant? Kind regards, Christian


5 Replies Last Post 5 apr 2019, 02:57 GMT-4
Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2 apr 2019, 07:37 GMT-4

Hi,

More elegant is to use the built in time derivative of the temperature, 'Tt'.

Regards,
Henrik

-------------------
Henrik Sönnerlind
COMSOL
Hi, More elegant is to use the built in time derivative of the temperature, 'Tt'. Regards, Henrik

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 3 apr 2019, 08:30 GMT-4

Hi,

thank you for your answer. But I still have a similar problem: Variable Tt cannot be evaluated. The problem is in the first step I think. I do have the starting temperature T at t=0 for all points in x,y,z. The problem was with the older method using prev() that I could not evaluate dT/dt at the first point as I do not have enough Data. I think this time I have a similar problem. If necessarily could even provide an initial value for Tt, if I would know where to assign the initial value of Tt.

Currently I do have an analytic function defined in the components and I just used Tt for the cooling rate.

Kind regards, Christian

Hi, thank you for your answer. But I still have a similar problem: Variable Tt cannot be evaluated. The problem is in the first step I think. I do have the starting temperature T at t=0 for all points in x,y,z. The problem was with the older method using prev() that I could not evaluate dT/dt at the first point as I do not have enough Data. I think this time I have a similar problem. If necessarily could even provide an initial value for Tt, if I would know where to assign the initial value of Tt. Currently I do have an analytic function defined in the components and I just used Tt for the cooling rate. Kind regards, Christian

Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 3 apr 2019, 10:53 GMT-4

Hi Christian,

What study type (and settings) are you using?

Regards,
Henrik

-------------------
Henrik Sönnerlind
COMSOL
Hi Christian, What study type (and settings) are you using? Regards, Henrik

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 3 apr 2019, 11:05 GMT-4

Hi Henrik,

My Study looks like this: I am using an optimization and as Step 1 I use a Time Dependent Study Step. In the Solver Configurations the optimization solver is also time dependent. The error appears in the optimization solver (as I use my function as an Objective for my optimization). Kind regards, Christian

Hi Henrik, My Study looks like this: I am using an optimization and as Step 1 I use a Time Dependent Study Step. In the Solver Configurations the optimization solver is also time dependent. The error appears in the optimization solver (as I use my function as an Objective for my optimization). Kind regards, Christian

Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 5 apr 2019, 02:57 GMT-4

Hi Christian,

I think you should either contact support, or upload a simplified version of your model here.

Regards,
Henrik

-------------------
Henrik Sönnerlind
COMSOL
Hi Christian, I think you should either contact support, or upload a simplified version of your model here. Regards, Henrik

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.