polytropic.hpp serif/eos/relations/relations.hpp serif/dimensions/type_alias.hpp serif/dimensions/partial.hpp src/compile_time_checks/serif/eos/consumers_meanfield.cpp src/compile_time_checks/serif/eos/evaluation.cpp src/compile_time_checks/serif/eos/models/traits.cpp src/compile_time_checks/serif/eos/runtime/details.cpp src/compile_time_checks/serif/eos/runtime/views.cpp src/compile_time_checks/serif/geometry/surface.cpp src/compile_time_checks/serif/geometry/surface_boundary.cpp src/compile_time_checks/serif/operators/serial_backend.cpp src/include/serif/equations/barotropic_closure.hpp src/include/serif/equations/pressure_force.hpp src/lib/serif/eos/models/polytropic.cpp serif::eos::models::PolytropeParameters serif::eos::models::Polytrope serif serif::eos serif::eos::models File containing the Polytropic equation of state. Emily M. Boudreaux #pragmaonce #include"serif/eos/relations/relations.hpp" #include"serif/dimensions/type_alias.hpp" #include"serif/dimensions/partial.hpp" namespaceserif::eos::models{ structPolytropeParametersfinal{ doublen; doubleK; }; /* ** *@briefAclassrepresentingapolytropicequationofstate. * *@noteThepolytropicequationofstateisdefinedbytherelationP=K*rho^(1+1/n),wherePisthepressure,rhoisthedensity,Kisthepolytropicconstant,andnisthepolytropicindex. * *@noteTheideahere(andwithallEOS)isthatweforcethedeveloper/implementertoenumerateallthethermodynamicrelationsthattheEOSsupportsexplicitly. *Thisisasmallamountofboilerplate;however,itenableseffectivelyafullyautomatic,compiletimeresolution,ofwhichEOSarevalidforparticularparts *ofthecodeandwhicharenot.MuchoftheEOSsystemtheseclassesdependon(relations,models,thesysteminevaluation)arealltheretoallowforthe *compile-timecheckingoftheEOSmodelanditsrelationsandtoallowthedevelopercross-sectionofthattobelimitedtodefiningthisrelationcatalog.Every *EOSimplementedshouldstart(attheverytopoftheclasswithaRelationsaliasinthepublicsectionoftheclass.AnyEOSthatdoesnothavethis *willnotcompile. */ classPolytropefinal{ public: usingRelations=relations::RelationCatalog< relations::PressureFromDensity, relations::PressureFromSpecificEnthalpy, relations::SpecificEnthalpyFromDensity, relations::SpecificEnthalpyFromPressure, relations::DensityFromSpecificEnthalpy >; explicitPolytrope(constPolytropeParameters&parameters); explicitPolytrope(doublen,doubleK); [[nodiscard]]doublepolytropic_index()constnoexcept; [[nodiscard]]doublepolytropic_constant()constnoexcept; [[nodiscard]]doubleenthalpy_scale()constnoexcept; //NotehowweneedanevaluateforeachrelationthattheEOSsupports. [[nodiscard]]dimensions::PressureValueevaluate(relations::PressureFromDensity/*relation*/,dimensions::DensityValuedensity)const; [[nodiscard]]dimensions::PressureValueevaluate(relations::PressureFromSpecificEnthalpy/*relation*/,dimensions::SpecificEnthalpyValuespecific_enthalpy)const; [[nodiscard]]dimensions::SpecificEnthalpyValueevaluate(relations::SpecificEnthalpyFromDensity/*relation*/,dimensions::DensityValuedensity)const; [[nodiscard]]dimensions::SpecificEnthalpyValueevaluate(relations::SpecificEnthalpyFromPressure/*relation*/,dimensions::PressureValuepressure)const; [[nodiscard]]dimensions::DensityValueevaluate(relations::DensityFromSpecificEnthalpy/*relation*/,dimensions::SpecificEnthalpyValuespecific_enthalpy)const; [[nodiscard]]dimensions::PartialDerivative<dimensions::MassDensity, dimensions::SpecificEnthalpy>partial_derivative( relations::DensityFromSpecificEnthalpy/*relation*/, dimensions::WithRespectTo<dimensions::SpecificEnthalpy>/*with_respect_to*/, dimensions::SpecificEnthalpyValuespecific_enthalpy )const; [[nodiscard]]dimensions::PartialDerivative<dimensions::Pressure, dimensions::SpecificEnthalpy>partial_derivative( relations::PressureFromSpecificEnthalpy/*relation*/, dimensions::WithRespectTo<dimensions::SpecificEnthalpy>/*with_respect_to*/, dimensions::SpecificEnthalpyValuespecific_enthalpy )const; [[nodiscard]]dimensions::PartialDerivative<dimensions::Pressure, dimensions::MassDensity>partial_derivative( relations::PressureFromDensity/*relation*/, dimensions::WithRespectTo<dimensions::MassDensity>/*with_respect_to*/, dimensions::DensityValuedensity )const; private: doublem_polytropic_index; doublem_polytropic_constant; doublem_enthalpy_scale; }; }