- Thank you received: 0
LinearForm and SymbolicLFI
5 years 6 months ago #1664
by LilBeng
LinearForm and SymbolicLFI was created by LilBeng
Hi,
I'm trying to solve the problem of linear elasticity ( similar to this ), and then there is one question.
If I apply force to a line, is it considered distributed or concentrated? Do I need to divide the force components by the length of the line?
I am also interested in a unit of measurement of displacements, mm or m?
I hope you will help me, thank you!
I'm trying to solve the problem of linear elasticity ( similar to this ), and then there is one question.
If I apply force to a line, is it considered distributed or concentrated? Do I need to divide the force components by the length of the line?
Code:
def _stress(u, mu, lam, grid_mesh):
return 2 * mu * _epsilon(u) + lam * Trace(_epsilon(u)) * Id(grid_mesh.dim)
def _epsilon(u):
return 0.5 * (u.Deriv().trans + u.Deriv())
# length 'bottom' = 0.5
length = 0.5
force_1 = CoefficientFunction((0 / length, 100 / length))
coef_mu = [1 / 2 * (E[mat] / (1 + nu[mat])) for mat in grid_mesh.GetMaterials()]
coef_lam = [E[mat] * nu[mat] / ((1 + nu[mat]) * (1 - 2 * nu[mat])) for mat in grid_mesh.GetMaterials()]
solve_func = H1(grid_mesh, order=3, dirichlet='top', dim=grid_mesh.dim)
u, v = solve_func.TrialFunction(), solve_func.TestFunction()
mu = CoefficientFunction(coef_mu)
lam = CoefficientFunction(coef_lam)
bform = BilinearForm(solve_func)
bform += SymbolicBFI(2 * mu * InnerProduct(_epsilon(u), _epsilon(v)) + lam * Trace(u.Deriv()) * Trace(v.Deriv()))
lform = LinearForm(solve_func)
lform += SymbolicLFI(force_1 * v, definedon=grid_mesh.Boundaries('bottom'))
bform.Assemble()
lform.Assemble()
grid = GridFunction(solve_func, name='grid_1')
grid.vec.data = bform.mat.Inverse(solve_func.FreeDofs()) * lform.vec
displacement = grid
deformation = _epsilon(grid)
stress = _stress(grid, mu, lam, grid_mesh)
Draw(displacement)
I hope you will help me, thank you!
- mneunteufel
- Offline
- Premium Member
Less
More
- Thank you received: 59
5 years 5 months ago #1674
by mneunteufel
Replied by mneunteufel on topic LinearForm and SymbolicLFI
Hi LilBeng,
with
you apply a force with the density "force".
If you want to have a point load
you could use an approximation of the
Dirac Delta distribution
For a gravity force you would write
without dividing through the area.
NGSolve does not use units internally. If you define a rectangle with L=2, W=1 then the resulting displacement has the same "unit" as L.
I would recommend using SI units ( L=2m), non-dimensionalize the equation or compute the resulting units on paper before.
I hope this answers your questions.
Best
Michael
with
Code:
SymbolicLFI(force * v, definedon=grid_mesh.Boundaries('bottom'))
If you want to have a point load
Code:
SymbolicLFI(force * v, definedon=grid_mesh.BBoundaries('some_point'))
Code:
SymbolicLFI(approx_delta_eps * v, definedon=grid_mesh.Boundaries('bottom'), bonus_intorder=8)
For a gravity force you would write
Code:
SymbolicLFI(9.81 * v)
NGSolve does not use units internally. If you define a rectangle with L=2, W=1 then the resulting displacement has the same "unit" as L.
I would recommend using SI units ( L=2m), non-dimensionalize the equation or compute the resulting units on paper before.
I hope this answers your questions.
Best
Michael
The following user(s) said Thank You: LilBeng
Time to create page: 0.102 seconds