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.
Could you please tell me the name of the variable for time steps in comsol?
Posted 26 apr 2012, 17:21 GMT-4 Parameters, Variables, & Functions, Studies & Solvers Version 5.0 18 Replies
Please login with a confirmed email address before reporting spam
I am working in comsol 4.2a version for hydrogen storage system modelling. Could you please tell me the name of the variable for time steps in comsol?
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
don't know if this can help: www.comsol.com/community/forums/general/thread/23511/
Thanks for providing the link.
Actually we need to use the variable of time steps in the expression of comsol. But we don`t know the name of ime step in comsol. Could you please give an answer by more specifically?
Please login with a confirmed email address before reporting spam
But I would guess that you need to use a time-discrete solver and the 'prev' operator in order to use the previous timestep? This is just some thoughts, I never tried that.
Keep us informed if it works!
Cheers
Please login with a confirmed email address before reporting spam
Check carefully the doc, several of the operators and variables are only "postprocessing" variables, not defined during solving. But I do not know exactly which one you are looking for, so far I have not interfered with the solveing process in that way ;)
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
I had not looked at the doc for the 'prev' operator before my last post. I read it after your post and it specifically talks about the use of 'timestep' with the 'prev' operator. Siyad, I think that there is definitely hope for your problem!
Please login with a confirmed email address before reporting spam
you are right that operator is also valid during solvin (be aware not all operators can be used during solving, good to knw) ;)
see COMSOL Users Guidev4.2 p. 119
The expression prev(expr, i) evaluates expr using the solution obtained i time
steps before the current time step.
• The operator can be used in equations as well as for results evaluation.
.....
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
I need the actual COMSOL system time step to turn newly calculated concentrations per element into rates.
[(c_1-c_1_new)/delta_t=mol/m^3*s]
If I use strict timestepping I can define a stepsize myself, but this means I lose the advantage of automatically smaller timesteps when gradients are steep and such and big timesteps when calculations are easy and stable.
So, does anyone know what the name is or how to tackle this?
Thanks in advance,
Ray
Please login with a confirmed email address before reporting spam
have you tried "timestep" ? see page CM Users Guide p119 there are more info there
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
'
Hi
have you tried "timestep" ? see page CM Users Guide p119 there are more info there
--
Good luck
Ivar
Hi,
are you sure it's page 119? My page 119 is titled: ''Example of importing a file data source into a parameter table''..
Also; 'timestep' seemed to be the most obvious name so I did indeed try that. (actually I tried plotting the timestep of a done simulation to see if it is a valid name). Unfortunately COMSOL does not seem to recognize 'timestep' as a valid variable (it does give it the right unit [s], but I am unable to plot it.
The convergence plot is 1/timestep if I am correct, so it must be possible right? It does exist somewhere.
If you could find the right page I would be interested :)
Thanks!
Ray
Please login with a confirmed email address before reporting spam
Yes it's at p.119 of Comsol Multiphysics User's Guide Version 4.2a. If you have a different guide, it's under Global and Local Definitions\Operators, Functions, and Variables Reference\Special Operators\The Prev Operator.
Have you tried plotting timestep after solving with a time-discrete solver? Maybe it needs that type of solver in order to store the values...? Just a guess.
Please login with a confirmed email address before reporting spam
Hi Raymond,
Yes it's at p.119 of Comsol Multiphysics User's Guide Version 4.2a. If you have a different guide, it's under Global and Local Definitions\Operators, Functions, and Variables Reference\Special Operators\The Prev Operator.
Have you tried plotting timestep after solving with a time-discrete solver? Maybe it needs that type of solver in order to store the values...? Just a guess.
Hi Francois,
I see it now, I was looking in 4.1 manual ;)
If I use BDF timestepping, isn't time discretized per se? I ran the sim using BDF time stepping and it did not give results for 'timestep' (although 'timestep' is indeed mentioned under 'prev' in the manual).
Did I miss something?
Kind regards,
Ray
Please login with a confirmed email address before reporting spam
sorry that you didnt find it quickly, but COMSOl has so many pages of doc, and I only keep the latest one.
One thing I do index the pdf files then its easier to find your way, you "just" search for "timestep"
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Any ideas at all?
Kind regards,
Ray
Please login with a confirmed email address before reporting spam
I tried a few things but I cannot get the" timestep" variable to be dumpedout. COMSOL does recognise the name and unitsthough .
I believe you should use a time-discrete solve (not BDF or Gen-alphar, but I had not moresuccess with this solver method
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Am I still able to solve all my 'regular' equations with this?
Please advise. Thanks and kind regards,
Ray
Please login with a confirmed email address before reporting spam
check the doc (run an indexer over your pdf files it helps to fnd your way therein ;) there are so many combinations, impossible to say without studying in detail each case.
You have the standard predefined solvers wehn you set up your physics the first time you open a new file, but you can always add all sort of solver nodes to a main Study node, but it's up to you to know it they make any sens w.r.t your model and your need
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
The 'timestep' variable appears to be defined only during solution but not stored. For example, you can actually access it via probe (which will populate a table during solution) but during post processing you can't use it. As a simple work around I simply maded a dependent variable equal to it (with a very large tolerance). Now I have the step size variable in a form that can be used for post processing.
Please login with a confirmed email address before reporting spam
Hi
you are right that operator is also valid during solvin (be aware not all operators can be used during solving, good to knw) ;)
see COMSOL Users Guidev4.2 p. 119
The expression prev(expr, i) evaluates expr using the solution obtained i time
steps before the current time step.
• The operator can be used in equations as well as for results evaluation.
.....
--
Good luck
Ivar
Hi,
thanks for this answer I have similar problem and this solution seems to be working. But I have one more problem. Using it for Temperature in previous time step - prev(T,1) I got the answer that the previous time step is not stored. What is bad? Thank you.
Pavel
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.
Suggested Content
- FORUM Could you please help me?
- FORUM Variable name
- BLOG How to Add Stop Conditions to Solvers in COMSOL Multiphysics®
- BLOG Modeling a Periodic Heat Load
- KNOWLEDGE BASE Computing Time and Space Integrals