Evaluating stress for the piezo coupling
I have been doing some modeling of a piezoelectric system and it works well. One can apply a field and see the resulting deformation. I also get how one can calculate the Cauchy strain and stress using the post-process hook and the terms 'ev_cauchy_strain.2.Omega(u)' and 'ev_cauchy_stress.2.Omega(solid.D, u)'. But since the constitutive law for the stress is the Cauchy term + the piezo-coupling term, how does one evaluate the stress and output it for given displacements and fields?
Dennis
Hi Dennis,
the piezo term can be used (IIRC) directly in post-processing to compute the piezo-part of the stress - try passing mode='el_avg' into problem.evaluate().
r.
On 08/05/2015 03:11 PM, Dennis Perchak wrote:
I have been doing some modeling of a piezoelectric system and it works well. One can apply a field and see the resulting deformation. I also get how one can calculate the Cauchy strain and stress using the post-process hook and the terms 'ev_cauchy_strain.2.Omega(u)' and 'ev_cauchy_stress.2.Omega(solid.D, u)'. But since the constitutive law for the stress is the Cauchy term + the piezo-coupling term, how does one evaluate the stress and output it for given displacements and fields?
Dennis
Hi Robert,
I think I tried that. I modified your function for stress-strain as
def stress_strain(out, pb, state, extend=False):
"""
Calculate and output strain and stress for given displacements.
"""
from sfepy.base.base import Struct
import matplotlib.pyplot as plt
import matplotlib.font_manager as fm
ev = pb.evaluate
strain = ev('ev_cauchy_strain.2.Omega(u)', mode='el_avg')
stress = ev('ev_cauchy_stress.2.Omega(solid.D, u)', mode='el_avg')
pstress = ev('dw_piezo_coupling.2.Omega( solid.coupling, u, psi )', mode='el_avg')
out['cauchy_strain'] = Struct(name='output_data', mode='cell',
data=strain, dofs=None)
out['cauchy_stress'] = Struct(name='output_data', mode='cell',
data=stress, dofs=None)
out['piezo_stress'] = Struct(name='output_data', mode='cell',
data=pstress, dofs=None)
etc....
and it returned an error of "ValueError: unsupported evaluation mode in dw_piezo_coupling! (el_avg)"
Dennis
On Thursday, August 6, 2015 at 1:21:50 PM UTC-7, Robert Cimrman wrote:
Hi Dennis,
the piezo term can be used (IIRC) directly in post-processing to compute the piezo-part of the stress - try passing mode='el_avg' into problem.evaluate().
r.
I have been doing some modeling of a piezoelectric system and it works well. One can apply a field and see the resulting deformation. I also get how one can calculate the Cauchy strain and stress using the
On 08/05/2015 03:11 PM, Dennis Perchak wrote: post-process
hook and the terms 'ev_cauchy_strain.2.Omega(u)' and 'ev_cauchy_stress.2.Omega(solid.D, u)'. But since the constitutive law for the stress is the Cauchy term + the piezo-coupling term, how does one evaluate the stress and output it for given displacements and fields?
Dennis
Hi Dennis,
On 08/11/2015 04:36 PM, Dennis Perchak wrote:
Hi Robert,
I think I tried that. I modified your function for stress-strain as
def stress_strain(out, pb, state, extend=False):
"""
Calculate and output strain and stress for given displacements.
"""
from sfepy.base.base import Struct
import matplotlib.pyplot as plt
import matplotlib.font_manager as fm
ev = pb.evaluate
strain = ev('ev_cauchy_strain.2.Omega(u)', mode='el_avg')
stress = ev('ev_cauchy_stress.2.Omega(solid.D, u)', mode='el_avg')
pstress = ev('dw_piezo_coupling.2.Omega( solid.coupling, u, psi )', mode='el_avg')
out['cauchy_strain'] = Struct(name='output_data', mode='cell',
data=strain, dofs=None)
out['cauchy_stress'] = Struct(name='output_data', mode='cell',
data=stress, dofs=None)
out['piezo_stress'] = Struct(name='output_data', mode='cell',
data=pstress, dofs=None)
etc....
and it returned an error of "ValueError: unsupported evaluation mode in dw_piezo_coupling! (el_avg)"
You are right, sorry for misleading you. I was looking too briefly at the term.
I will implement that soon(ish) - it should definitely be possible.
r.
Hi Robert,
Thanks for the response. And for making the code.
Dennis
On Wednesday, August 5, 2015 at 6:11:30 AM UTC-7, Dennis Perchak wrote:
I have been doing some modeling of a piezoelectric system and it works well. One can apply a field and see the resulting deformation. I also get how one can calculate the Cauchy strain and stress using the post-process hook and the terms 'ev_cauchy_strain.2.Omega(u)' and 'ev_cauchy_stress.2.Omega(solid.D, u)'. But since the constitutive law for the stress is the Cauchy term + the piezo-coupling term, how does one evaluate the stress and output it for given displacements and fields?
Dennis
Hi Dennis,
could you try [1], if it does what you need? See the updated examples/multi_physics/piezo_elasticity.py example.
r.
[1] https://github.com/rc/sfepy
On 08/12/2015 01:15 AM, Dennis Perchak wrote:
Hi Robert,
Thanks for the response. And for making the code.
Dennis
On Wednesday, August 5, 2015 at 6:11:30 AM UTC-7, Dennis Perchak wrote:
I have been doing some modeling of a piezoelectric system and it works well. One can apply a field and see the resulting deformation. I also get how one can calculate the Cauchy strain and stress using the post-process hook and the terms 'ev_cauchy_strain.2.Omega(u)' and 'ev_cauchy_stress.2.Omega(solid.D, u)'. But since the constitutive law for the stress is the Cauchy term + the piezo-coupling term, how does one evaluate the stress and output it for given displacements and fields?
Dennis
Hi Robert,
Sorry for being slow to get back to this but I was busy on another project and then since I was using the version of SfePy that comes with the Enthought Canopy distribution I had to install the version you pointed me to and it took a bit to get everything to compile and work on my Mac. But I got it to work and the updated version with evaluating the piezo stress works. I have a simple test that I found in someone's thesis. If one has a material of large extent in the x and y directions compared to the z directions, then it will behave somewhat like a 1D system. In that case, if one sets phi on the bottom to be zero and some value on the top, then the strain that will arise due to the resulting field (Ez = -(phi_top - phi_bot)/dz can be estimated from the fact that the stress is zero. Thus, the strain eps_zz = (e_zz/C_zz)*E_z where e and C are the piezo and elastic constants. And this is in fact what happens when you do this in SfePy.
Thanks for adding this to the code.
Another quick question if you don't mind. When using probes, is there a way to output the coordinate values of the probe positions rather than plot the probe values versus (essentially) the index number of the probe?
Thanks again.
Dennis
On Wednesday, August 5, 2015 at 6:11:30 AM UTC-7, Dennis Perchak wrote:
I have been doing some modeling of a piezoelectric system and it works well. One can apply a field and see the resulting deformation. I also get how one can calculate the Cauchy strain and stress using the post-process hook and the terms 'ev_cauchy_strain.2.Omega(u)' and 'ev_cauchy_stress.2.Omega(solid.D, u)'. But since the constitutive law for the stress is the Cauchy term + the piezo-coupling term, how does one evaluate the stress and output it for given displacements and fields?
Dennis
Hi Dennis,
On 08/18/2015 01:45 PM, Dennis Perchak wrote:
Hi Robert,
Sorry for being slow to get back to this but I was busy on another project and then since I was using the version of SfePy that comes with the Enthought Canopy distribution I had to install the version you pointed me to and it took a bit to get everything to compile and work on my Mac. But I got it to work and the updated version with evaluating the piezo stress works. I have a simple test that I found in someone's thesis. If one has a material of large extent in the x and y directions compared to the z directions, then it will behave somewhat like a 1D system. In that case, if one sets phi on the bottom to be zero and some value on the top, then the strain that will arise due to the resulting field (Ez = -(phi_top - phi_bot)/dz can be estimated from the fact that the stress is zero. Thus, the strain eps_zz = (e_zz/C_zz)*E_z where e and C are the piezo and elastic constants. And this is in fact what happens when you do this in SfePy.
Good that it works.
Thanks for adding this to the code.
Another quick question if you don't mind. When using probes, is there a way to output the coordinate values of the probe positions rather than plot the probe values versus (essentially) the index number of the probe?
Not currently, but it will be easy to add - seems like a useful feature to have.
r.
On 08/18/2015 04:40 PM, Robert Cimrman wrote:
On 08/18/2015 01:45 PM, Dennis Perchak wrote:
Another quick question if you don't mind. When using probes, is there a way to output the coordinate values of the probe positions rather than plot the probe values versus (essentially) the index number of the probe?
Not currently, but it will be easy to add - seems like a useful feature to have.
Try [1] - there is a new ret_points
argument to probe call:
pars, points, vals = probe(var, mode='val', ret_points=True)
The VTK probes have been updated as well.
r. [1] https://github.com/rc/sfepy
participants (2)
-
Dennis Perchak
-
Robert Cimrman