A steel parallelepiped with a square cross-section fits exactly into the cavity. it's loaded from the top surface(see picture). how can I calculate the stress in X- and Y-direction if the strain in X- and Y-direction is zero.
Not sure exactly what you mean, but from what I can see:
In your first picture, there is a contact between the red and grey block (that is the appropriate boundary condition).
Once you load the red block on top, with the contacts (e.g., frictional) assigned (and some support/fixed, for the gray part so it does not move freely), you will be able to see stresses along different directions (say SXX or SYY,...).
Yeah, that's what I meant.
I have to calculate the stresses in X, Y and Z directions.
can you please confirm whether you can calculate the stresses in X- ; Y- and Z-directions with these equations?
According to the elasticity constitutive relation, stress_vector = C_matrix * strain_vector, where the vector has a size of 6, and C_matrix is the stiffness with the size of 6x6.
If your material is isotropic and linear elastic, both strain_x and strain_y are zero. To determine the stress_x and stress_y, you only need to know C13, C23, and strain_Z.