LinearForm and SymbolicLFI

More
5 years 4 months ago #1664 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?
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 am also interested in a unit of measurement of displacements, mm or m?
I hope you will help me, thank you!
More
5 years 4 months ago #1674 by mneunteufel
Hi LilBeng,

with
Code:
SymbolicLFI(force * v, definedon=grid_mesh.Boundaries('bottom'))
you apply a force with the density "force".

If you want to have a point load
Code:
SymbolicLFI(force * v, definedon=grid_mesh.BBoundaries('some_point'))
you could use an approximation of the Dirac Delta distribution
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)
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
The following user(s) said Thank You: LilBeng
More
5 years 4 months ago #1679 by LilBeng
Replied by LilBeng on topic LinearForm and SymbolicLFI
Thank you Michael!
Time to create page: 0.101 seconds