#
# Copyright (c) 2023 CIDETEC Energy Storage.
#
# This file is part of cideMOD.
#
# cideMOD is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from pydantic import BaseModel, validator
from cideMOD.models import register_model_options
from cideMOD.models.model_options import BaseModelOptions
from cideMOD.models.PXD.base_model import BasePXDModelInputs
from cideMOD.models.PXD.degradation.SEI.solvent_diffusion import __model_name__
[docs]
@register_model_options(__model_name__)
class DiffusionSEIModelOptions(BaseModel):
"""
SEI model: solvent-diffusion
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sei_particle_order: int
Order of spectral finite elements interpolation in particle.
Defaults to 2
"""
sei_particle_order: int = 2
[docs]
@validator("sei_particle_order")
def validate_particle_order(cls, v):
if v <= 0:
raise ValueError("Particle order must be a non-zero positive integer")
return v
__cell_parameters__ = {
'porous': {
'reference_voltage': {'aliases': ['referenceVoltage']},
'charge_transfer_coefficient': {'default': 0.5, 'is_optional': True,
'aliases': ['chargeTransferCoefficient']},
'solvent_diffusion': {'aliases': ['solventDiffusion']},
'solvent_porosity': {'aliases': ['solventPorosity']},
'solvent_surf_concentration': {'aliases': ['solventSurfConcentration']},
'rate_constant': {'aliases': ['rateConstant']}
}
}