Henrik Sönnerlind
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
6 months ago
21.05.2024, 05:28 GMT-4
Updated:
6 months ago
22.05.2024, 02:34 GMT-4
There are two different ways in which I interpret your question:
a) Store the first time at which p exceeds 1 MPa anywhere.
b) For every point in space, store the time at which 1 MPa is exceeded at that point
Both are doable. In either case, the idea is to use a variable which is originally initialized to zero (which would be the default). Then you set it, using an expression of the type
if variable = 0 AND p > 1 MPa
variable = t
else
variable = variable
You will get the time of the first time step at which the reference value is exceeded, which is more or less later than the true time, depending on your time step. There are more sophisticated variants of this scheme which would make an interpolation possible. Then, you would have to use more than one auxiliary variable.
For case a) above, the Events interface can also be useful.
-------------------
Henrik Sönnerlind
COMSOL
There are two different ways in which I interpret your question:
a) Store the first time at which p exceeds 1 MPa anywhere.
b) For every point in space, store the time at which 1 MPa is exceeded at that point
Both are doable. In either case, the idea is to use a variable which is originally initialized to zero (which would be the default). Then you set it, using an expression of the type
if variable = 0 AND p > 1 MPa
variable = t
else
variable = variable
You will get the time of the first time step at which the reference value is exceeded, which is more or less later than the true time, depending on your time step. There are more sophisticated variants of this scheme which would make an interpolation possible. Then, you would have to use more than one auxiliary variable.
For case a) above, the Events interface can also be useful.
Please login with a confirmed email address before reporting spam
Posted:
6 months ago
22.05.2024, 00:47 GMT-4
There are two different ways in which I interpret your question:
a) Store the first time at which p exceeds 1 MPa anywhere.
b) For every point in space, store the time at which 1 MPa is exceeded at that point
Both are doable. In either case, the idea is to use a variable which is originally initialized to zero (which would be the default). Then you set it, using an expression of the type
if variable = 0 AND p > 1 MPa
variable = t
else
variable = variable
You will get the time of the first time step at which the reference value is exceeded, which is more or less later than the true time, depending on your time step. There are more sophisticated variants of this scheme which would make an interpolation possible. The, you would have to use more than one auxiliary variable.
For case a) above, the Events interface can also be useful.
I understood what you meant and managed to get the time I wanted through your method, thank you very much!
>There are two different ways in which I interpret your question:
>
>a) Store the first time at which p exceeds 1 MPa anywhere.
>b) For every point in space, store the time at which 1 MPa is exceeded at that point
>
>Both are doable. In either case, the idea is to use a variable which is originally initialized to zero (which would be the default). Then you set it, using an expression of the type
>
>if variable = 0 AND p > 1 MPa
> variable = t
>else
> variable = variable
>
>You will get the time of the first time step at which the reference value is exceeded, which is more or less later than the true time, depending on your time step. There are more sophisticated variants of this scheme which would make an interpolation possible. The, you would have to use more than one auxiliary variable.
>
>For case a) above, the Events interface can also be useful.
I understood what you meant and managed to get the time I wanted through your method, thank you very much!