Modeling for Powder Compaction and Flow in the Thermal or Magnetic Fields