- #1

- 1

- 1

Hi everyone,

I am working on the Fortran code to solve a magnetic field by using "Floating Random Walk" method.

I use a square domain for this case and show in the attachment. The external magnetic strength comes from left to right boundary.

Both top and bottom are assuming as insulation boundaries. I need some expert to help me to check if I the boundary conditions is a correct set up. Thanks!

I am working on the Fortran code to solve a magnetic field by using "Floating Random Walk" method.

I use a square domain for this case and show in the attachment. The external magnetic strength comes from left to right boundary.

Both top and bottom are assuming as insulation boundaries. I need some expert to help me to check if I the boundary conditions is a correct set up. Thanks!

Fortran:

```
IF (X >= (10.0-ER)) THEN ! BOUNDARY ON RIGHT
SUM = SUM + 0.0
GO TO 20
ELSE
END IF
IF (Y >= (10.0-ER)) THEN ! BOUNDARY ON TOP
SUM = SUM + 0.0
GO TO 20
ELSE
END IF
IF ((X < ER) .AND. (Y < 10)) THEN ! BOUNDARY ON LEFT
SUM = SUM + 2.0 ! {MAGNETIC STRENGTH}
GO TO 20
ELSE
END IF
IF ((X > ER) .AND. (X <=10.0-ER) .AND. (Y < ER)) THEN ! BOUNDARY ON BOTTOM
SUM = SUM + 0.0
GO TO 20
ELSE
END IF
20 CONTINUE
```