1 Introduction

In the present contribution, we develop a multiscale model for cancellous bone taking mechanical, electric and magnetic effects into account. An important application of this model is the early detection of osteoporosis. This bone disease reduces the mass density of the bone, making it thinner and weaker, increasing the likelihood of fractures. Sonography is used as a cheap, fast and non-invasive early detection technique for osteoporosis (Kaufman et al. 2008). Material modeling and numerical simulations are helpful tools in order to understand and evaluate experimental measurements and enable medical diagnostics based on this method.

Bone is a composite material with impressive properties, drawing the interest of researchers of many different fields. As a material, it is very strong and stiff and has a high fracture toughness, while also maintaining a light weight (Hamed et al. 2010). Thus in recent decades, a lot of different approaches to investigate and simulate the material behavior of bone have appeared. Many analytical solutions are based on Biot’s famous theory (Biot 1956a, b). Examples include (Buchanan and Gilbert 2007; Chen et al. 2018; Steeb 2010). Here, cortical bone is modeled as a solid, while bone marrow is assumed to be a fluid. The acoustic properties of bone material are then used to obtain mechanical material parameters of bone and the parameters of Biot’s model. Additionally, the results are compared with the findings of experiments.

In contrast to the analytical solutions, many numerical approaches exist in the scope of bone modeling as well. The finite difference method was used in Kaufman et al. (2008) to obtain numerical results of ultrasound propagation in bone. Applications of the finite element method (FEM) on the topic of bone modeling include the simulation of mechanical properties of bone (Gardner et al. 2000; Miller et al. 2002) and the simulation of osteogenic effects (Wang et al. 2017). In Christen et al. (2010), patient-specific FEM simulations are proposed in order to estimate the likelihood of osteoporotic fractures.

Since the bone microstructure is very complex and heterogenous, material modeling should take place on different scales. Currently used single-scale models are criticized in Christen et al. (2010) as oversimplified and multiscale approaches are proposed instead. In Hamed et al. (2010), the mechanical properties of bone are modeled on five different length scales from the nanoscale to the macroscale. Multiscale approaches can also be combined with numerical methods. The finite element square method (\(\text {FE}^2\)) extends the standard FEM approach by applying the multiscale concept and solving the differential equation systems on two scales via the FEM. An overview of the method can be found in Schröder (2000); Schröder and Hackl (2013). Basic works on this method include for example (Willis 1981; Suquet 1987; Castañeda and Suquet 1997) and applications to different materials can be found for example in Ilić and Hackl (2004); Miehe et al. (2002). An application of the \(\text {FE}^2\) within the scope of bone modeling can be found in Ural and Mischinski (2013); Podshivalov et al. (2011); Pahr and Zysset (2008), proposing different models to capture the microstructure of bone, allowing to investigate mechanical effects. In Ilic et al. (2010) and Klinge et al. (2013), macroscopic material parameters were recovered by simulations on the microscale. The results obtained were subsequently used for macroscale simulations of wave propagation.

So far, all presented contributions focus only on the mechanical effects of bone. However, cortical bone possesses the properties of a piezoelectric solid. After the discovery of this effect (Fukada and Yasuda 1957; Shamos et al. 1963), research considering these coupled physical effects has started. A review on computer modeling of bone piezoelectricity can be found in Mohammadkhah et al. (2019). There, applications are discussed as well. Since electric and magnetic effects are coupled physically via the Maxwell equations, it may be necessary to include magnetic effects as well. In Güzelsu and Saha (1981), bone was modeled as a hollow cylinder and analytical solutions of the coupled equations of all three effects were studied. The results were then compared to in vitro experimental measurements.

In this work, we present a fully coupled multiscale approach for modeling cancellous bone considering mechanical, electric and magnetic effects and using two scales, the macro- and microscale. At the microscale, we assume a heterogenous material consisting of two phases, cortical bone and bone marrow. Cortical bone is modeled as piezoelectric, insulating solid, bone marrow as viscoelastic, conducting solid. Electric and magnetic effects are coupled via the Maxwell equations. Based on energy methods in mechanics, we establish a thermodynamically consistent material model and derive the weak and strong form of the corresponding boundary value problem. We apply the FEM to solve the problem numerically. For multiscale analysis, we resort to the \(\text {FE}^2\) method. To apply this method, we constructed a periodic representative volume element (RVE) and discuss the transition between scales.

The article is structured as follows: in Sect. 2 we discuss the material structure of cancellous bone and the \(\text {FE}^2\) method. Then, we introduce the microscopic material model and derive the weak and strong form of the corresponding variational problem. Additionally, we cover the macroscale boundary value problem. In Sect. 3 we present the FEM implementation of the model and show details regarding scale transition and programming. In Sect. 4 we present numerical results, starting with microscale calculations, on to multiscale simulations for a cylindrical body and finally a true to scale model of a human femur bone. To close this article, we draw a short conclusion and give an outlook to future research envisioned in Sect. 5.

2 Material model

2.1 Structure and properties of cancellous bone

Our work focuses on the description of the internal structure of cancellous (spongy) bone, which consists of small beams or shells of interconnected cortical bone and interstitial bone marrow. Cortical bone is mainly composed of elastic collagen fibers, which act as charge carriers. When applying a shear stress, these collagen fibers slip past each other, thus producing a piezoelectric effect. This was first measured in Fukada and Yasuda (1957) and later validated in Shamos et al. (1963). This means that, whenever a mechanical strain is present in the bone, an electric field is generated due to the piezoelectric effect. A time-dependent fluctuation of the electric field then creates a magnetic field due to Ampère’s circuital law, coupling mechanical, electric and magnetic effects all together.

An important application of bone modeling is the early detection of osteoporosis, a bone disease, which manifests itself in the reduction of the cortical bone phase, thus reducing the strength of the bone and increasing the likelihood of fractures. Compared to a healthy bone, the volume fraction of cortical bone for an affected bone can be reduced from 30 to \(5\%\) (Steeb 2010; Ilic et al. 2010). Figure 1 shows a comparison depending on the osteoporosis stage and illustrates the heterogeneity of the material. During the course of osteoporosis, the cortical bone (represented brighter) reduces and is replaced by bone marrow (represented in dark). Thus, we will employ different RVEs for the simulations. Here, the cortical bone phase is represented in gray, while the bone marrow phase is drawn in transparent red color.

Fig. 1
figure 1

Bone phases depending on osteoporosis stage (cf. Laboratoires 2019) and corresponding RVEs

Early detection of osteoporosis can be done via sonography: ultrasonic waves enter the bone and due to the described effects create a magnetic field, which can be measured (Güzelsu and Saha 1981) and—depending on the results—conclusions on the health status of the investigated bone can be drawn. In this contribution, we introduce a material model including all the described effects. It is important to note, that there are two different forms of coupling: while the piezoelectric coupling is captured via a suitable material model, the Maxwell coupling is of physical (electrodynamical) nature.

2.2 Concept of the \(\text {FE}^2\) method

To include micro-heterogeneities directly, an extremely fine resolution of the problem would be necessary, resulting in a very high computation cost for the simulations. Alternatively, the \(\text {FE}^2\) method is a homogenization technique, which captures the structure of micro-heterogeneities by introducing a second—smaller—scale to the problem. If the material is statistically regular on the smaller scale, it can be modeled by a corresponding RVE (Schröder 2000; Schröder and Hackl 2013). In this paper, we denote the larger scale as the macroscale and the smaller scale as the microscale. To obtain accurate results, the quotient of the characteristic lengths between micro- and macroscale should tend to zero, so the RVE has to be much smaller than the simulated macroscopic body. Figure 2 illustrates this procedure: instead of using a material model on the macroscale, the state variables are linked to the microscale, where the RVE problem is solved. The microscale calculations yield average flux quantities and consistent tangent matrices, which then can be used for the solution of the macroscale problem, replacing a macroscopic material model.

Fig. 2
figure 2

Transition between macro- and microscale. State variables enter as boundary conditions of the RVE problem. Flux quantities at the macroscale are calculated by averaging the RVE quantities

We denote spatial coordinates on the macroscale by \({\mathbf {x}}\) and on the microscale by \({\mathbf {y}}\). Quantities denoted as \(\overline{(\cdot )}\) are affiliated to the macroscale. The transition between the scales regarding energy conservation and numerical treatment is discussed in Sect. 3.2.

2.3 Variational formulation of the microscale problem

The domain \(\varOmega := \varOmega _{{\mathbf {y}}}\), representing the RVE of the micro-problem, is split into a cortical bone part \(\varOmega _\mathrm {b}\) and a bone marrow part \(\varOmega _\mathrm {m}\). For any quantity, the indices \((\cdot )_\mathrm {m}\) and \((\cdot )_\mathrm {b}\) are used to denote the affiliation to each phase. If no index is present, the quantity or equation is valid for both phases. We employ the following thermodynamic energy functional at the microscale:

$$\begin{aligned} \varPi&= \int \limits _{\varOmega _\mathrm {b}} \varPsi _{\mathrm {b}}(\varvec{\varepsilon },{\mathbf {E}},{\mathbf {B}}) \;\!\mathrm {d}V + \int \limits _{\varOmega _\mathrm {m}} \varPsi _{\mathrm {m}}(\varvec{\varepsilon },\varvec{\varepsilon }^i,{\mathbf {E}},{\mathbf {B}}) + {\mathcal {C}}\;\!\mathrm {d}V \nonumber \\&+ \int \limits _{\varOmega _\mathrm {m}} \int \limits _{t} \varDelta ({\dot{\varvec{\varepsilon }}}^i,{\dot{{\mathbf {A}}}}) \;\!\mathrm {d}t \;\!\mathrm {d}V + \int \limits _{\varOmega } \varPsi _{\mathrm {g}}(\nabla \cdot {\mathbf {A}}) \;\!\mathrm {d}V - W_{\mathrm {ext}} \; \text {.} \end{aligned}$$
(1)

The functional contains the energy densities \(\varPsi _{\mathrm {b}}\) and \(\varPsi _{\mathrm {m}}\) of both phases, a volume constraint \({\mathcal {C}}\), dissipation and gauge functionals (\(\varDelta\) and \(\varPsi _{\mathrm {g}}\)) and the potential of the generalized external forces \(W_{\mathrm {ext}}\). The main variables of the problem are then the mechanical displacements \({\mathbf {u}}\), the electric scalar potential \(\varphi\) and the magnetic vector potential \({\mathbf {A}}\), yielding seven unknown variables for the three-dimensional model. The state variables are the mechanical strain \(\varvec{\varepsilon }\), the electric field \({\mathbf {E}}\) and the magnetic flux density \({\mathbf {B}}\), calculated as

$$\begin{aligned} \varvec{\varepsilon }= \frac{1}{2} \; (\nabla {\mathbf {u}}+ \nabla ^T {\mathbf {u}}) \; \text {,} \; {\mathbf {E}}= - \nabla \varphi - {\dot{{\mathbf {A}}}} \; \text {and} \; {\mathbf {B}}= \nabla \times {\mathbf {A}}\; \text {.} \end{aligned}$$
(2)

This way, two of the four Maxwell equations are already satisfied:

$$\begin{aligned} \nabla \times {\mathbf {E}}= & \nabla \times (- \nabla \varphi - {\dot{{\mathbf {A}}}}) = -{\dot{{\mathbf {B}}}} \quad \text {and} \nonumber \\ \nabla \cdot {\mathbf {B}}= & \nabla \cdot (\nabla \times {\mathbf {A}}) = {\varvec{0}}\; \text {.} \end{aligned}$$
(3)

For the mechanical strain, we use Voigt’s notation (Mehrabadi and Cowin 1990) as

$$\begin{aligned} \varvec{\varepsilon }= \begin{pmatrix} \varepsilon _{xx}&\varepsilon _{yy}&\varepsilon _{zz}&2 \; \varepsilon _{xy}&2 \; \varepsilon _{yz}&2 \; \varepsilon _{xz} \end{pmatrix}^T \; \text {.} \end{aligned}$$
(4)

Then, the energy densities for both phases are

$$\begin{aligned} \varPsi _\mathrm {b}= & \frac{1}{2} \bigl ( \varvec{\varepsilon }\cdot {\mathbb {C}}_\mathrm {b} \cdot \varvec{\varepsilon }- {\mathbf {E}}\cdot \varvec{\xi }_\mathrm {b} \cdot {\mathbf {E}}+ {\mathbf {B}}\cdot \varvec{\mu }_\mathrm {b}^{-1} \cdot {\mathbf {B}}\bigr ) \nonumber \\&- {\mathbf {e}}_\mathrm {b} \cdot \varvec{\varepsilon }\cdot {\mathbf {E}}\quad \text {and} \nonumber \\ \varPsi _\mathrm {m}= & \frac{1}{2} \bigl ( (\varvec{\varepsilon }-\varvec{\varepsilon }^i) \cdot {\mathbb {C}}_\mathrm {m} \cdot (\varvec{\varepsilon }-\varvec{\varepsilon }^i) - {\mathbf {E}}\cdot \varvec{\xi }_\mathrm {m} \cdot {\mathbf {E}}\nonumber \\&+ {\mathbf {B}}\cdot \varvec{\mu }_\mathrm {m}^{-1} \cdot {\mathbf {B}}\bigr ) \; \text {,} \end{aligned}$$
(5)

consisting of quadratic energies for mechanical, electric and magnetic effects, resulting in a linear problem. We include a piezoelectric energy term for the cortical bone phase. For the bone marrow phase, an inelastic strain \(\varvec{\varepsilon }^i\) is introduced. Here, \({\mathbb {C}}\) is the mechanical stiffness tensor, \(\varvec{\xi }\) is the permittivity tensor, \(\varvec{\mu }^{-1}\) is the inverse permeability tensor and \({\mathbf {e}}_\mathrm {b}\) is the piezoelectric tensor. While it is possible to switch between state and flux variables via a Legendre transformation, the present formulation proves as the most suitable for our model, as it allows an easy inclusion of the Maxwell coupling and the electric dissipation. For linear problems, the transformation would change an extremal into a saddle point problem, thus excluding solvers, that require positive definiteness of the system matrix as a precondition. The constraint function reads

$$\begin{aligned} {\mathcal {C}}= \lambda \; \mathrm {tr}(\varvec{\varepsilon }^i) \; \text {,} \end{aligned}$$
(6)

enforcing volume conservation of the inelastic deformation. Here, \(\lambda\) is a Lagrange multiplier. The dissipation function is

$$\begin{aligned} \varDelta = \frac{1}{2} \; (\mu _\mathrm {v}^{-1} |{\dot{\varvec{\varepsilon }}}^i|^2 - \varvec{\kappa }\; {\mathbf {E}}^2) \; \text {,} \quad \text {with} \quad {\mathbf {J}}= \varvec{\kappa }\; {\mathbf {E}}\; \text {.} \end{aligned}$$
(7)

Thus, \(\varDelta\) governs the evolution of the inelastic strain and the energy loss due to conduction. The latter satisfies Ohm’s law (Eq. (7), right). Both parts of the dissipation only occur in the bone marrow phase. Here, the viscosity parameter \(\mu _\mathrm {v}^{-1} > 0\), the electric conductivity tensor \(\varvec{\kappa }= \kappa _1 {\mathbf {I}}\), with the identity tensor \({\mathbf {I}}\), the electric conductivity \(\kappa _1 > 0\) and the electric current density \({\mathbf {J}}\) are introduced. The gauge function is

$$\begin{aligned} \varPsi _{\mathrm {g}}=\frac{\gamma }{2} (\nabla \cdot {\mathbf {A}})^2 \end{aligned}$$
(8)

and ensures, that a unique solution for the magnetic vector potential \({\mathbf {A}}\) is obtained by penalizing its divergence, effectively requiring, that \(\nabla \cdot {\mathbf {A}}\) vanishes and thus improving the numerical stability (Semenov et al. 2006). The penalty parameter \(\gamma\) is a numerical parameter used to control the gauge term. Finally, the potential of generalized external forces is

$$\begin{aligned} W_{\mathrm {ext}}=& \int \limits _{\varOmega } ({\mathbf {f}}\cdot {\mathbf {u}}- q_{\mathrm {v}} \cdot \varphi + {\mathbf {j}}_{\mathrm {v}} \cdot {\mathbf {A}}) \;\!\mathrm {d}V \nonumber \\&+ \int \limits _{\partial \varOmega } ({\mathbf {t}}\cdot {\mathbf {u}}- q_{\mathrm {s}} \cdot \varphi + {\mathbf {j}}_{\mathrm {s}} \cdot {\mathbf {A}}) \;\!\mathrm {d}A \; \text {.} \end{aligned}$$
(9)

Here, \({\mathbf {f}}\) and \({\mathbf {t}}\) are the mechanical volume and surface forces, \(q_{\mathrm {v}}\) and \(q_{\mathrm {s}}\) are the electric volume and surface charges and \({\mathbf {j}}_{\mathrm {v}}\) and \({\mathbf {j}}_{\mathrm {s}}\) are the volume and surface currents.

By calculating the derivative of the energy density with respect to the state variables, we find the following constitutive equations for both phases:

$$\begin{aligned} \varvec{\sigma }&:= \displaystyle \frac{\partial \varPsi _\mathrm {b}}{\partial \varvec{\varepsilon }} = {\mathbb {C}}_{\mathrm {b}} \cdot \varvec{\varepsilon }- {\mathbf {e}}_{\mathrm {b}}^T \cdot {\mathbf {E}}\;\text {,} \nonumber \\ {\mathbf {D}}&:= -\displaystyle \frac{\partial \varPsi _\mathrm {b}}{\partial {\mathbf {E}}} = {\mathbf {e}}_{\mathrm {b}} \cdot \varvec{\varepsilon }+ \varvec{\xi }_\mathrm {b} \cdot {\mathbf {E}}\;\text {,} \nonumber \\ {\mathbf {H}}&:= \displaystyle \frac{\partial \varPsi _\mathrm {b}}{\partial {\mathbf {B}}} = \varvec{\mu }_{\mathrm {b}}^{-1} \cdot {\mathbf {B}}\;\text {,} \nonumber \\&\nonumber \\ \varvec{\sigma }&:= \frac{\partial \varPsi _\mathrm {m}}{\partial \varvec{\varepsilon }} = {\mathbb {C}}_{\mathrm {m}} \cdot (\varvec{\varepsilon }- \varvec{\varepsilon }^i) \;\text {,} \nonumber \\ {\mathbf {D}}&:= -\frac{\partial \varPsi _\mathrm {m}}{\partial {\mathbf {E}}} = \varvec{\xi }_\mathrm {m} \cdot {\mathbf {E}}\quad \text {and} \nonumber \\ {\mathbf {H}}&:= \frac{\partial \varPsi _\mathrm {m}}{\partial {\mathbf {B}}} = \varvec{\mu }_{\mathrm {m}}^{-1} \cdot {\mathbf {B}}\; \text {.} \end{aligned}$$
(10)

For the bone marrow, the additional constitutive equations are

$$\begin{aligned} \varvec{\sigma }&:= -\displaystyle \frac{\partial \varPsi _\mathrm {m}}{\partial \varvec{\varepsilon }^i} = {\mathbb {C}}_{\mathrm {m}} \cdot (\varvec{\varepsilon }- \varvec{\varepsilon }^i) \quad \text {and} \\ {\mathbf {J}}&:= \displaystyle \frac{\partial \varDelta }{\partial {\mathbf {E}}} = -\frac{\partial \varDelta }{\partial {\dot{{\mathbf {A}}}}} = \varvec{\kappa }_{\mathrm {m}} \; {\mathbf {E}}\quad \text {,} \end{aligned}$$
(11)

introducing the flux quantities mechanical stress \(\varvec{\sigma }\), electric displacement \({\mathbf {D}}\) and magnetic field strength \({\mathbf {H}}\). For the cortical bone phase, the viscosity parameter \(\mu _\mathrm {v}^{-1}\) and the electric conductivity tensor \(\varvec{\kappa }\) vanish. The material tensors satisfy

$$\begin{aligned} {\mathbb {C}}&:= \displaystyle \frac{\partial \varvec{\sigma }}{\partial \varvec{\varepsilon }} \; \text {,} \quad&\varvec{\xi }&:= \frac{\partial {\mathbf {D}}}{\partial {\mathbf {E}}} \; \text {,} \quad&{\mathbf {e}}&:= \displaystyle \frac{\partial {\mathbf {D}}}{\partial \varvec{\varepsilon }} = -\left( \displaystyle \frac{\partial \varvec{\sigma }}{\partial {\mathbf {E}}}\right) ^T \; \text {,} \nonumber \\ \varvec{\mu }^{-1}&:= \displaystyle \frac{\partial {\mathbf {H}}}{\partial {\mathbf {B}}} \; \text {,} \quad&\varvec{\kappa }&:= \frac{\partial {\mathbf {J}}}{\partial {\mathbf {E}}} \; \text {.} \end{aligned}$$
(12)

2.4 Weak and strong form of the microscale problem

To calculate the weak and strong form of the problem, the energy functional has to become stationary with respect to the main variables and internal variables, leading to

$$\begin{aligned} \int \limits _{t_0}^{t_1} \varPi \;\!\mathrm {d}t \rightarrow \underset{{\mathbf {u}}\text {,} \; \varphi \text {,} \; {\mathbf {A}}\text {,} \; \varvec{\varepsilon }^i}{stat} \; \text {.} \end{aligned}$$
(13)

The stationary condition of the first variation of the energy functional reads then

$$\begin{aligned}&\displaystyle \int \limits _{\varOmega _b} \biggl ( \frac{\partial \varPsi _b}{\partial \varvec{\varepsilon }} \delta \varvec{\varepsilon }+ \frac{\partial \varPsi _b}{\partial {\mathbf {E}}} \delta {\mathbf {E}}+ \frac{\partial \varPsi _b}{\partial {\mathbf {B}}} \delta {\mathbf {B}}\biggr ) \;\!\mathrm {d}V \nonumber \\&\qquad + \displaystyle \int \limits _{\varOmega _m} \biggl ( \frac{\partial \varPsi _m}{\partial \varvec{\varepsilon }} \delta \varvec{\varepsilon }+ \frac{\partial \varPsi _m}{\partial \varvec{\varepsilon }^i} \delta \varvec{\varepsilon }^i + \frac{\partial \varPsi _m}{\partial {\mathbf {E}}} \delta {\mathbf {E}}\nonumber \\&\qquad + \displaystyle \frac{\partial \varPsi _m}{\partial {\mathbf {B}}} \delta {\mathbf {B}}+ \frac{\partial \varDelta }{\partial {\dot{\varvec{\varepsilon }}}^i} \delta \varvec{\varepsilon }^i + \frac{\partial \varDelta }{\partial {\dot{{\mathbf {A}}}}} \delta {\mathbf {A}}\nonumber \\&\qquad + \lambda {\mathbf {I}}\delta \varvec{\varepsilon }^i \biggr ) \;\!\mathrm {d}V + \displaystyle \int \limits _{\varOmega } \frac{\partial \varPsi _{g}}{\partial (\nabla \cdot {\mathbf {A}})} \nonumber \\&\qquad \delta (\nabla \cdot {\mathbf {A}}) \;\!\mathrm {d}V - \delta W_{ext} = \delta \varPi = 0 \; \forall \delta {\mathbf {u}}\text {,} \delta \varphi \text {,} \delta {\mathbf {A}}\text {,} \delta \varvec{\varepsilon }^i \text {.} \nonumber \\ \end{aligned}$$
(14)

The variation of the generalized external forces is

$$\begin{aligned} \delta W_{\mathrm {ext}} = \int \limits _{\varOmega } ( {\mathbf {f}}\cdot \delta {\mathbf {u}}- q_{\mathrm {v}} \cdot \delta \varphi + {\mathbf {j}}_{\mathrm {v}} \cdot \delta {\mathbf {A}}) \;\!\mathrm {d}V \nonumber \\ \qquad\quad + \int \limits _{\partial \varOmega } ( {\mathbf {t}}\cdot \delta {\mathbf {u}}- q_{\mathrm {s}} \cdot \delta \varphi + {\mathbf {j}}_{\mathrm {s}} \cdot \delta {\mathbf {A}}) \;\!\mathrm {d}A \; \text {.} \end{aligned}$$
(15)

Using the introduced energy densities, constraint, dissipation and gauge functions, Eqs. (5), (6), (7), (8), and inserting the constitutive equations Eqs. (10), (14) simplifies to

$$\begin{aligned} \int \limits _{\varOmega } \bigl ( \varvec{\sigma }\cdot \delta \varvec{\varepsilon }- {\mathbf {D}}\cdot \delta {\mathbf {E}}+ {\mathbf {H}}\cdot \delta {\mathbf {B}}- {\mathbf {J}}\cdot \delta {\mathbf {A}}\nonumber \\ + \gamma (\nabla \cdot {\mathbf {A}}) \cdot \delta (\nabla \cdot {\mathbf {A}}) + (-\varvec{\sigma }+ \mu _\mathrm {v}^{-1} {\dot{\varvec{\varepsilon }}}^i + \lambda {\mathbf {I}}) \nonumber \\ \delta \varvec{\varepsilon }^i \bigr ) \;\!\mathrm {d}V - \delta W_{ext} = 0 \; \forall \delta {\mathbf {u}}\text {,} \delta \varphi \text {,} \delta {\mathbf {A}}\text {,} \delta \varvec{\varepsilon }^i \text {.} \end{aligned}$$
(16)

Here, the identity vector is denoted as \({\mathbf {I}}\). We find the evolution equation of the inelastic strain:

$$\begin{aligned} -\varvec{\sigma }+ \mu _\mathrm {v}^{-1} {\dot{\varvec{\varepsilon }}}^i + \lambda {\mathbf {I}}= {\varvec{0}}\; \text {.} \end{aligned}$$
(17)

To calculate the Lagrange multiplier, the trace is applied to Eq. (17):

$$\begin{aligned} -\mathrm {tr}(\varvec{\sigma }) + \underbrace{\mu _\mathrm {v}^{-1} \; \mathrm {tr}({\dot{\varvec{\varepsilon }}}^i)}_{=0} + \lambda \; \mathrm {tr}({\mathbf {I}}) = 0 \; \Rightarrow \; \lambda = \frac{1}{3} \; \mathrm {tr}(\varvec{\sigma }) \; \text {.} \end{aligned}$$
(18)

The second term in Eq. (18) must vanish because of the introduced volume constraint. This leads to the final evolution equation

$$\begin{aligned} {\dot{\varvec{\varepsilon }}}^i = \mu _\mathrm {v} \; \varvec{\sigma }_{\mathrm {dev}} \; \text {,} \end{aligned}$$
(19)

with \(\varvec{\sigma }_{\mathrm {dev}} = \varvec{\sigma }- \frac{1}{3} \; \mathrm {tr}(\varvec{\sigma }) \; {\mathbf {I}}\) denoting the deviatoric part of the mechanical stress \(\varvec{\sigma }\). The time integration of the evolution equation is discussed in Sect. 3.

To calculate the strong form of the problem, the remaining variational equation is used:

$$\begin{aligned} \int \limits _{\varOmega } ( \varvec{\sigma }\cdot \delta \varvec{\varepsilon }- {\mathbf {D}}\cdot \delta {\mathbf {E}}+ {\mathbf {H}}\cdot \delta {\mathbf {B}}- {\mathbf {J}}\cdot \delta {\mathbf {A}}&\nonumber \\ + \gamma (\nabla \cdot {\mathbf {A}}) \cdot \delta (\nabla \cdot {\mathbf {A}}) ) \;\!\mathrm {d}V - \delta W_{\mathrm {ext}}&= 0 \; \forall \delta {\mathbf {u}}\text {,} \; \delta \varphi \text {,} \; \delta {\mathbf {A}}\; \text {.} \end{aligned}$$
(20)

This form is later used to insert a FEM ansatz. We apply partial integration to each term. Details can be found in Appendix A. We obtain

$$\begin{aligned} \nabla \cdot \varvec{\sigma }+ {\mathbf {f}}&= {\varvec{0}}\quad \text {in} \; \varOmega \nonumber \\ \varvec{\sigma }\cdot {\mathbf {n}}&= {\mathbf {t}}\quad \text {on} \; \partial \varOmega \nonumber \\ \nabla \cdot {\mathbf {D}}&= q_{\mathrm {v}} \quad \text {in} \; \varOmega \nonumber \\ {\mathbf {D}}\cdot {\mathbf {n}}&= -q_{\mathrm {s}} \quad \text {on} \; \partial \varOmega \nonumber \\ \nabla \times {\mathbf {H}}&= {\dot{{\mathbf {D}}}} + {\mathbf {J}}+ \gamma \nabla (\nabla \cdot {\mathbf {A}}) + {\mathbf {j}}_{\mathrm {v}} \quad \text {in} \; \varOmega \nonumber \\ {\mathbf {H}}\times {\mathbf {n}}&= {\mathbf {j}}_{\mathrm {s}} - \gamma (\nabla \cdot {\mathbf {A}}) {\mathbf {n}}\quad \text {on} \; \partial \varOmega \end{aligned}$$
(21)

recovering the mechanical equilibrium condition, the two remaining Maxwell equations and boundary conditions, including the gauge. Here, \({\mathbf {n}}\) is the normal vector pointing outwards. Additionally, we receive the jump conditions between the phases

$$\begin{aligned}[[\varvec{\sigma }]]_{\mathrm {bm}} \cdot {\mathbf {n}}= & {\mathbf {t}}\quad \text {on} \; \partial \varOmega _\mathrm {bm} \nonumber \\ \left[ [{\mathbf {D}}]\right] _{\mathrm {bm}} \cdot {\mathbf {n}}= & -q_{\mathrm {s}} \quad \text {on} \; \partial \varOmega _\mathrm {bm} \nonumber \\ \left[ [{\mathbf {H}}]\right] _{\mathrm {bm}} \times {\mathbf {n}}= & {\mathbf {j}}_{\mathrm {s}} - \gamma \; [[\nabla \cdot {\mathbf {A}}]]_{\mathrm {bm}} \; {\mathbf {n}}\quad \text {on} \; \partial \varOmega _\mathrm {bm} \end{aligned}$$
(22)

on the interface \(\partial \varOmega _\mathrm {bm}\) and the evolution equation of the inelastic strain Eq. (19) in \(\varOmega _\mathrm {m}\). Here \([[\cdot ]]_{12} := (\cdot )_1 - (\cdot )_2\) denotes the difference between the phases. It should be noted that the strong form is valid for both phases, but the calculation of the flux variables and the inelastic strain evolution depends on the specific material parameters and thus in which phase the calculation is done.

2.5 Macroscale problem

For the macroscale, the following boundary value problem in the domain \(\varOmega _{{\mathbf {x}}}\) has to be solved: find the set \(\{{\overline{{\mathbf {u}}}}, {\overline{\varphi }}, {\overline{{\mathbf {A}}}}\}\), such that

$$\begin{aligned} \nabla \cdot {\overline{\varvec{\sigma }}} + {\overline{{\mathbf {f}}}}&= {\varvec{0}}\quad \text {in} \; \varOmega _{{\mathbf {x}}} \nonumber \\ {\overline{\varvec{\sigma }}} \cdot {\mathbf {n}}&= {\overline{{\mathbf {t}}}} \quad \text {on} \; \partial \varOmega _{{\mathbf {x}}} \nonumber \\ \nabla \cdot {\overline{{\mathbf {D}}}}&= {\overline{q}}_{\mathrm {v}} \quad \text {in} \; \varOmega _{{\mathbf {x}}} \nonumber \\ {\overline{{\mathbf {D}}}} \cdot {\mathbf {n}}&= -{\overline{q}}_{\mathrm {s}} \quad \text {on} \; \partial \varOmega _{{\mathbf {x}}} \nonumber \\ \nabla \times {\overline{{\mathbf {H}}}}&= \dot{{\overline{{\mathbf {D}}}}} + {\overline{{\mathbf {J}}}} + \gamma \nabla (\nabla \cdot {\overline{{\mathbf {A}}}}) + {\overline{{\mathbf {j}}}}_{\mathrm {v}} \quad \text {in} \; \varOmega _{{\mathbf {x}}} \nonumber \\ {\overline{{\mathbf {H}}}} \times {\mathbf {n}}&= {\overline{{\mathbf {j}}}}_{\mathrm {s}} - \gamma (\nabla \cdot {\overline{{\mathbf {A}}}}) {\mathbf {n}}\quad \text {on} \; \partial \varOmega _{{\mathbf {x}}} \; \text {,} \end{aligned}$$
(23)

with the state variables

$$\begin{aligned} {\overline{\varvec{\varepsilon }}} = \frac{1}{2} \; (\nabla {\overline{{\mathbf {u}}}} + \nabla ^T {\overline{{\mathbf {u}}}}) \; \text {,} \; {\overline{{\mathbf {E}}}} = - \nabla {\overline{\varphi }} - \dot{{\overline{\mathbf {A}}}} \; \text {and} \; {\overline{{\mathbf {B}}}} = \nabla \times {\overline{{\mathbf {A}}}} \; \text {,} \end{aligned}$$
(24)

and the calculation of the fluxes depending on the microscale calculations

$$\begin{aligned} ({\overline{\varvec{\sigma }}}, {\overline{{\mathbf {D}}}}, \dot{{\overline{{\mathbf {D}}}}}, {\overline{{\mathbf {H}}}}, {\overline{{\mathbf {J}}}}) = f_{\mathrm {RVE}}({\overline{\varvec{\varepsilon }}}, {\overline{{\mathbf {E}}}}, {\overline{{\mathbf {B}}}}) \; \text {.} \end{aligned}$$
(25)

We transform the strong form into the weak form by multiplying with test functions of the main variables and again using partial integration:

$$\begin{aligned} \int \limits _{\varOmega _{{\mathbf {x}}}} ( {\overline{\varvec{\sigma }}} \cdot \delta {\overline{\varvec{\varepsilon }}} - {\overline{{\mathbf {D}}}} \cdot \delta {\overline{{\mathbf {E}}}} + {\overline{{\mathbf {H}}}} \cdot \delta {\overline{{\mathbf {B}}}} - {\overline{{\mathbf {J}}}} \cdot \delta {\overline{{\mathbf {A}}}}&\nonumber \\ +\, \gamma (\nabla \cdot {\overline{{\mathbf {A}}}}) \cdot \delta (\nabla \cdot {\overline{{\mathbf {A}}}}) ) \;\!\mathrm {d}V - \delta {\overline{W}}_{\mathrm {ext}}=&0 \quad \forall \delta {\overline{{\mathbf {u}}}} \text {,} \; \delta {\overline{\varphi }} \text {,} \; \delta {\overline{{\mathbf {A}}}} \; \text {.} \end{aligned}$$
(26)

Here, the variation of the macroscopic generalized external forces is

$$\begin{aligned} \delta {\overline{W}}_{\mathrm {ext}}=& \int \limits _{\varOmega _{{\mathbf {x}}}} ( {\overline{{\mathbf {f}}}} \cdot \delta {\overline{{\mathbf {u}}}} - {\overline{q}}_{\mathrm {v}} \cdot \delta {\overline{\varphi }} + {\overline{{\mathbf {j}}}}_{\mathrm {v}} \cdot \delta {\overline{{\mathbf {A}}}} ) \;\!\mathrm {d}V \nonumber \\&+ \int \limits _{\partial \varOmega _{{\mathbf {x}}}} ( {\overline{{\mathbf {t}}}} \cdot \delta {\overline{{\mathbf {u}}}} - {\overline{q}}_{\mathrm {s}} \cdot \delta {\overline{\varphi }} + {\overline{{\mathbf {j}}}}_{\mathrm {s}} \cdot \delta {\overline{{\mathbf {A}}}} ) \;\!\mathrm {d}A \; \text {.} \end{aligned}$$
(27)

This form is again used in the next section to formulate the FEM.

3 Numerical implementation

3.1 Finite element method

To solve the boundary value problems on both scales, we insert a standard finite element approach (Zienkiewicz et al. 2005) into the weak form of the problem for all main variables. In this section, we derive the resulting system for the microscale. It should be noted that the same system has to be solved for the macroscale, but each quantity \((\cdot )\) has to be replaced by its macro-average quantity \(\overline{(\cdot )}\). The inelastic strain is only present on the microscale and vanishes on the macroscale. Its calculation is not done via the FEM, but directly by using the evolution equation Eq. (19) on the integration point level. Details regarding the calculation of macro-fluxes and consistent material tensors are given in the next subsection. Here, we denote nodal FEM values by \(\hat{\mathbf {(\cdot )}}\). For the evolution equation of the inelastic strain on the micro-scale, we apply an explicit Euler scheme, yielding:

$$\begin{aligned} \varvec{\varepsilon }^i_{n+1} = \varvec{\varepsilon }^i_{n} + \varDelta t \; {\dot{\varvec{\varepsilon }}}^i \quad \text {with} \quad {\dot{\varvec{\varepsilon }}}^i = \mu _\mathrm {v} \varvec{\sigma }_{\mathrm {dev}} \; \text {.} \end{aligned}$$
(28)

Here, \(\varDelta t\) is the time increment between two time steps. The standard FEM approach for the remaining system is

$$\begin{aligned} {\mathbf {u}}&\approx {\mathbf {N}}_\mathrm {u} \; {\hat{\mathbf {u}}}&\varvec{\varphi }&\approx {\mathbf {N}}_{\varphi } \; {\hat{\mathbf {\varphi }}}&{\mathbf {A}}&\approx {\mathbf {N}}_\mathrm {A} \; {\hat{\mathbf {A}}} \nonumber \\ \delta {\mathbf {u}}&\approx {\mathbf {N}}_\mathrm {u} \; \delta {\hat{\mathbf {u}}}&\delta \varvec{\varphi }&\approx {\mathbf {N}}_{\varphi } \; \delta {\hat{\mathbf {\varphi }}}&\delta {\mathbf {A}}&\approx {\mathbf {N}}_\mathrm {A} \; \delta {\hat{\mathbf {A}}} \end{aligned}$$
(29)

approximating the main variable and their variations by shape functions times the nodal values of the functions \((\mathbf {\cdot }) \approx {\mathbf {N}}_{\mathbf {\cdot }} \; \hat{\mathbf {(\cdot )}}\). For the state variables and the gauge, this approach yields

$$\begin{aligned} {\hat{\varvec{\varepsilon }}}&= {\mathbf {B}}_\mathrm {u} {\hat{\mathbf {u}}} \; \text {,}&{\hat{\mathbf {E}}}&= - {\mathbf {B}}_\mathrm {grad} {\hat{\varvec{\varphi }}} - {\mathbf {N}}_A \dot{{\hat{{\mathbf {A}}}}} \; \text {,} \nonumber \\ {\hat{{\mathbf {B}}}}&= {\mathbf {B}}_\mathrm {curl} {\hat{{\mathbf {A}}}} \; \text {,}&\nabla \cdot {\hat{{\mathbf {A}}}}&= {\mathbf {B}}_\mathrm {div} {\hat{{\mathbf {A}}}} \; \text {.} \end{aligned}$$
(30)

Here, the operator matrices are

$$\begin{aligned} {\mathbf {B}}_\mathrm {u}&= \begin{pmatrix} \frac{\partial }{\partial x} & 0 & 0 \\ 0 & \frac{\partial }{\partial y} & 0 \\ 0 & 0 & \frac{\partial }{\partial z} \\ \frac{\partial }{\partial y} & \frac{\partial }{\partial x} & 0 \\ 0 & \frac{\partial }{\partial z} & \frac{\partial }{\partial y} \\ \frac{\partial }{\partial z} & 0 & \frac{\partial }{\partial x} \end{pmatrix} \cdot {\mathbf {N}}_\mathrm {u} \nonumber \\ {\mathbf {B}}_\mathrm {grad}&= \begin{pmatrix} \frac{\partial }{\partial x} \\ \frac{\partial }{\partial y} \\ \frac{\partial }{\partial z} \end{pmatrix} \cdot {\mathbf {N}}_{\varphi } \nonumber \\ {\mathbf {B}}_\mathrm {curl}&= \begin{pmatrix} 0 & \frac{\partial }{\partial z} & -\frac{\partial }{\partial y} \\ -\frac{\partial }{\partial z} & 0 & \frac{\partial }{\partial x} \\ \frac{\partial }{\partial y} & -\frac{\partial }{\partial x} & 0 \end{pmatrix} \cdot {\mathbf {N}}_\mathrm {A} \nonumber \\ {\mathbf {B}}_\mathrm {div}&= \begin{pmatrix} \frac{\partial }{\partial x}&\frac{\partial }{\partial y}&\frac{\partial }{\partial z} \end{pmatrix} \cdot {\mathbf {N}}_\mathrm {A} \end{aligned}$$
(31)

Inserting these equations into the reduced weak form of the micro-problem Eq. (20) and by using the arbitrariness of the test functions, we find the final equation system in matrix form as follows (a detailed derivation is given in Appendix B):

$$\begin{aligned} {\mathbf {R}}:= {\mathbf {F}}- {\mathbf {M}}\ddot{{\mathbf {d}}} - {\mathbf {C}}{\dot{{\mathbf {d}}}} - {\mathbf {K}}{\mathbf {d}}\overset{!}{=} {\varvec{0}} \end{aligned}$$
(32)

with the residual vector \({\mathbf {R}}= \begin{pmatrix} {\mathbf {R}}_{\rm u}&{\mathbf {R}}_{\varphi }&{\mathbf {R}}_{\rm A} \end{pmatrix}^T =\)

$$\begin{aligned} \begin{pmatrix}{\hat{\mathbf {f}}} + \int \limits _{\varOmega } -{\mathbf {B}}_\mathrm {u}^T {\hat{\mathbf {\sigma }}} \;\!\mathrm {d}V \\ {\hat{\mathbf {q}}} + \int \limits _{\varOmega } -{\mathbf {B}}_{\mathrm {grad}}^T {\hat{\mathbf {D}}} \;\!\mathrm {d}V \\ {\hat{\mathbf {j}}} + \int \limits _{\varOmega } ({\mathbf {N}}_\mathrm {A}^T (\dot{{\hat{{\mathbf {D}}}}}+{\hat{{\mathbf {J}}}}) -{\mathbf {B}}_{\mathrm {curl}}^T {\hat{\mathbf {H}}} - \gamma {\mathbf {B}}_{\mathrm {div}} {\mathbf {B}}^T_{\mathrm {div}} {\hat{\mathbf {A}}} ) \;\!\mathrm {d}V \end{pmatrix} \end{aligned}$$
(33)

and the generalized force and displacement vectors together with the mass, damping and stiffness matrices as follows:

$$\begin{aligned} {\mathbf {d}}&:= \begin{pmatrix} {\hat{\mathbf {u}}} \\ {\hat{\mathbf {\varphi }}} \\ {\hat{\mathbf {A}}} \end{pmatrix} \text {,} \quad {\mathbf {F}}= \begin{pmatrix} {\hat{\mathbf {f}}} \\ {\hat{\mathbf {q}}} \\ {\hat{\mathbf {j}}} \end{pmatrix} \text {,} \nonumber \\ {\mathbf {M}}&= \begin{pmatrix} {\varvec{0}}& {\varvec{0}}& {\varvec{0}}\\ {\varvec{0}}& {\varvec{0}}& {\varvec{0}}\\ {\varvec{0}}& {\varvec{0}}& {\mathbf {M}}_{{\mathbf {A}}{\mathbf {A}}} \end{pmatrix} \text {,} \quad {\mathbf {C}}= \begin{pmatrix} {\varvec{0}}& {\varvec{0}}& {\mathbf {C}}_{{\mathbf {u}}{\mathbf {A}}} \\ {\varvec{0}}& {\varvec{0}}& {\mathbf {C}}_{\mathbf {\varphi } {\mathbf {A}}}\\ {\mathbf {C}}_{{\mathbf {A}}{\mathbf {u}}} & {\mathbf {C}}_{{\mathbf {A}}\mathbf {\varphi }} & {\mathbf {C}}_{{\mathbf {A}}{\mathbf {A}}} \end{pmatrix} \text {,} \nonumber \\ {\mathbf {K}}&= \begin{pmatrix} {\mathbf {K}}_{{\mathbf {u}}{\mathbf {u}}} & {\mathbf {K}}_{{\mathbf {u}}\mathbf {\varphi }} & {\varvec{0}}\\ {\mathbf {K}}_{\mathbf {\varphi } {\mathbf {u}}} & {\mathbf {K}}_{\mathbf {\varphi } \mathbf {\varphi }} & {\varvec{0}}\\ {\varvec{0}}& {\mathbf {K}}_{{\mathbf {A}}\mathbf {\varphi }} & {\mathbf {K}}_{{\mathbf {A}}{\mathbf {A}}} \end{pmatrix} \text {.} \nonumber \\ {\mathbf {K}}_{{\mathbf {u}}{\mathbf {u}}}&:= -\frac{\partial {\mathbf {R}}_\mathrm {u}}{\partial {\hat{\mathbf {u}}}} = \int \limits _{\varOmega } {\mathbf {B}}_\mathrm {u}^T \; {\mathbb {C}}_\mathrm {tang} \; {\mathbf {B}}_\mathrm {u} \; \;\!\mathrm {d}V \text {,} \nonumber \\ \displaystyle {\mathbf {K}}_{{\mathbf {u}}\mathbf {\varphi }}&:= -\frac{\partial {\mathbf {R}}_\mathrm {u}}{\partial {\hat{\mathbf {\varphi }}}} = \int \limits _{\varOmega } {\mathbf {B}}_\mathrm {u}^T \; {\mathbf {e}}^T \; {\mathbf {B}}_{\mathrm {grad}} \; \;\!\mathrm {d}V \text {,} \nonumber \\ {\mathbf {K}}_{\mathbf {\varphi } {\mathbf {u}}}&:= -\frac{\partial {\mathbf {R}}_\varphi }{\partial {\hat{\mathbf {u}}}} = \int \limits _{\varOmega } {\mathbf {B}}_{\mathrm {grad}}^T \; {\mathbf {e}}\; {\mathbf {B}}_\mathrm {u} \; \;\!\mathrm {d}V \text {,} \nonumber \\ \displaystyle {\mathbf {K}}_{\mathbf {\varphi } \mathbf {\varphi }}&:= -\frac{\partial {\mathbf {R}}_\varphi }{\partial {\hat{\mathbf {\varphi }}}} = \int \limits _{\varOmega } - {\mathbf {B}}_{\mathrm {grad}}^T \; \varvec{\xi }\; {\mathbf {B}}_{\mathrm {grad}} \; \;\!\mathrm {d}V \text {,} \nonumber \\ {\mathbf {K}}_{{\mathbf {A}}{\mathbf {A}}}&:= -\frac{\partial {\mathbf {R}}_\mathrm {A}}{\partial {\hat{\mathbf {A}}}} = \int \limits _{\varOmega } {\mathbf {B}}_{\mathrm {curl}}^T \varvec{\mu }^{-1} {\mathbf {B}}_{\mathrm {curl}} + \gamma {\mathbf {B}}_{\mathrm {div}} {\mathbf {B}}_{\mathrm {div}}^T \;\!\mathrm {d}V \text {,} \nonumber \\ \displaystyle {\mathbf {K}}_{{\mathbf {A}}\mathbf {\varphi }}&:= -\frac{\partial {\mathbf {R}}_\mathrm {A}}{\partial {\hat{\mathbf {\varphi }}}} = \int \limits _{\varOmega } {\mathbf {N}}_\mathrm {A}^T \; \varvec{\kappa }\; {\mathbf {B}}_{\mathrm {grad}} \; \;\!\mathrm {d}V \text {,} \nonumber \\ {\mathbf {C}}_{{\mathbf {u}}{\mathbf {A}}}&:= -\frac{\partial {\mathbf {R}}_\mathrm {u}}{\partial \dot{{\hat{{\mathbf {A}}}}}} = \int \limits _{\varOmega } {\mathbf {B}}_\mathrm {u}^T \; {\mathbf {e}}^T \; {\mathbf {N}}_\mathrm {A} \; \;\!\mathrm {d}V \text {,} \nonumber \\ \displaystyle {\mathbf {C}}_{{\mathbf {A}}{\mathbf {u}}}&:= -\frac{\partial {\mathbf {R}}_\mathrm {A}}{\partial \dot{{\hat{{\mathbf {u}}}}}} = \int \limits _{\varOmega } - {\mathbf {N}}_\mathrm {A}^T \; {\mathbf {e}}\; {\mathbf {B}}_\mathrm {u} \; \;\!\mathrm {d}V \text {,} \nonumber \\ {\mathbf {C}}_{\mathbf {\varphi } {\mathbf {A}}}&:= -\frac{\partial {\mathbf {R}}_\varphi }{\partial \dot{{\hat{{\mathbf {A}}}}}} = \int \limits _{\varOmega } - {\mathbf {B}}_{\mathrm {grad}}^T \; \varvec{\xi }\; {\mathbf {N}}_\mathrm {A} \; \;\!\mathrm {d}V \text {,} \nonumber \\ \displaystyle {\mathbf {C}}_{{\mathbf {A}}\mathbf {\varphi }}&:= -\frac{\partial {\mathbf {R}}_\mathrm {A}}{\partial \dot{{\hat{\varvec{\varphi }}}}} = \int \limits _{\varOmega } {\mathbf {N}}_\mathrm {A}^T \; \varvec{\xi }\; {\mathbf {B}}_{\mathrm {grad}} \; \;\!\mathrm {d}V \text {,} \nonumber \\ {\mathbf {C}}_{{\mathbf {A}}{\mathbf {A}}}&:= -\frac{\partial {\mathbf {R}}_\mathrm {A}}{\partial \dot{{\hat{{\mathbf {A}}}}}} = \int \limits _{\varOmega } {\mathbf {N}}_\mathrm {A}^T \; \varvec{\kappa }\; {\mathbf {N}}_\mathrm {A} \; \;\!\mathrm {d}V \text {,} \nonumber \\ \displaystyle {\mathbf {M}}_{{\mathbf {A}}{\mathbf {A}}}&:= -\frac{\partial {\mathbf {R}}_\mathrm {A}}{\partial \ddot{{\hat{\mathbf {A}}}}} = \int \limits _{\varOmega } {\mathbf {N}}_\mathrm {A}^T \; \varvec{\xi }\; {\mathbf {N}}_\mathrm {A} \; \;\!\mathrm {d}V \text {.} \end{aligned}$$
(34)

The material tensors depend again on the phase. We calculate the mechanical stiffness tangent matrix \({\mathbb {C}}_\mathrm {tang}\) by introducing a time discretization as:

$$\begin{aligned} {\mathbb {C}}_\mathrm {tang} = \frac{\partial \varvec{\sigma }_{n+1}}{\partial \varvec{\varepsilon }_{n+1}} = {\left\{ \begin{array}{ll} {\mathbb {C}}_{\mathrm {b}} \quad \text {in } \varOmega _\mathrm {b} \\ {\mathbb {C}}_{\mathrm {m}} - {\mathbb {C}}_{\mathrm {m}} \; \frac{\partial \varvec{\varepsilon }_{n+1}^i}{\partial \varvec{\varepsilon }_{n+1}} \quad \text {in } \varOmega _\mathrm {m}\end{array}\right. } \end{aligned}$$
(35)

For the bone marrow phase, the calculation depends on the inelastic strain \(\varvec{\varepsilon }_{n+1}^i\):

$$\begin{aligned} \frac{\partial \varvec{\varepsilon }_{n+1}^i}{\partial \varvec{\varepsilon }_{n+1}} = \mu _\mathrm {v} \frac{\partial \varvec{\sigma }_\mathrm {dev}}{\partial \varvec{\sigma }} \underbrace{\frac{\partial \varvec{\sigma }}{\partial \varvec{\varepsilon }_{n+1}}}_{{\mathbb {C}}_\mathrm {m}} \; \text {,} \end{aligned}$$
(36)

with

$$\begin{aligned} {\mathbf {D}}_{\mathrm {devd}}&:= \frac{\partial \varvec{\sigma }_\mathrm {dev}}{\partial \varvec{\sigma }}= & {\mathbf {I}}- \frac{1}{3} \begin{pmatrix}1 & 1 & 1 & 0 & 0 & 0 \\ 1 & 1 & 1 & 0 & 0 & 0 \\ 1 & 1 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{pmatrix} \nonumber \\= & \frac{1}{3} \begin{pmatrix}2 & -1 & -1 & 0 & 0 & 0 \\ -1 & 2 & -1 & 0 & 0 & 0 \\ -1 & -1 & 2 & 0 & 0 & 0 \\ 0 & 0 & 0 & 3 & 0 & 0 \\ 0 & 0 & 0 & 0 & 3 & 0 \\ 0 & 0 & 0 & 0 & 0 & 3 \end{pmatrix}\text {.} \end{aligned}$$
(37)

The mechanical stiffness tangent matrix for the bone marrow phase is then

$$\begin{aligned} {\mathbb {C}}_\mathrm {tang} = {\mathbb {C}}_m - {\mathbb {C}}_m (\mu _\mathrm {v} {\mathbf {D}}_{\mathrm {devd}} {\mathbb {C}}_m) \quad \text {in } \varOmega _\mathrm {m} \; \text {.} \end{aligned}$$
(38)

In order to solve the resulting second-order differential equation system, a suitable time integration scheme is necessary. Here we use a JWH-\(\alpha\)-scheme introduced in Kadapa et al. (2017), where also details regarding advantages and implementation of this method can be found. For the time integration, the time increment \(\varDelta t\) and the additional numerical parameter \(\rho _{\infty }\) are needed. By combining the method with a regular Newton–Raphson scheme, we transform the matrix system of Eq. (32) to

$$\begin{aligned} {\mathbf {R}}^{i+1} := {\mathbf {R}}^i(d_{n+\alpha _f}, v_{n+\alpha _f}, {\dot{v}}_{n+\alpha _m}) - {\mathbf {S}}\; \varDelta {\mathbf {d}}\overset{!}{=} {\varvec{0}}\; \text {,} \end{aligned}$$
(39)

with the index denoting the iteration and the generalized tangent matrix

$$\begin{aligned} {\mathbf {S}}= \frac{\alpha _\mathrm {m}^2}{\alpha _\mathrm {f} \gamma _{\mathrm {a}}^2 \varDelta t^2} {\mathbf {M}}+ \frac{\alpha _\mathrm {m}}{\gamma _{\mathrm {a}} \varDelta t} {\mathbf {C}}+ \alpha _\mathrm {f} {\mathbf {K}}\; \text {,} \end{aligned}$$
(40)

which is the Jacobian of the system. Here \(\varDelta {\mathbf {d}}\) is the increment of the solution vector and \(\alpha _\mathrm {f}\), \(\alpha _\mathrm {m}\) and \(\gamma _{\mathrm {a}}\) are numerical parameters depending on \(\rho _{\infty }\) (Kadapa et al. 2017). The residual \({\mathbf {R}}^i(d_{n+\alpha _f}, v_{n+\alpha _f}, {\dot{v}}_{n+\alpha _m})\) is calculated from either initial conditions for the first iteration of the first time step or else from the previous increment (Kadapa et al. 2017). The resulting tangent matrix \({\mathbf {S}}\) is neither symmetric nor positive definite, limiting the choices for a suitable solver of the linear system.

3.2 Transition between the scales

To connect the macro- and microscale in \(\text {FE}^2\), it is important to discuss the transition between the scales. The Hill-Mandel conditions (Hill 1963, 1972; Schröder 2009; Schröder et al. 2016; Labusch et al. 2019; Karimi et al. 2019) have to be fulfilled, guaranteeing energy conservation during the scale transition. Thus, the virtual work on the macroscale has to be equal to the virtual work on the microscale:

$$\begin{aligned} {\overline{\varvec{\sigma }}} \cdot \delta {\overline{\varvec{\varepsilon }}}&= \frac{1}{\varOmega } \int \limits _{\varOmega } \varvec{\sigma }\cdot \delta \varvec{\varepsilon }\;\!\mathrm {d}V \text {,}&{\overline{{\mathbf {D}}}} \cdot \delta \overline{\mathbf {E}}&= \frac{1}{\varOmega } \int \limits _{\varOmega } {\mathbf {D}}\cdot \delta {\mathbf {E}}\;\!\mathrm {d}V \text {,} \nonumber \\ {\overline{\mathbf {B}}} \cdot \delta {\overline{\mathbf {H}}}&= \frac{1}{\varOmega } \int \limits _{\varOmega } {\mathbf {B}}\cdot \delta {\mathbf {H}}\;\!\mathrm {d}V \; \text {.} \end{aligned}$$
(41)

For the macro-to-micro-transition, these conditions can be fulfilled by three different types of boundary conditions on the microscale: Dirichlet, Neumann and periodic boundary conditions (Ilic et al. 2010; Schröder 2000; Schröder and Hackl 2013). Here we chose periodic boundary conditions, as they are the only type of boundary condition, where the results on the microscale are independent from the relative geometry of the RVE (Schröder 2000; Schröder and Hackl 2013). Additionally, as the RVE is periodic in space, this type of boundary condition is the most suitable. In the program, the periodic boundary conditions were applied by fixing all degrees of freedom at all corner nodes, preventing rigid body motions, and linking all degrees of freedom at opposite faces of the RVE, ensuring the periodicity. The micro-state variables consist then of two parts: a term resulting from the microscopic main variables (denoted by \(\tilde{\mathbf {(\cdot )}}\)), whose fluctuations are calculated, and a term contributed by the macroscale:

$$\begin{aligned} \varvec{\varepsilon }&= {\tilde{\varvec{\varepsilon }}}({\mathbf {y}}) + {\overline{\varvec{\varepsilon }}}({\mathbf {x}}) \text {,}&{\mathbf {E}}&= {\tilde{\mathbf {E}}}({\mathbf {y}}) + {\overline{\mathbf {E}}}({\mathbf {x}}) \text {,} \nonumber \\ {\mathbf {B}}&= {\tilde{\mathbf {B}}}({\mathbf {y}}) + {\overline{\mathbf {B}}}({\mathbf {x}}) \text {.} \end{aligned}$$
(42)

This way, we calculate the flux variables on the microscale. For the micro-to-macro transition, the volume average of these flux quantities is sent back to the macroscale:

$$\begin{aligned} {\overline{\varvec{\sigma }}}({\mathbf {x}})&= \frac{1}{\varOmega } \int \limits _{\varOmega } \varvec{\sigma }({\mathbf {y}}) \;\!\mathrm {d}V \text {,}&{\overline{{\mathbf {D}}}}({\mathbf {x}})&= \frac{1}{\varOmega } \int \limits _{\varOmega } {\mathbf {D}}({\mathbf {y}}) \;\!\mathrm {d}V \text {,} \nonumber \\ \dot{{\overline{{\mathbf {D}}}}}({\mathbf {x}})&= \frac{1}{\varOmega } \int \limits _{\varOmega } {\dot{{\mathbf {D}}}}({\mathbf {y}}) \;\!\mathrm {d}V \text {,}&{\overline{{\mathbf {H}}}}({\mathbf {x}})&= \frac{1}{\varOmega } \int \limits _{\varOmega } {\mathbf {H}}({\mathbf {y}}) \;\!\mathrm {d}V \text {,} \nonumber \\ {\overline{{\mathbf {J}}}}({\mathbf {x}})&= \frac{1}{\varOmega } \int \limits _{\varOmega } {\mathbf {J}}({\mathbf {y}}) \;\!\mathrm {d}V \text {.} \end{aligned}$$
(43)

In this model, energy dissipation is considered in two ways. For the electric current \({\mathbf {J}}\), the average is calculated and included in the scale transition, resulting in no energy loss during the scale transition. For the inelastic strain \(\varvec{\varepsilon }^i\), the complete state in every point and for every RVE is saved. Thus, the dissipation occurs only on the microscale and the energy conservation is fullfilled, as the virtual work send to the microscale is equal to the virtual work send back added to the energy dissipation on the microscale. With the flux variables available on the macroscale, it is now possible to obtain the macro-residual for the Newton–Raphson method and the calculation of consistent macro-tangent moduli remains, which are needed for the iteration. The definitions of those moduli read

$$\begin{aligned} {\overline{{\mathbb {C}}}}&:= \frac{\partial {\overline{\varvec{\sigma }}}}{\partial {\overline{\varvec{\varepsilon }}}} \; \text {,}&{\overline{\varvec{\xi }}}&:= \frac{\partial {\overline{{\mathbf {D}}}}}{\partial {\overline{{\mathbf {E}}}}} \; \text {,} \nonumber \\ {\overline{{\mathbf {e}}}}&:= \frac{\partial {\overline{{\mathbf {D}}}}}{\partial {\overline{\varvec{\varepsilon }}}} \; \text {,}&\overline{\varvec{\mu }^{-1}}&:= \frac{\partial {\overline{{\mathbf {H}}}}}{\partial {\overline{{\mathbf {B}}}}} \; \text {,} \nonumber \\ {\overline{\varvec{\kappa }}}&:= \frac{\partial {\overline{{\mathbf {J}}}}}{\partial {\overline{{\mathbf {E}}}}} \; \text {.} \end{aligned}$$
(44)

The calculation can be done by applying a small numerical perturbation \(\varDelta _{\mathrm {tol}} = 10^{-8}\) to each entry of the corresponding state variable

$$\begin{aligned} {\overline{\varvec{\varepsilon }}}^{p_i}&= {\overline{\varvec{\varepsilon }}} + \varDelta _{\mathrm {tol}} e_i \; \text {,}&{\overline{{\mathbf {E}}}}^{p_i}&= {\overline{{\mathbf {E}}}} + \varDelta _{\mathrm {tol}} e_i \; \text {,} \nonumber \\ {\overline{{\mathbf {B}}}}^{p_i}&= {\overline{{\mathbf {B}}}} + \varDelta _{\mathrm {tol}} e_i \; \text {,} \end{aligned}$$
(45)

with the i-th unit vector \(e_i\), and then calculating each entry of the macroscopic tangent tensors by evaluating the perturbated fluxes \({\overline{\varvec{\sigma }}}^{p_i}, {\overline{{\mathbf {D}}}}^{p_i}, {\overline{{\mathbf {H}}}}^{p_i}, {\overline{{\mathbf {J}}}}^{p_i}\) by means of the RVE as

$$\begin{aligned} {\overline{{\mathbb {C}}}}_{ji}&= \frac{{\overline{\sigma }}^{p_i}_j - {\overline{\sigma }}_{j}}{{\overline{\varepsilon }}^{p_i}_j - {\overline{\varepsilon }}_{j}} \; \text {,}&{\overline{\xi }}_{ji}&= \frac{{\overline{D}}^{p_i}_j - {\overline{D}}_{j}}{{\overline{E}}^{p_i}_j - {\overline{E}}_{j}} \; \text {,} \nonumber \\ {\overline{e}}_{ji}&= \frac{{\overline{D}}^{p_i}_j - {\overline{D}}_{j}}{{\overline{\varepsilon }}^{p_i}_j - {\overline{\varepsilon }}_{j}}&\overline{\mu ^{-1}_{ji}}&= \frac{{\overline{H}}^{p_i}_j - {\overline{H}}_{j}}{{\overline{B}}^{p_i}_j - {\overline{B}}_{j}} \; \text {,} \nonumber \\ {\overline{\kappa }}_{ji}&= \frac{{\overline{J}}^{p_i}_j - {\overline{J}}_{j}}{{\overline{E}}^{p_i}_j - {\overline{E}}_{j}} \; \text {.} \end{aligned}$$
(46)

Since for our model the same RVE is used everywhere and the nonlinearity from the inelastic strain is very small, this calculation has to be done only once for all RVEs and all time steps, making this approach very efficient. Together with the calculated macrostate variables, this allows to solve the macroscopic FE problem.

3.3 Implementation

For the simulations, we implemented a computer program in the language julia (The julia programming language 2021), using mainly the packages juafem (Carlsson and Ekre 2021) and coherentstructures (de Diego et al. 2021). As the microscale calculations are not dependent on each other, we have parallelized the macroscale element routine, increasing the speed of the computations drastically. As the inelastic strain \(\varepsilon ^i\) is only present in the microscale, we used HDF5 files to store the complete state of the inelastic strain for every RVE for the previous and current time step. Thus, for the inelastic strain evolution no information is lost. In order to solve the linear systems, we used the BiCGStab(l) method of the package krylovmethods (Krylovmethods 2021), as it is stable, fast even without preconditioning the problem and can be used for any matrix type. Regarding the structure of the program, Fig. 3 shows the procedure.

Fig. 3
figure 3

Program flow of the multiscale simulations

4 Simulation results

4.1 Parameters and material tensors

In this subsection, we discuss the numerical and material parameters employed. Unless explicitly stated otherwise, the parameters from this subsection are used in all simulations. Regarding the numerical parameters, we use the same parameters for both scales. The time integration parameter is \(\rho _{\infty } = 0.5\), the Newton–Raphson tolerance is \(\mathrm {tol}_{\mathrm {N}} = 1 \cdot 10^{-8}\) and the gauge penalty parameter is \(\gamma = 1.0\; \text {s}^2\;\text {A}^2/(\text {kg m})\). The load and numerical time step increment depending on the model are shown in Table 1.

Table 1 Load and numerical time step increment for the different models

The used default material parameters are shown in Table 2. Young’s modulus and Poisson’s ratio for both phases can be found in Steeb (2010). The piezoelectric coefficient can be found in Fukada and Yasuda (1957). For the magnetic properties, bone is considered as a nonmagnetizable material, thus having the same permeability as the vacuum (Güzelsu and Saha 1981). All other parameters are of rather academical nature and influence the results only marginally. The resulting material tensors read

Table 2 Default material parameters
$$\begin{aligned} {\mathbb {C}}&= \frac{E}{(1 + \nu )(1 - 2 \nu )} \; \cdot \nonumber \\&\begin{pmatrix}1 - \nu & \nu & \nu & 0 & 0 & 0 \\ \nu & 1-\nu & \nu & 0 & 0 & 0 \\ \nu & \nu & 1-\nu & 0 & 0 & 0 \\ 0 & 0 & 0 & \frac{1-2\nu }{2} & 0 & 0 \\ 0 & 0 & 0 & 0 & \frac{1-2\nu }{2} & 0 \\ 0 & 0 & 0 & 0 & 0 & \frac{1-2\nu }{2} \\ \end{pmatrix} \text {,} \nonumber \end{aligned}$$
(47)
$$\begin{aligned} \varvec{\xi }&= \begin{pmatrix} \xi _1 & 0 & 0 \\ 0 & \xi _1 & 0 \\ 0 & 0 & \xi _1 \\ \end{pmatrix} \text {,}&{\mathbf {e}}&= \begin{pmatrix} 0 & 0 & 0 & 0 & e_{15} & 0\\ 0 & 0 & 0 & 0 & 0 & -e_{15} \\ 0 & 0 & 0 & 0 & 0 & 0 \\ \end{pmatrix} \text {,} \nonumber \\ \varvec{\mu }^{-1}&= \begin{pmatrix} \mu _\mathrm {c}^{-1} & 0 & 0 \\ 0 & \mu _\mathrm {c}^{-1} & 0 \\ 0 & 0 & \mu _\mathrm {c}^{-1} \\ \end{pmatrix} \text {,}&\varvec{\kappa }&= \begin{pmatrix} \kappa _1 & 0 & 0 \\ 0 & \kappa _1 & 0 \\ 0 & 0 & \kappa _1 \\ \end{pmatrix} \text {.} \end{aligned}$$
(48)
Fig. 4
figure 4

Periodic RVE with cortical bone phase (gray) and bone marrow phase (transparent red) and lengths parameters

Table 3 Lengths parameter of the different RVEs

We assume linear isotropic material everywhere, excluding the piezoelectric tensor which is preferential in the z-axis due to the longitudinal orientation of the collagen fibers. It should be noted, that due to the form of the piezoelectric tensor, the material model as a whole is non-isotropic.

For the generation of the meshes, we used the program gmsh (Geuzaine and Remacle 2021). We did the visualization of the results with paraview (Paraview 2021) and julia (The julia programming language 2021).

4.2 Microscale model

In this subsection, we restrict ourselves to microscale simulations. In order to compare periodic RVEs for different stages of osteoporosis, we introduce the lengths parameters a and b (Fig. 4), which allow us to control the volume fractions of the phases. By using this convention, the total volume of the RVE is \(V_{\mathrm {RVE}} = (2a+b)^3\). We only use RVEs with the same total volume of \(V_{\mathrm {RVE}} = 1\;\text {mm}^3\), which is a suitable size for the microscale calculations (Ilic et al. 2010), making it easy to compare different RVEs. Thus, the choice of a and b is restricted by \(2a+b=1\;\text {mm}\). The volume fraction of cortical bone for our RVE is \(\rho _{\mathrm {b}}=(6 a b^2 + b^3)/(2a+b)^3\).

In our first example, we use a healthy bone RVE with the parameters \(a=0.32\;\text {mm}\) and \(b=0.36\;\text {mm}\), resulting in \(\rho _{\mathrm {b}}=29.5\%\). We compare different mesh resolutions. The first RVE consists of two elements in each phase block, resulting in six elements for each spatial direction. The second RVE consists of four elements in each block, resulting in twelve elements for each spatial direction. Here, all degrees of freedom for all corner nodes are restricted to zero and all opposite nodes are linked, to guarantee periodicity. Figure 5 shows the results of the simulations.

Fig. 5
figure 5

Microscale simulation results of a coarse and fine mesh (left and right respectively) for all flux quantities. Top left: mechanical stress \(\sigma _{xy}\;[\text {GPa}]\), top right: mechanical stress \(\sigma _{xy}\;[\text {GPa}]\) in the xz-plane with \(y=0\), bottom left: magnitude of the electric displacement field \({\mathbf {D}}\;[\text {As}/\text {m}^2]\), bottom right: magnitude of the magnetic field strength \({\mathbf {H}}\;[\text {A/m}]\)

Fig. 6
figure 6

Used meshes for the complete RVE (left) and only the cortical bone phase (right). a coarse hexahedron mesh, b fine hexahedron mesh, c coarse tetrahedron mesh, d fine tetrahedron mesh

Both simulations show quadratic convergence behavior and periodic results. For all quantities, the results between the two different used meshes look nearly identical confirming mesh independence of the results. This is not only fulfilled on the surface of the model, but also in the inner parts, as the slice (top right) shows. It should be noted that since the \(\text {FE}^2\) method uses volume averaging, the coarse mesh with only six elements in each spatial direction is sufficient enough to create accurate results for the multiscale method and is mostly used in the remaining examples of this paper.

The calculation of the magnetic field strength is susceptible for numerical errors. These errors can occur, when there are sharp edges in the mesh or between the phase transitions, which can amplify the results. To investigate this issue, we constructed smoother RVEs by using tetrahedron elements and different mesh resolutions. Figure 6 shows the used meshes. We found that despite the smoother approach, the numerical results of the RVEs with tetrahedron elements are much worse compared to the RVEs with hexahedron elements, showing worse convergence behavior and overestimating the magnetic field strength. One reason for this result could be that through the mesh refinement, many additional corners are introduced, which in total amplify the magnetic field strength more than a low number of very sharp corners. Moreover, smaller element size leads to amplified singularities of the corresponding fields at corners, which otherwise are regularized by the employed shape functions. Similarly, Fig. 5 shows an increase in the magnetic field strength for the finer mesh resolution of the RVEs with hexahedron elements. In conclusion, the coarse RVE with hexahedron elements shows the best numerical performance despite the low mesh resolution and the included sharp edges.

To compare the model behavior for different stages of osteoporosis, we created RVEs with different volume fractions of cortical bone. Table 3 shows the choice of the lengths parameters and the resulting volume fractions. The macroscopic mechanical stiffness tensor \({\overline{{\mathbb {C}}}} := \frac{\partial {\overline{\varvec{\sigma }}}}{\partial {\overline{\varvec{\varepsilon }}}}\) was now evaluated for all RVEs by applying a small numerical perturbation as discussed in Sect. 3.2. We then calculate the effective Young’s modulus as

$$\begin{aligned} E_{\mathrm {eff}}=\frac{{\overline{{\mathbb {C}}}}_{44} (3 {\overline{{\mathbb {C}}}}_{12} + 2 {\overline{{\mathbb {C}}}}_{44})}{({\overline{{\mathbb {C}}}}_{12} +{\overline{{\mathbb {C}}}}_{44})} \; \text {.} \end{aligned}$$
(49)

Figure 7 shows a plot of the macroscopic Young’s modulus against the volume fraction of cortical bone. Here, we observe a drastical reduction of the macroscopic Young’s modulus with decreasing cortical bone fraction. Compared to a healthy bone (\(\rho _{\mathrm {b}}=29.5\%\)), the effective Young’s modulus of the degenerated bone (\(\rho _{\mathrm {b}}=5.3\%\)) decreases to \(57\%\) (from \(3.89\;\text {GPa}\) to \(2.32\;\text {GPa}\)). Similar results can be found in Ilic et al. (2010).

Fig. 7
figure 7

Effective Young’s modulus \(E_{\mathrm {eff}}\) against cortical bone volume fraction \(\rho _{\mathrm {b}}\) for different RVEs

4.3 Cylinder model

In this section, we show results for a cylinder model, which has a length of \(30\;\text {cm}\) and a diameter of \(2 \; r_o = 3\;\text {cm}\). The mesh and the displacement boundary conditions are shown in Fig. 8. The mesh consists of 1767 nodes and 1440 hexahedral elements. The left and right face is fixed, resulting in the boundary conditions \({\mathbf {u}}= {\varvec{0}}\) on the faces. Additionally, in the inner part of the left face (\(r < r_i = 0.75 \; \text {cm}\)) depicted in Fig. 9, the cylinder is assumed to be grounded, resulting in \(\varphi = 0\) and \({\mathbf {A}}={\varvec{0}}\). We apply a time-dependent mechanical displacement in x-direction \(u_x = u_{\max } \cdot a(t)\) to the middle part of the cylinder and calculate 100 time steps. Figure 10 shows the amplitude of the displacement function a versus the time t.

Fig. 8
figure 8

Cylinder mesh and displacement boundary conditions (red: all directions restricted, orange: only the x-direction restricted, blue-gray: no directions restricted)

Fig. 9
figure 9

Cylinder front in the xy-plane for \(z=0\) with grounded nodes in red

Fig. 10
figure 10

Amplitude of the displacement function a against the time step t

First, we examine the simulation results for the healthy bone (RVE 6, \(\rho _{\mathrm {b}}=29.5\%\)). Here, we observe quadratic convergence behavior for the macroscale as well. Figures 11 and 12 show the magnitude of the average electric displacement field \({\mathbf {D}}\) and the magnitude of the average magnetic field strength \({\mathbf {H}}\), respectively, plotted against time t. The history of the average electric displacement field mimics the displacement boundary condition. Thus, the electric displacement field is caused mainly by the piezoelectric effect of the cortical bone material phase. In contrast, the magnitude of the average magnetic field strength increases until time \(t=50\), where the maximum is reached. Then, the magnitude decreases again and at the end of the simulation, only a small amount of the magnetic field is present. We conclude, that the magnetic field is caused mainly by the time change of the electric displacement field as described by the Maxwell equations.

Fig. 11
figure 11

Magnitude of the average electric displacement field \({\mathbf {D}}\;[\text {As}/\text {m}^2]\), plotted against the time t

Fig. 12
figure 12

Magnitude of the average magnetic field strength \({\mathbf {H}}\;[\text {A}/\text {m}]\), plotted against the time t

To compare the different stages of osteoporosis, we use different RVEs (Table 3). The simulation results are shown in Figs. 13, 14, 15, 16. Here, the number of the specific RVE increases from top to bottom.

As an additional example for the cylinder model, we performed a parameter study for the electric conductivity parameter \(\kappa _1\), aiming to understand the interaction between the time derivative of the electric displacement field and the electric current density in the Maxwell equation. Figures 17 and 18 show the results for RVE 1 and \(\kappa _1 \in \{1 \cdot 10^{2} \; \text {S}/\text {m}, 1 \cdot 10^{4} \; \text {S}/\text {m}, 1 \cdot 10^{6} \; \text {S}/\text {m} \}\).

Fig. 13
figure 13

Simulation results for RVE 1 (top) to 6 (bottom): stress \(\sigma _{xy}\;[\text {GPa}]\), \(t=25\)

Fig. 14
figure 14

Simulation results for RVE 1 (top) to 6 (bottom): magnitude of the electric displacement field \({\mathbf {D}}\;[\text {As}/\text {m}^2]\), \(t=25\)

Fig. 15
figure 15

Simulation results for RVE 1 (top) to 6 (bottom): magnitude of the magnetic field strength \({\mathbf {H}}\; [\text {A}/\text {m}]\), \(t=50\)

Fig. 16
figure 16

Simulation results for RVE 1 (top) to 6 (bottom): magnitude of the electric current density \({\mathbf {J}}\; [\text {A}/\text {m}^2]\), \(t=50\)

Fig. 17
figure 17

Simulation results for RVE 1 for the magnetic field strength \({\mathbf {H}}\; [\text {A}/\text {m}]\) with \(\kappa _1 = 1 \cdot 10^{2} \; \text {S}/\text {m}\) (top), \(\kappa _1 = 1 \cdot 10^{4} \; \text {S}/\text {m}\) (in the middle) and \(\kappa _1 = 1 \cdot 10^{6} \; \text {S}/\text {m}\) (bottom), \(t=50\)

Fig. 18
figure 18

Simulation results for RVE 1 for the electric current density \({\mathbf {J}}\; [\text {A}/\text {m}^2]\) with \(\kappa _1 = 1 \cdot 10^{2} \; \text {S}/\text {m}\) (top), \(\kappa _1 = 1 \cdot 10^{4} \; \text {S}/\text {m}\) (in the middle) and \(\kappa _1 = 1 \cdot 10^{6} \; \text {S}/\text {m}\) (bottom), \(t=50\)

For all quantities, we observe an increase for RVEs with higher volume fractions of cortical bone. Additionally, the difference between the RVEs is greater, the lower the volume fraction of cortical bone is. While the difference is barely noticeable between RVE 5 and 6, the change of all quantities excluding the stress is distinct between RVEs 1 and 2. Qualitatively, we notice similar results between the different RVEs.

Regarding the parameter study of the electric conductivity, we observe nearly identical results for the magnetic field strength \({\mathbf {H}}\) for the first two choices of \(\kappa _1\), but a significant increase for \(\kappa _1 = 1 \cdot 10^{6} \; \text {S}/\text {m}\). Similarly the electric current density \({\mathbf {J}}\) increases proportionally to the increase of the material parameter. Thus, for the first two choices of \(\kappa _1\), nearly no magnetic field and electric current is visible.

Real bones can be highly anisotropic. To investigate possible effects on the simulation results, we constructed an anisotropic RVE, which is longer (Fig. 19) and therefore also is divided into ten instead of six elements in z-direction. We used the parameters \(a=0.29\;\text {mm}\) and \(b=0.42\;\text {mm}\), resulting in a total RVE volume \(V_{\mathrm {RVE}} = 1.58\;\text {mm}^3\) and a volume fraction of cortical bone \(\rho _{\mathrm {b}}=30.6\%\). We compare our calculations to the isotropic RVE 6, which has a similar volume fraction of cortical bone. The results are shown in Figs. 20 and 21. We obtain similar results for both RVE geometries. The calculated stress is slightly higher for the anisotropic RVE. The magnetic field strength is about \(15\%\) increased for the anisotropic RVE compared to the cubic RVE.

Fig. 19
figure 19

Anisotropic RVE with cortical bone phase (gray) and bone marrow phase (transparent red) and lengths parameters

Fig. 20
figure 20

Simulation results for RVE 6 (top) and the anisotropic RVE (bottom) for the stress \(\sigma _{xy}\;[\text {GPa}]\), \(t=25\)

Fig. 21
figure 21

Simulation results for RVE 6 (top) and the anisotropic RVE (bottom) for the magnetic field strength \({\mathbf {H}}\; [\text {A}/\text {m}]\), \(t=50\)

4.4 True to scale bone model

We examine a true to scale model of a human femur bone from Lifescience (2021) and slightly modify it by using the software blender (Blender 2021), improving the mesh. Again the model has a length of about \(30\;\text {cm}\). The mesh and the displacement boundary conditions are shown in Fig. 22. The mesh consists of 1660 nodes and 4944 tetrahedral elements. The grounded nodes are shown in Fig. 23. Again, we apply the mechanical displacement depicted in Fig. 10 to the middle section and calculate 100 time steps. To compare different stages of osteoporosis, we use again different RVEs (Table 3). Figures 24, 25, 26, 27, 28, 29 show the results.

Fig. 22
figure 22

Femur bone mesh and displacement boundary conditions (red: all directions restricted, orange: only the x-direction restricted, blue-gray: no directions restricted)

Fig. 23
figure 23

Femur bone front with grounded nodes in red

Fig. 24
figure 24

Simulation results for RVE 1 (top) to 6 (bottom): stress \(\sigma _{xy} \; [\text {GPa}]\), \(t=25\)

Fig. 25
figure 25

Simulation results for RVE 1 (top) to 6 (bottom): magnitude of the electric displacement field \({\mathbf {D}}\; [\text {As}/\text {m}^2]\), \(t=25\)

Fig. 26
figure 26

Simulation results for RVE 1 (top) to 6 (bottom): magnitude of the magnetic field strength \({\mathbf {H}}\; [\text {A}/\text {m}]\), \(t=50\)

Fig. 27
figure 27

Simulation results for RVE 1 (top) to 6 (bottom): magnitude of the electric current density \({\mathbf {J}}\; [\text {A}/\text {m}^2]\), \(t=50\)

Fig. 28
figure 28

Simulation results for RVE 1 (top) to 6 (bottom): magnitude of the magnetic field strength \({\mathbf {H}}\; [\text {A}/\text {m}]\), slice, \(t=50\)

Fig. 29
figure 29

Simulation results for RVE 1 (top) to 6 (bottom): magnitude of the electric current density \({\mathbf {J}}\; [\text {A}/\text {m}^2]\), slice, \(t=50\)

Again, the simulations show qualitatively similar results, but a significant increase for all quantities the higher the cortical bone volume fraction is. Compared to the cylinder model, we receive slightly higher numerical values, which lie in the same magnitudes. The reason for this is most likely the used mesh, which has sharper corners due to the geometry of bone. Additionally, tetrahedron elements usually perform worse compared to hexahedron elements. The difference between the RVEs is smaller the higher the volume fraction of cortical bone is. Thus, both the functionality of the bone and the results of the sonography are only slightly affected at earlier stages of osteoporosis, but significantly at later ones. This confirms the disease as being often imperceptible for many subjects at earlier stages. This is especially important regarding the magnetic field strength \({\mathbf {H}}\), as it is the quantity measured at sonography-aided early detection. To further examine the results, we calculate the average and maximum magnetic field strength \({\mathbf {H}}\) at time step \(t=50\) for the different RVEs. The results are shown in Figs. 30 and 31.

Fig. 30
figure 30

Average magnetic field strength for the different RVEs at \(t=50\)

Fig. 31
figure 31

Maximum magnetic field strength for the different RVEs at \(t=50\)

Here, for both quantities a similar behavior can be observed. While there is nearly no reduction between the two RVEs with the highest volume fraction of cortical bone, the difference between the single RVEs increases for lower volume fractions of cortical bone. The average magnetic field strength reduces for the ill bone (\(\rho _{\mathrm {b}}=5.3\%\)) to \(36.5\%\) compared to the healthy bone (\(\rho _{\mathrm {b}}=29.5\%\)), from \(3.14 \cdot 10^{-7} \; \text {A}/\text {m}\) to \(1.15 \cdot 10^{-7} \; \text {A}/\text {m}\). The maximum magnetic field strength for the healthy bone is \(2.711 \cdot 10^{-6} \; \text {A}/\text {m}\), while the maximum for the degenerated bone is only \(1.038 \cdot 10^{-6} \; \text {A}/\text {m}\). This equals a reduction to \(38.2\%\). These results show the order of magnitude to be expected for the results of experimental research. For advanced stages of osteoporosis, sonography should measure a magnetic field strength, whose magnitude is only about one third compared to a healthy bone.

5 Conclusion and outlook

In this contribution, we present a fully coupled multiscale model for cancellous bone considering mechanical, electric and magnetic effects. We model bone as a two-phase material with the cortical bone phase assumed as a piezoelectric, insulating solid and the bone marrow phase described as a viscoelastic, conducting solid. Electric and magnetic effects are coupled via the Maxwell equations. Based on energy methods in mechanics, we establish a thermodynamically consistent material model and derive the weak and strong form of the microscale boundary value problem.

In order to solve the macroscale problem, we create an RVE and apply the FEM to solve the problem numerically. For the time integration of the FEM, we use a JWH-\(\alpha\)-scheme (Kadapa et al. 2017). The numerical simulations on the microscale show mesh independence and quadratic convergence. For finer mesh resolutions or smoother geometries of the phases, the model tends to overestimate the magnetic field strength. Additionally, we show that the effective Young’s modulus of the RVE depends strongly on the volume fraction of the different phases. Here, we find a reduction by \(43\%\) for the degenerated bone (\(\rho _{\mathrm {b}}=5.3\%\)) compared to the healthy bone (\(\rho _{\mathrm {b}}=29.5\%\)), achieving similar results as in Ilic et al. (2010).

For the multiscale calculations, we use \(\text {FE}^2\) and apply periodic boundary conditions and volume averaging for the transition between the scales. We apply a time-dependent displacement boundary condition. The macroscopic cylinder model again shows quadratic convergence. To compare different stages of osteoporosis with a healthy bone, we create six different RVEs with different volume fractions of cortical bone phase and run calculations for all RVEs. The simulations show a strong reduction of all quantities with decreasing volume fraction of cortical bone phase. The differences between the healthy bone RVE (\(\rho _{\mathrm {b}}=29.5\%\)) and a slightly degenerated bone (\(\rho _{\mathrm {b}}=24.2\%\)) are very small, while the differences in the later stages of the illness, (\(\rho _{\mathrm {b}}=10.4\%\) compared to \(\rho _{\mathrm {b}}=5.3\%\)), increase drastically. To examine the interaction between the time derivative of the electric displacement field and the electric current density in the Maxwell equation, we perform a parameter study regarding the electric conductivity parameter \(\kappa _1\). Here, the results show a significant increase of the electric current density and the magnetic field strength with increasing \(\kappa _1\). To investigate the effect of anisotropy on the model, we compared our cubic RVE with an anisotropic cuboid RVE. Depending on the used RVE geometry, the results can vary slightly.

As a final example, we apply our model to a true to scale model of a human femur bone. Here, the results show again a similar behavior for all quantities. Between the two RVEs with the highest volume fraction of cortical bone phase, nearly no reduction of the magnetic field strength can be observed. With decreasing \(\rho _{\mathrm {b}}\), the differences grow increasingly larger. Compared to the healthy bone (\(\rho _{\mathrm {b}}=29.5\%\)), the bone with late stage osteoporosis (\(\rho _{\mathrm {b}}=5.3\%\)) shows a drastic reduction of the magnetic field strength by nearly two thirds. These results show, in which order of magnitude differences between healthy and degenerated bones can be expected, when performing experimental research and sonography for the purpose of early detection of osteoporosis.

For future research, we aim to solve the inverse problem by using an Artificial Neural Network to predict simulation outputs for random microstructures. Here, the network should recover the distribution of cortical bone phase in the macroscopic model from the magnetic field data, thus diagnosing the state of the bone. Additionally, wave propagation in cancellous bone will be investigated in more detail. The comparison of experimental with simulation results could provide further insights. Accurate material parameters could be obtained from the experiments, which then could be used for the simulations. To make precise predictions for experimental setups, it is of great importance to address possible numerical problems of the simulations. The used RVEs have a very coarse mesh resolution and contain sharp edges. While our investigations so far show, that the coarse RVE with hexahedron elements performs best, it is still relevant to investigate in detail how the magnetic field strength is affected for different, smoother RVEs, which model the microstructure of bone in a more realistic way. Another important aspect is to investigate the microscale behavior for RVEs which differ in size and structure of the phases. Depending on the geometry of the used RVE, the simulation results can vary. Thus, for the future we plan to investigate this effect in detail. The usage of different function spaces could improve the results. Finally, our macroscopic models could be extended to include a surrounding medium like air or water, allowing proper decay of the magnetic field.