svZeroDSolver
Loading...
Searching...
No Matches
SphereMaterial.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Stanford University, The Regents of the
2// University of California, and others. SPDX-License-Identifier: BSD-3-Clause
3
4/**
5 * @file SphereMaterial.h
6 * @brief Material models for the ChamberSphere block
7 */
8
9#ifndef SVZERODSOLVER_MODEL_SPHEREMATERIAL_HPP_
10#define SVZERODSOLVER_MODEL_SPHEREMATERIAL_HPP_
11
12#include <memory>
13#include <string>
14#include <vector>
15
16#include "Parameter.h"
17#include "ParameterHolder.h"
18
19/**
20 * @brief Return type for SphereMaterial::compute
21 *
22 * Bundles the nonlinear residual contribution and its derivatives that
23 * appear in the spherical-stress equation of ChamberSphere.
24 */
26 double C_val; ///< Residual contribution to C vector
27 double dC_dy_radius; ///< Derivative w.r.t. radius
28};
29
30/**
31 * @brief Base class for spherical chamber wall materials
32 *
33 * Subclasses implement the material-specific elastic stress term in the
34 * spherical stress equation:
35 * \f[
36 * -S + \tau + S_\text{sl}(r, r_0) = 0
37 * \f]
38 */
40 public:
41 /**
42 * @brief Construct a SphereMaterial
43 *
44 * @param props Parameter name/spec pairs for this material type
45 */
47 const std::vector<std::pair<std::string, InputParameter>>& props);
48
49 /**
50 * @brief Compute material stress contributions at the current state
51 *
52 * @param radius Radius perturbation \f$r\f$
53 * @param radius0 Reference radius \f$r_0\f$
54 * @return SphericalStressResult
55 */
56 virtual SphericalStressResult compute(double radius,
57 double radius0) const = 0;
58
59 /**
60 * @brief Factory: create a material from a type string
61 *
62 * @param type_str One of: "mooney_rivlin", "exponential"
63 * @return Unique pointer to the created material
64 */
65 static std::unique_ptr<SphereMaterial> create(const std::string& type_str);
66};
67
68/**
69 * @brief Mooney–Rivlin material (reduces to neo-Hookean for W2=0)
70 *
71 * Implements:
72 * \f[
73 * f = 4(1 - C^{-3})(W_1 + C W_2)
74 * \f]
75 *
76 * Parameters: `W1`, `W2`
77 */
78class MooneyRivlinMaterial : public SphereMaterial {
79 public:
80 MooneyRivlinMaterial()
81 : SphereMaterial({{"W1", InputParameter()}, {"W2", InputParameter()}}) {}
82
83 SphericalStressResult compute(double radius, double radius0) const override;
84};
85
86/**
87 * @brief Exponential material
88 *
89 * Implements the exponential strain-energy density:
90 * \f[
91 * W_1(r) = C_0 \exp(C_1 [I_{1,\text{iso}}]^2),\quad
92 * W_4(r) = C_2 \exp(C_3 [I_{4,\text{iso}}]^2)
93 * \f]
94 *
95 * Parameters: `C0`, `C1`, `C2`, `C3`
96 */
97class ExponentialMaterial : public SphereMaterial {
98 public:
99 ExponentialMaterial()
100 : SphereMaterial({{"C0", InputParameter()},
101 {"C1", InputParameter()},
102 {"C2", InputParameter()},
103 {"C3", InputParameter()}}) {}
104
105 SphericalStressResult compute(double radius, double radius0) const override;
106};
107
108#endif // SVZERODSOLVER_MODEL_SPHEREMATERIAL_HPP_
model::Parameter source file
Common base for chamber sub-components configured from input parameters.
SphericalStressResult compute(double radius, double radius0) const override
Compute material stress contributions at the current state.
Definition SphereMaterial.cpp:45
SphericalStressResult compute(double radius, double radius0) const override
Compute material stress contributions at the current state.
Definition SphereMaterial.cpp:25
ParameterHolder(const std::vector< std::pair< std::string, InputParameter > > &props)
Construct a ParameterHolder.
Definition ParameterHolder.cpp:5
virtual SphericalStressResult compute(double radius, double radius0) const =0
Compute material stress contributions at the current state.
SphereMaterial(const std::vector< std::pair< std::string, InputParameter > > &props)
Construct a SphereMaterial.
Definition SphereMaterial.cpp:9
static std::unique_ptr< SphereMaterial > create(const std::string &type_str)
Factory: create a material from a type string.
Definition SphereMaterial.cpp:13
InputParameter(bool is_optional=false, bool is_array=false, bool is_number=true, double default_val=0.0)
Handles input parameters.
Definition Parameter.h:114
Return type for SphereMaterial::compute.
Definition SphereMaterial.h:25
double C_val
Residual contribution to C vector.
Definition SphereMaterial.h:26
double dC_dy_radius
Derivative w.r.t. radius.
Definition SphereMaterial.h:27