### Compute a normal stress to a surface

148
views
0
12 weeks ago by
I have a domain as attached, and I want to calculate a normal component of far-field stresses that act on a line (surface). I am not sure the following code is a correct way to do it or not because as I understand this code will compute all the dot product between f_stress and normal vector but what we want is to calculate the dot product between f_stress and the normal vector of the line only? Do you have any recommendations?

from dolfin import *
import matplotlib.pyplot as plt
import time
import os

os.system('dolfin-convert test2_1fr_rev00.msh test.xml')

mesh = Mesh("test.xml")

n = FacetNormal(mesh)

f_stress = Constant((24.e6, 32.e6))

n_f_stress = dot(f_stress, n)​

Sorry for a non-informative post the mesh is defined as follows:

// Characteristic size
Lm = 0.1;

// Size of the block (m)
Lx = 0.199;
Ly = 0.1;

// Fracture aperture (0.025cm)
fa = 2.5e-5;

// Density of mesh near Points
lcf = fa;

lcm = Lm/5;

// Geometrical entities = 1d and 2D regions indices
// #2D_REGIONS
MATRIX = 500;
// #2D_REGIONS

// #1D_REGIONS
LEFT = 1;
RIGHT = 2;
BOTTOM = 3;
TOP = 4;
OPEN_FRACTURES = 777;
CLOSED_FRACTURES = 778;
// #1D_REGIONS

// Points
Point(1) = {0,  0, 0, lcm};
Point(2) = {Lx, 0, 0, lcm};
Point(3) = {Lx,  Ly, 0, lcm};
Point(4) = {0,  Ly, 0, lcm};
Point(5) = {0.04,  0.08, 0, lcm};
Point(6) = {0.16,  0.02, 0, lcm};

// Define the bounded domains
Line(501) = {1, 2};
Line(502) = {2, 3};
Line(503) = {3, 4};
Line(504) = {4, 1};
Line(505) = {5, 6};

Line Loop(600) = {501, 502, 503, 504};
Plane Surface(600) = {600};

Line{505} In Surface {600};	// To include the faults in the triangulation

// Gradual mesh refinement starting from BOTTOM_FRAC
Field[1] = Attractor;
Field[1].NNodesByEdge = 10;
Field[1].EdgesList = {505};
//Field[1].EdgesList = {507, 505, 506, 504, 503, 508, 501, 502};

Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = 50 * fa;	// lcf
Field[2].LcMax = lcm;
Field[2].DistMin = fa;
Field[2].DistMax = Lm;

Background Field = 2;

Physical Line(LEFT) = {504};
Physical Line(RIGHT) = {502};
Physical Line(TOP) = {503};
Physical Line(BOTTOM) = {501};

Physical Line(OPEN_FRACTURES) = {505};

Physical Surface(MATRIX) = {600};
​

This script will produce the mesh as attached picture.

Model geometry is attached as follows:

In this model, we have two far-field stresses - stress_x and stress_y, we want to find the normal component of these stress that acts on the line, stress_n.

Community: FEniCS Project

1) there is no mesh
2) dx, ds and dS are not used
3) V and W are not used
4) it is not cleat what is the meaning of your plot
5) more importantly "does not work" means nothing, as none can reproduce your example Why? because your Minimal Working Example (WME) is not working;
6) none can read your mind and understand why what you get (and, mind you, we do not know from your post what you get, be it an error message, a wrong answer, or a new kind of cold fusion that occurs only when the moon is aligned with Saturn) means that the code "does not work", whatever the meaning of "does not work" may be.
written 12 weeks ago by Marco Morandini
written 12 weeks ago by Teeratorn Kadeethum
What is difficult to understand in this sentence

"It must be possible to take the MWE, paste it into a file and run it, without any extra modifications.
Good MWEs can be as little as 10 lines of code.
if you can remove a line of code from your MWE and still show your problem, then you don't have an MWE!"

and in

"Post the full error message created by your MWE."

?
written 12 weeks ago by Marco Morandini
Hello: I removed the un-used line from the code. There is no error message but what I want to ask is I am not sure the following code is a correct way to do it or not because as I understand this code will compute all the dot product between f_stress and normal vector but what we want is to calculate the dot product between f_stress and the normal vector of the line only?

Thank you for your help and sorry for any inconveniences.
written 12 weeks ago by Teeratorn Kadeethum
Note that you have still not provided any MWE; however, now we have at least a question.

The dot product is not computing anything, it's simply defining what to compute if - and when - you'll use n_f_stress in a form. If the integral domain will be the line then the dot product will be evaluated only on the line.
written 12 weeks ago by Marco Morandini
written 12 weeks ago by Teeratorn Kadeethum