diff --git a/include/cantera/oneD/Sim1D.h b/include/cantera/oneD/Sim1D.h index 40f147f134..928624a767 100644 --- a/include/cantera/oneD/Sim1D.h +++ b/include/cantera/oneD/Sim1D.h @@ -41,7 +41,14 @@ class Sim1D : public OneDim */ //@{ - /// Set initial guess based on equilibrium + /// Set initial guess for one component for all domains + /** + * @param comp component name + * @param pos A vector of relative positions, beginning with 0.0 at the + * left of the domain, and ending with 1.0 at the right of the domain. + * @param values A vector of values corresponding to the relative position + * locations. + */ void setInitialGuess(const std::string& component, vector_fp& locs, vector_fp& vals); diff --git a/src/oneD/Sim1D.cpp b/src/oneD/Sim1D.cpp index e4224eb975..7639087e99 100644 --- a/src/oneD/Sim1D.cpp +++ b/src/oneD/Sim1D.cpp @@ -71,6 +71,11 @@ doublereal Sim1D::workValue(size_t dom, size_t comp, size_t localPoint) const void Sim1D::setProfile(size_t dom, size_t comp, const vector_fp& pos, const vector_fp& values) { + if (pos.front() != 0.0 || pos.back() != 1.0) { + throw CanteraError("Sim1D::setProfile", + "`pos` vector must span the range [0, 1]. Got a vector spanning " + "[{}, {}] instead.", pos.front(), pos.back()); + } Domain1D& d = domain(dom); doublereal z0 = d.zmin(); doublereal z1 = d.zmax();