- Thank you received: 24
Slip boundary conditions
5 years 10 months ago #1978
by hvwahl
Slip boundary conditions was created by hvwahl
Hi everyone,
is there "automatic" way to enable free-slip boundary conditions on one boundary and Dirichlet on another using the VectorH1 space?
Alternatives would of course to be a separate H1 space for each component each with different Dirichlet flags like here , using Nitsche to enforce the Dirichlet on only one component or to manually set the freedofs array like here .
Best wishes,
Henry
is there "automatic" way to enable free-slip boundary conditions on one boundary and Dirichlet on another using the VectorH1 space?
Alternatives would of course to be a separate H1 space for each component each with different Dirichlet flags like here , using Nitsche to enforce the Dirichlet on only one component or to manually set the freedofs array like here .
Best wishes,
Henry
- Guosheng Fu
-
- Offline
- Elite Member
-
Less
More
- Thank you received: 6
5 years 10 months ago #1979
by Guosheng Fu
Replied by Guosheng Fu on topic Slip boundary conditions
There is a "manual" way, which is pretty good.
See the post
ngsolve.org/forum/ngspy-forum/846-bounda...-vector-valued-funcs
See the post
ngsolve.org/forum/ngspy-forum/846-bounda...-vector-valued-funcs
- Guosheng Fu
-
- Offline
- Elite Member
-
Less
More
- Thank you received: 6
5 years 10 months ago #1980
by Guosheng Fu
Replied by Guosheng Fu on topic Slip boundary conditions
Here is a snipplet that works for me:
Code:
V = VectorH1(mesh, order = 3)
Q = H1(mesh,order=2)
X = FESpace([V,Q])
freedofs = X.FreeDofs()
fesx,fesy = V.components
for el in fesx.Elements(BND):
if (el.mat=="dir"):
for dof in el.dofs:
freedofs.Clear(dof)
freedofs.Clear(fesx.ndof+dof) # y-component
if (el.mat=="neu"):
for dof in el.dofs:
freedofs.Clear(dof)
if (el.mat == "wall" or el.mat =="inlet" or el.mat =="outlet"):
for dof in el.dofs:
freedofs.Clear(fesx.ndof+dof) # y-component
5 years 10 months ago #1981
by hvwahl
Replied by hvwahl on topic Slip boundary conditions
Hi Guosheng,
thank for your help! I was was hoping to avoid a loop over the elements, as I have to update the freedofs array in every time-step, but your way is probably still the best.
Best wishes, Henry
thank for your help! I was was hoping to avoid a loop over the elements, as I have to update the freedofs array in every time-step, but your way is probably still the best.
Best wishes, Henry
- christopher
-
- Offline
- Administrator
-
Less
More
- Thank you received: 101
5 years 10 months ago #1982
by christopher
Replied by christopher on topic Slip boundary conditions
What is your criteria for selecting fixed dofs in each time step?
5 years 10 months ago #1987
by hvwahl
Replied by hvwahl on topic Slip boundary conditions
Hi Christopher,
within the bulk, the dofs are selected with element markers obtained via a level-set function (which changes in each time-step). The mesh boundary dofs will stay the same in each time-step.
Best wishes, Henry
within the bulk, the dofs are selected with element markers obtained via a level-set function (which changes in each time-step). The mesh boundary dofs will stay the same in each time-step.
Best wishes, Henry
Time to create page: 0.147 seconds