#include #include #include #include #include "ChemPlugin.h" int exit_client(int status) { std::cin.get(); return status; } void open_input(std::ifstream& input, int argc, char** argv) { while (!input.is_open()) { std::string filename; if (argc < 2) { std::cout << "Enter RTM input script: "; std::cin >> filename; std::cin.ignore(); } else { filename = argv[1]; } input.open(filename); if (!input.is_open()) std::cerr << "The input file does not exist" << std::endl; } } void write_results(ChemPlugin *cp, int nx, double gap, double& then) { double now = cp[0].Report1("Time", "years"); if ((then - now) < gap / 1e4) { for (int i=0; i> veloc_in; std::cin.ignore(); std::cout << std::endl; double velocity = veloc_in / 31557600.; // m/s double porosity = cp[0].Report1("porosity"); // volume fraction double flow = deltay * deltaz * porosity * velocity; // m3/s double diffcoef = 1e-10; // m2/s double dispersivity = 1.0; // m double dispcoef = velocity * dispersivity + diffcoef; // m2/s double trans = deltay * deltaz * porosity * dispcoef / deltax; // m3/s double tcond = 2.0; // W/m/K double ttrans = deltay * deltaz * tcond / deltax; // W/K // Link the instances. CpiLink link = cp[0].Link(cp_inlet); link.Transmissivity(trans, "m3/s"); link.HeatTrans(ttrans, "W/K"); link.FlowRate(flow, "m3/s"); for (int i=1; i