variable Dirichlet boundary condition

General discussion about Elmer
Post Reply
fredi
Posts: 2
Joined: 05 Apr 2014, 18:55
Antispam: Yes

variable Dirichlet boundary condition

Post by fredi »

Hallo,

I'm a new Elmer user. After successful installation (Open Suse 12.1) I
tried to reproduce the examples in your tutorials (also successful).
Then I searched for examples which uses variable functions

u(x,y,z) restricted to the boundary surfaces (=no time dependencies)

for Dirichlet-Boundary Conditions. I did not found examples.

Is there anyone who can give me some help ?

Thank you.

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

Re: variable Dirichlet boundary condition

Post by mzenker »

Hi,

you can make your boundary condition depend on a cordinate, like in

Code: Select all

Boundary Condition 1
  Target Boundaries(1) = 3
  Name = "BoundaryCondition 1"
  Temperature = Variable Coordinate 1
        Real
        0  10
        1  20
        2  30
  End
End
If you need a dependency on more than one coordinate, you have to use MATC (or a FORTRAN user function, for the more advanced...):

Code: Select all

Boundary Condition 1
  Target Boundaries(1) = 3
  Name = "BoundaryCondition 1"
  Temperature = Variable Coordinate 1, Coordinate 2, Coordinate 3
        Real MATC "tx(0) + tx(1) + tx(2)"
End
tx(0), tx(1) and tx(2) are the first, second and third variables (here: Coordinate 1, Coordinate 2, Coordinate 3).

For more info, see Elmersolver Manual.

HTH,

Matthias
fredi
Posts: 2
Joined: 05 Apr 2014, 18:55
Antispam: Yes

Re: variable Dirichlet boundary condition

Post by fredi »

Hallo Matthias,

thank you very much for your help. I used the
MATC version with ''tx(0)+tx(1)+tx(2)'' and got
a result of Elmer and for me it seems correct.

But I want to be absolutely sure and the hints
in the Solver-manual (and MATC-manual) with
MATC background did not help me. Is the
following assumption correct if I try to program
the Temperature function

T(x,y,z) = x**2 + y**2 + z**2

then I have to use in MATC

(tx(0))^2 + (tx(1))^2 + (tx(2))^2

For you it is trivial, but if I put garbage in
I will get garbage out, my mistake and not Elmers.
Therefore I want to make sure whether my assumption
is correct or not.

Thank you for your help.

Best regards Fredi
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: variable Dirichlet boundary condition

Post by mzenker »

Hi,

with some delay due to Easter holidays:
Your MATC code seems correct to me.
You should be able to check in the output if the temperature comes out as expected.

HTH,

Matthias
Post Reply