Chemical Engineering


Pafko Unit Conversions (pafkoUNC.xls/xla)

Add unit conversion capabilities right into Excel! Compound & custom units supported. Complete VBA source code included. Best of all, it's FREE! Once you start using it you won't be able to stop...

pafkoUNC.xls (Excel, 220k)

To Get Started: Enter a number in a cell. Select that cell. Then run the macro "ApplyUnits()" to add units (press Ctrl+Shift+U). Use the function "Convert(source)" to convert from the source cell units to the destination cell units. Note: When loaded as an excel file you will need to call the function as "pafkoUNC.xls!Convert(source)".

To add your own custom units unhide the sheet (Windows/Unhide) then add your units in the "units" sheet of pafkoUNC.xls.

If you like it, just add it to your XLSTART folder & it will load everytime excel starts.


Transient 1D Conductive Heat Transfer

Mathcad file that calculates transient conduction in a slab using a finite difference algorithm.

wmp_finite_difference.mcd (Mathcad 8+), wmp_finite_difference.pdf (Acrobate)


Heat & Mass Transfer 'C' Code

The following c code solves transient heat & mass transfer problems. They are relatively straightforward, however the code has several special features:

  1. The macro IF(A,B,C) converts an excel IF statement into some equivelent c code. This is a very handy trick. Using this method, thermal conductivity, density, & heat capacity can all be functions of temperature, time, and position while still using a simple and straightforward solution method.
  2. During execution the c code appends itself onto the end of the solution file. Therefore, the output contains not only the solution, but the code which produced that solution. This is very helpful in documenting results. It is done by using the __FILE__ precompiler definition.

Here's the code (just remove the .txt extension, change the defines to match your problem, compile, & execute)...

  • Transient conductive heat transfer in a slab wtih fixed temperature boundary conditions (Dirichlet). hx1Dvs.c.txt
  • Transient mass transfer via Fickian diffusion in a slab with fixed moisture boundary conditions (Dirichlet). mx1Dvs.c.txt (moisture sink at walls), mx1Dvsi.c.txt (insulated walls).

Compile with Microsoft Visual C++ v4.0 or higher.


pafko.com / wayne / engineer

© 2001 Wayne Pafko (pafko@excite.com).