Change of parameter in time as variable

Numerical methods and mathematical models of Elmer
Post Reply
Franz Pichler
Posts: 196
Joined: 29 Sep 2011, 12:25
Antispam: Yes

Change of parameter in time as variable

Post by Franz Pichler »

Hello Everybody!!!

A new question every week, thats how much i use ELmer.
so

Is there a way to get the change in time of a material parameter?
I have a parameter C, and iwould need dot(c) in one equation.
I was thinking if the save materials solver could also save prevvalues to a variable or could create a parameter velocity variable or something.

any hints?

thanks
bye
Franz
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Change of parameter in time as variable

Post by mzenker »

Hi Franz,

I would try to write a UDF which does that. It would get the value of the parameter and save it. Then in the next timestep, it would get the actual value and compute its change versus the previous one, optionally divided by the time difference - in that case, it would also save the time similarly to the parameter value.

HTH,

Matthias
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Change of parameter in time as variable

Post by raback »

Hi Franz

Try in Solver section

Code: Select all

Calculate Velocity = Logical True
-Peter
Franz Pichler
Posts: 196
Joined: 29 Sep 2011, 12:25
Antispam: Yes

Re: Change of parameter in time as variable

Post by Franz Pichler »

Hi there,
thanks for both ideas,
Mzenkers, yours will work quite good i guess, but peters would definitly be prefareble.

Peter i tried calculate velocity but i doesnt work.

I doesnt attempt to create a new variable.
After searching the source code i think i narrowed it down to the problem of the timeorder.
The timeorder of the savematerials solver is 0 and in mainutils where the "calculate velocity" keyword is checked, there is an if timeroder ==! else if timeorder==2 control.
So the timeorder should be switched to 1 i guess.
I just did that by setting
solver%timeorder=1
in the Savedata solver.
Still it doesnt work.
Now i figured out that the Variables are not the main variables of the solver.
So i guesss they are like exported variables.
and the calulate velocity only works on the main variable right?

two questions:
1) is there a way around that
2) does the setting timeorder=1 cause sideefffects?

lots of questions.

thanks
bye
Franz
Post Reply