TugJulia/julia/tests/julia_bench/BTCS_1024_1000_100.jl
2023-11-21 16:41:41 +01:00

42 lines
1.2 KiB
Julia

include("../../tug/Simulation.jl")
function main()
# **** GRID ****
rows::Int = 1024
cols::Int = 1000
alphaX = fill(1.25, rows, cols)
alphaY = fill(1.1, rows, cols)
alphaX[1:100, :] .= 0.5
alphaX[101:200, :] .= 0.8
alphaY[:, 1:200] .= 0.6
alphaY[:, 201:400] .= 0.9
grid::Grid = Grid{Float64}(rows, cols, alphaX, alphaY)
concentrations = fill(0.5, rows, cols)
concentrations[11, 11] = 15000
concentrations[1015, 991] = 7500
concentrations[11, 991] = 7500
concentrations[1015, 11] = 7500
setConcentrations!(grid, concentrations)
# **** BOUNDARY ****
bc::Boundary = Boundary(grid)
setBoundarySideClosed!(bc, LEFT)
setBoundarySideClosed!(bc, RIGHT)
setBoundarySideClosed!(bc, TOP)
setBoundarySideClosed!(bc, BOTTOM)
# **** SIMULATION ****
simulation::Simulation = Simulation(grid, bc)
simulation = setTimestep(simulation, 0.01)
simulation = setIterations(simulation, 100)
simulation = setOutputConsole(simulation, CONSOLE_OUTPUT_OFF)
simulation = setOutputCSV(simulation, CSV_OUTPUT_ON)
# **** RUN SIMULATION ****
print((@elapsed run(simulation)) * 1e9)
end
main()