https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: 55cb22f7d84f062764018329a0c1a7650a6b66a8 authored by Thomas Nagel on 15 July 2021, 15:35:31 UTC
Merge branch 'MCAS_Aniso' into 'master'
Tip revision: 55cb22f
CreateSpecificFluidHeatCapacityModel.cpp
/**
 *  \brief A function for creating a specific heat capacity model for fluid
 *
 *  \copyright
 *   Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *              Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 *
 *   \file
 */

#include "CreateSpecificFluidHeatCapacityModel.h"

#include "BaseLib/ConfigTree.h"
#include "BaseLib/Error.h"
#include "MaterialLib/Fluid/ConstantFluidProperty.h"
#include "MaterialLib/Fluid/FluidProperty.h"

namespace MaterialLib
{
namespace Fluid
{
std::unique_ptr<FluidProperty> createSpecificFluidHeatCapacityModel(
    BaseLib::ConfigTree const& config)
{
    //! \ogs_file_param{material__fluid__specific_heat_capacity__type}
    auto const type = config.getConfigParameter<std::string>("type");

    if (type == "Constant")
    {
        return std::make_unique<ConstantFluidProperty>(
            //! \ogs_file_param{material__fluid__specific_heat_capacity__Constant__value}
            config.getConfigParameter<double>("value"));
    }
    // TODO: add more models

    OGS_FATAL(
        "The specific heat capacity type {:s} is unavailable.\n"
        "The available type is \n\tConstant\n",
        type.data());
}

}  // namespace Fluid
}  // namespace MaterialLib
back to top