import ChemPlugin.*; // import ChemPlugin and CpiLink class import java.io.*; import java.util.Scanner; class Advection1 { public static void main(String[] args) throws IOException { System.out.println("Model advection-dispersion in one dimension"); System.out.println(""); //Simulation parameters int nx = 400; // number of instances along x double length = 100; // m double deltax = length / nx; double deltay= 1.0, deltaz = 1.0; double porosity = 0.25; System.out.print("Please enter fluid velocity in m/yr: "); Scanner input = new Scanner(System.in); double veloc_in = input.nextDouble(); input.nextLine(); double velocity = veloc_in / 31557600; // m/s 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 time_end = 10.0; // years double delta_years = time_end / 5.0; // years double next_output = 0.0; //years // Open output file and write instance positions on the first line String file = "Advection.txt"; FileWriter fileWriter = new FileWriter(file); BufferedWriter bufferedWriter = new BufferedWriter(fileWriter); bufferedWriter.write("years"); for (int i=0; i