Time dependent Boundary Conditions

General discussion about Elmer
Post Reply
mdiazv64
Posts: 4
Joined: 26 Oct 2010, 19:52

Time dependent Boundary Conditions

Post by mdiazv64 » 26 Oct 2010, 20:06

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

Juha
Site Admin
Posts: 357
Joined: 21 Aug 2009, 15:11

Re: Time dependent Boundary Conditions

Post by Juha » 26 Oct 2010, 20:14

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

mdiazv64
Posts: 4
Joined: 26 Oct 2010, 19:52

Re: Time dependent Boundary Conditions

Post by mdiazv64 » 26 Oct 2010, 21:26

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

mdiazv64
Posts: 4
Joined: 26 Oct 2010, 19:52

Re: Time dependent Boundary Conditions

Post by mdiazv64 » 26 Oct 2010, 21:46

I think I understood now, the correct way is as follows:

Variable time
Real MATC "0.617*(tx<=3600)"

Juha
Site Admin
Posts: 357
Joined: 21 Aug 2009, 15:11

Re: Time dependent Boundary Conditions

Post by Juha » 27 Oct 2010, 06:38

Hi,

this should also work

Code: Select all

Variable time
  if ( time<=3600 ) { 0.617 } else { 0.0 }
Juha

Juha
Site Admin
Posts: 357
Joined: 21 Aug 2009, 15:11

Re: Time dependent Boundary Conditions

Post by Juha » 27 Oct 2010, 06:54

HI,

or rather

Code: Select all

Variable time
  if ( tx<=3600 ) ...
Juha

amrueda
Posts: 5
Joined: 19 Apr 2016, 02:43
Antispam: Yes
Location: Colombia

Re: Time dependent Boundary Conditions

Post by amrueda » 14 Jul 2016, 19:41

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

mzenker
Posts: 1967
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Time dependent Boundary Conditions

Post by mzenker » 18 Jul 2016, 10:48

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

amrueda
Posts: 5
Joined: 19 Apr 2016, 02:43
Antispam: Yes
Location: Colombia

Re: Time dependent Boundary Conditions

Post by amrueda » 18 Jul 2016, 19:48

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

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

Re: Time dependent Boundary Conditions

Post by raback » 19 Jul 2016, 02:56

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

Post Reply