import ChemPlugin.*; import java.io.*; import java.util.Scanner; public class HeatTransfer1 { public static void main(String[] args) throws IOException { System.out.println("Model heat transfer in one dimension"); System.out.println(""); //Simulation parameters int nx = 400; // number of instances along x double length = 100; // m double deltax = length / nx; // m double deltay= 1.0, deltaz = 1.0; double porosity = 0.25; // volume fraction double tcond = 2.0; // W/m/K double trans = deltay * deltaz * tcond / deltax; // W/K 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 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 = "HeatTransfer.txt"; FileWriter fileWriter = new FileWriter(file); BufferedWriter bufferedWriter = new BufferedWriter(fileWriter); bufferedWriter.write("years"); for (int i=0; i