不需要兼容旧版6个参数

feature/Model-20260625
lvjunjie 4 weeks ago
parent 5e731a3a3b
commit 2ede9c2410

@ -87,7 +87,7 @@ namespace RunnerIO
std::cerr << "RunnerIO::readParamsBin: header read failed\n";
return false;
}
if (magic != MAGIC || (ver != 1 && ver != 2))
if (magic != MAGIC || ver != 2)
{
std::cerr << "RunnerIO::readParamsBin: magic/version mismatch\n";
return false;
@ -98,12 +98,7 @@ namespace RunnerIO
if (!readDouble(fs, out.wellboreC)) return false;
if (!readDouble(fs, out.phi)) return false;
if (!readDouble(fs, out.h)) return false;
out.hasCt = false;
out.Ct = 0.0;
if (ver >= 2) {
if (!readDouble(fs, out.Ct)) return false;
out.hasCt = true;
}
if (!readDouble(fs, out.Ct)) return false;
if (!readDouble(fs, out.Cf)) return false;
out.sectionIndex = 0;

@ -13,7 +13,6 @@ struct RunnerParams
double h;
double Ct;
double Cf;
bool hasCt;
// optional schedule extension
uint32_t sectionIndex; // wellFlowSectionIndex
@ -21,7 +20,7 @@ struct RunnerParams
std::vector<double> q; // m^3/d
RunnerParams()
: k(0), skin(0), wellboreC(0), phi(0), h(0), Ct(0), Cf(0), hasCt(false), sectionIndex(0)
: k(0), skin(0), wellboreC(0), phi(0), h(0), Ct(0), Cf(0), sectionIndex(0)
{}
};

@ -130,7 +130,7 @@ static void applySampledParamsAndMaybeOverrideRate(HX_NWTM_MODEL_INPUT& in, cons
std::fill(in.Base.k.begin(), in.Base.k.end(), p.k);
std::fill(in.Base.phi.begin(), in.Base.phi.end(), p.phi);
std::fill(in.Base.h.begin(), in.Base.h.end(), p.h);
if (p.hasCt) in.Base.Cti = p.Ct;
in.Base.Cti = p.Ct;
in.Base.Cf = p.Cf;
// 制度覆盖params.bin 带 schedule 才覆盖

Loading…
Cancel
Save