How to exert boundary conditions for a Gmsh domain

Asked by Zheng

Hi all,

In my simulation, I imported a Gmsh file into my Escript code using:

mydomain = ReadGmsh('domain.msh',numDim=dim,integrationOrder=2)

In the ''domain.msh", because the surface is curved and it's hard to define the boundary condition directly using FunctionOnBoundary() command. Instead, I have defined several physical group (surface) named 'top', 'bottom' in the Gmsh mesh, as below:

$MeshFormat
2.2 0 8
$EndMeshFormat
$PhysicalNames
4
1 1 "top"
1 3 "slope"
1 4 "bottom"
1 5 "side"
$EndPhysicalNames
$Nodes
703
1 0 0 0
2 0 2 0
3 0 5 0
......

The question is how to exert a designated boundary conditions on surface 'top' and 'bottom'?

Thanks so much.

Best regards,
Zheng

Question information

Language:
English Edit question
Status:
Solved
For:
esys-escript Edit question
Assignee:
No assignee Edit question
Solved by:
Lutz Gross
Solved:
Last query:
Last reply:
Revision history for this message
Lutz Gross (l-gross) said :
#1

It depends on the type boundary conditions you want to define.
For Neumann style conditions you need to set 'y' in the LinearPDE class. If you want to set 'y' to zero on the `top` and `side` of your domain you use tagging:

s=Scalar(0., FunctionOnBoundary(mydomain )
s.setTaggedValue('top', -3564)
s.setTaggedValue('side', 18)

which - assuming you solving a Poisson type equation - would set the normal derivative at `top' to -3564 and `side` 18 while all other faces would get the value 0 as set in the `Scalar` statement above.

For Dirichlet conditions, I refer you to this question: https://answers.launchpad.net/escript-finley/+question/695201.

Revision history for this message
Zheng (zhengdem) said :
#2

Thanks. What if I want to exert a vertical pressure on the 'top' boundary, which seems to be the Neumann boundary.

If I use 'whereZero'..., I would set: uNbc = whereZero(bx[1]-ly)*[0,confining]

If I use the tagger 'top' boundary, what should I do?

I have tried:

mydomain = ReadGmsh('domain.msh',numDim=2,integrationOrder=2)
topsurf = MaskFromBoundaryTag(mydomain, "top")
uNbc = topsurf*[0,confining]

Though no error is reported, but the vertical pressure is not exerted correctly according to the results.

Thanks,
Zheng

Revision history for this message
Lutz Gross (l-gross) said :
#3

Difficult to say ...
do you do pde.setValue( y=uNbc) ?

Revision history for this message
Zheng (zhengdem) said :
#4

Yes, I have used pde.setValue( y=uNbc) to set the pressure boundary.

I understand that for Dirichlet boundary, the 'MaskFromBoundaryTag' should work, e.g. displacement, according to this question: https://answers.launchpad.net/escript-finley/+question/695201.

In my case, I want to exert a vertical surcharge on the ‘top‘ surface of the domain. Would the same operation in Dirichlet boundary still work for the Neumann boundary conditions?

Thanks,
Zheng

Revision history for this message
Best Lutz Gross (l-gross) said :
#5

you probably want to do this:

m=Scalar(0., FunctionOnBoundary(mydomain ))
m.setTaggetValue("top", 1)
y=m*confining*mydomain.getNormal()

the m makes sure that the normal pressure is applied on the top only.

Revision history for this message
Zheng (zhengdem) said :
#6

Thanks Lutz Gross, that solved my question.