Page 1 of 1
Time dependent Boundary Conditions
Posted: 26 Oct 2010, 20:06
by mdiazv64
Hi, everybody.
I am new user of Elmer.
I would like to know if it is possible to specify in the ElmerGUI boundary conditions depending on time?
Thanks in advance,
Martin
Re: Time dependent Boundary Conditions
Posted: 26 Oct 2010, 20:14
by Juha
HI Martin,
yes this is possible. Activate the input field in question, and press "Enter". A small input
text editor should appear. In the text editor write
Variable time
Real MATC "sin(tx)"
for example, and close the window.
(The tx(0:n-1) array always referes to listed names in the "Variable x,y,z,..." syntax,
in this example the first and only entry is the "time").
Regards, Juha
Re: Time dependent Boundary Conditions
Posted: 26 Oct 2010, 21:26
by mdiazv64
Juha, thank you for your quick replay.
I wrote in the text editor of the corresponding boundary condition the following:
Variable time
if ( time<=3600 ) 0.617
else 0.0
But, when I run the problem I received the message:
ERROR:: Model Input: For property
name:[boundary condition 4]
Could you tell me what I did wrong?
Regards,
Martin
Juha wrote:HI Martin,
yes this is possible. Activate the input field in question, and press "Enter". A small input
text editor should appear. In the text editor write
Variable time
Real MATC "sin(tx)"
for example, and close the window.
(The tx(0:n-1) array always referes to listed names in the "Variable x,y,z,..." syntax,
in this example the first and only entry is the "time").
Regards, Juha
Re: Time dependent Boundary Conditions
Posted: 26 Oct 2010, 21:46
by mdiazv64
I think I understood now, the correct way is as follows:
Variable time
Real MATC "0.617*(tx<=3600)"
Re: Time dependent Boundary Conditions
Posted: 27 Oct 2010, 06:38
by Juha
Hi,
this should also work
Code: Select all
Variable time
if ( time<=3600 ) { 0.617 } else { 0.0 }
Juha
Re: Time dependent Boundary Conditions
Posted: 27 Oct 2010, 06:54
by Juha
Re: Time dependent Boundary Conditions
Posted: 14 Jul 2016, 19:41
by amrueda
Hello everybody,
I was wondering if it is possible to prescribe a Dirichlet boundary condition up to a time and then release it, so that it becomes a no-flux "natural" boundary condition.
I've tried
Code: Select all
MyVar= Variable Time; Real MATC "if(tx<3) 1"
But it crashes after Time=3.
I've also tried
Code: Select all
Variable Time; if ( tx<=3600 ) { MyVar = 1}
But I get following error:
ERROR:: Model Input:
ERROR:: Model Input: Unknown specifier: [if]
ERROR:: Model Input: In section: [boundary condition 1]
ERROR:: Model Input: For property name:[variable time]
Any ideas?
Thank you.
Kind regards,
Andrés
Re: Time dependent Boundary Conditions
Posted: 18 Jul 2016, 10:48
by mzenker
Hi,
It seems your variable is undefined after Time=3, so Elmer crashes.
How about
Code: Select all
MyVar = Variable Time; Real MATC "if (tx<3) 1; else 0;"
See MATC manual for more info.
HTH,
Matthias
Re: Time dependent Boundary Conditions
Posted: 18 Jul 2016, 19:48
by amrueda
Hi Matthias,
Thank you for your reply.
The thing is that I don't want to prescribe a "MyVar = 0" Dirichlet BC after Time = 3, but a no-flux boundary condition (natural BC), i.e. the simplest Neumann BC.
Such a no-flux boundary condition is accomplished naturally when no Dirichlet BC is prescribed, because the integrals over the boundary elements should be zero. That is why I need to prescribe the Dirichlet BC before Time = 3, and then somehow "release" this BC.
I've been thinking that I could restart the Simulation after Time = 3 and define different BCs in the new job.. But is there a simpler way?
Andrés
Re: Time dependent Boundary Conditions
Posted: 19 Jul 2016, 02:56
by raback
Hi Andrés
To any Dirichlet condition for "Varname" there is a related trigger which can turn it on/off called "Varname Condition". When this has positive value Dirichlet condition is active, when positive passive. So for your case,
Code: Select all
Temperature = 1.0
Temperature Condition = Variable Time
Real MATC "3.0001-tx"
-Peter