- Thank you received: 0
Viscosity in different subdomains
6 years 1 month ago #1194
by noname
Viscosity in different subdomains was created by noname
Hello everyone,
I have divided my domain into 2 sub-domains sucsessfully following the documentation.
With single domain I used to set a single value to a viscosity but now I want to define different viscosities in
different subdomains, anyone knows how to set this ?
Thanks in advance.
I have divided my domain into 2 sub-domains sucsessfully following the documentation.
With single domain I used to set a single value to a viscosity but now I want to define different viscosities in
different subdomains, anyone knows how to set this ?
Thanks in advance.
6 years 1 month ago #1195
by cwinters
Replied by cwinters on topic Viscosity in different subdomains
Hi,
you can use domain-wise coefficient functions by using as list of values/functions as argument of the CoefficientFunction.
I hope that's what you are looking for.
Best,
Christoph
you can use domain-wise coefficient functions by using as list of values/functions as argument of the CoefficientFunction.
Code:
from netgen.geom2d import SplineGeometry
geo = SplineGeometry()
geo.AddRectangle((0,0),(1,1),leftdomain=1,rightdomain=0)
geo.AddRectangle((0.3,0.3),(0.7,0.7),leftdomain=2,rightdomain=1)
from ngsolve import *
mesh = Mesh(geo.GenerateMesh(maxh=0.2))
Draw(mesh)
Draw(CoefficientFunction([1,2]),mesh,'cf')
I hope that's what you are looking for.
Best,
Christoph
Time to create page: 0.103 seconds