Henrik Sönnerlind
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
6 months ago
2024年5月21日 GMT-4 05:28
Updated:
6 months ago
2024年5月22日 GMT-4 02:34
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
2024年5月22日 GMT-4 00:47
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!