Solving Diffusion Equation By Finite difference Method in fortran

In summary: You can find the points on the hemisphere by looking at the equation and trying to find the points where the boundary conditions are satisfied.
  • #1
cool2shiv
5
0
Hey,
I want to solve a parabolic PDE with boundry conditions by using FINITE DIFFERENCE METHOD in fortran. (diffusion) See the attachment for the problem

The problem is that there is a droplet on a leaf and it is diffusing in the leaf
the boundry conditions are
dc/dn= 0 at the upper surface of drop as well as the leaf
and
dc/dz = 0
for the bottom most layer
and the width is taken very large

Can anyone help me please in making the grid for using FDM
the Droplet is not hemispherical in shape.
 

Attachments

  • figure problem.JPG
    figure problem.JPG
    40.2 KB · Views: 583
Physics news on Phys.org
  • #2
What is dc/dn? From your equation you have three independent variables: z, r, and t.

Edit: Oh silly me I get it sorry.
 
  • #3
the flux perpendicular to the surface of the drop is zero.
So, have you any idea what should i do?
 
  • #4
you can generate the meshes as all rectangles of different sizes, in matlab, FORTRAN, c++, etc. Just set up a 3-D matrix to account for changes in time, r,z. You can then discretize the equation via finite difference from that to go from there. Talk to me if you need additional help.
 
  • #5
Hey thanks a lot... but how will i use the boundary condition on the curved surface i.e dc/dn=0
i.e flux perpendicular to droplet is 0.

for that i think i will need the points on the surface of the droplet (not hemisphere) and the point which is on the line perpendicular to the surface of the droplet...

please tell me how to make grid... and how to use the boundary condition dc/dn=0

i will be thankful to u for this.
 
  • #6
cool2shiv said:
Hey thanks a lot... but how will i use the boundary condition on the curved surface i.e dc/dn=0
i.e flux perpendicular to droplet is 0.

for that i think i will need the points on the surface of the droplet (not hemisphere) and the point which is on the line perpendicular to the surface of the droplet...

please tell me how to make grid... and how to use the boundary condition dc/dn=0

i will be thankful to u for this.

model everything as a bunch of rectangles.. hemisphere is small rectangle on top of the other two rectanges.. simply the bc, dc/dn=0 at the hemisphere/rectangle or that C(i+1,j)-C(i,j)/(delta(x)=0, so C(i+1,j)=C(i,j) at the hemisphere barrier... meshes can be made by filling up matrices with zeroes and making these matrices based on size of rectangle e.g. 5 m X 5 m rectangle can be a 5 X 5 matrix, if the units are "m".. get my drift? do the same with the other rectangles, keeping respect to orientation and size and keep everything in one mesh?

Ok?
 
  • #7
yeah that is fine..but How will i find the points on the hemisphere?
i mean how will i make sure that the corners of the rectangles fall on the hemisphere??
as i can only fond the values at the corners of a rectangle?
Did u get what i am trying to ask?
 

1. What is the diffusion equation?

The diffusion equation is a mathematical representation of the process of diffusion, which is the gradual movement of particles from an area of higher concentration to an area of lower concentration. It is used to describe a wide range of physical phenomena, from the spread of heat and chemicals to the movement of biological molecules.

2. What is the finite difference method?

The finite difference method is a numerical technique used to solve differential equations, such as the diffusion equation. It involves discretizing the domain into a finite number of grid points and approximating the derivatives in the equations using finite differences. This allows for the equations to be solved using algebraic equations instead of analytical solutions.

3. Why is fortran commonly used for solving diffusion equations using the finite difference method?

Fortran is a high-level programming language that was specifically designed for scientific computing. It has efficient array operations and supports the use of pointers, which are important for implementing the finite difference method. Additionally, many libraries and resources for solving differential equations using fortran are readily available, making it a popular choice for scientists and engineers.

4. What are the limitations of solving diffusion equations by the finite difference method?

The finite difference method requires the domain to be discretized, which means that small changes in the grid size or location can significantly affect the accuracy of the solution. This can be a limitation when dealing with complex geometries or when high precision is required. Additionally, the method may not be suitable for solving equations with certain boundary conditions or when the diffusion coefficient varies significantly throughout the domain.

5. How can the accuracy of the solution obtained by the finite difference method be improved?

The accuracy of the solution can be improved by using a finer grid, which can capture more detail in the solution. Another approach is to use higher-order finite difference schemes, which can reduce the error associated with the approximation of derivatives. Additionally, adaptive mesh refinement techniques can be used to focus the grid points in regions where the solution is changing rapidly, improving the overall accuracy of the solution.

Similar threads

Replies
1
Views
6K
Replies
0
Views
418
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Calculus and Beyond Homework Help
Replies
7
Views
966
Replies
4
Views
706
Replies
8
Views
2K
Replies
1
Views
933
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
Replies
1
Views
1K
Back
Top