[table of contents] [master index] [comments] [modules] [programs] [variables] [types] [procedures]
PURPOSE
Defines module variables that describe the chemistry of a polymer mixture, including information about monomers, interactions, chain structure, solvent molecules, and composition of the mixture. Subroutines to input and output chemistry data
SOURCE
module chemistry_mod use const_mod implicit none private ! Public procedures public :: input_chemistry ! read chemistry data from file public :: input_monomers, input_chains, input_solvents public :: input_composition, input_interaction public :: output_chemistry ! write chemistry data to file public :: output_monomers, output_chains, output_solvents public :: output_composition, output_interaction public :: rescale_vref ! rescale monomer reference volume ! Public variables public :: N_monomer, kuhn public :: N_chain, N_block, N_blk_max public :: block_length, block_monomer, chain_length public :: N_solvent, solvent_monomer, solvent_size public :: ensemble, phi_chain, phi_solvent, mu_chain, mu_solvent public :: interaction_type, chi, chi_A, chi_B, temperature ! Monomer properties integer :: N_monomer = 0 ! # of monomer types real(long) :: kuhn(:) ! (N_monomer) Kuhn lengths ! Polymer properties integer :: N_chain = 0 ! # of species types of polymer integer :: N_blk_max ! maximum # of blocks in any species integer :: N_block(:) ! (N_chain) # of blocks in species integer :: block_monomer(:,:) ! (N_blk_max,N_chain) monomer type real(long) :: block_length(:,:) ! (N_blk_max,N_chain) # monomers real(long) :: chain_length(:) ! (N_chain) # monomers in polymer ! Solvent properties integer :: N_solvent = 0 ! # of solvent types integer :: solvent_monomer(:) ! (N_solvent) indices of solvents real(long) :: solvent_size(:) ! (N_solvent) solvent volume / vref ! Statistical ensemble integer :: ensemble ! 0 = canonical, 1 = grand canonical ! Mixture composition real(long) :: phi_chain(:) ! (N_chain) volume fractions of chains real(long) :: mu_chain(:) ! (N_chain) chemical potentials of chains real(long) :: phi_solvent(:) ! (N_solvent) volume fractions of solvents real(long) :: mu_solvent(:) ! (N_solvent) chemical potentials of solvents ! Interaction parameters real(long) :: chi(:,:) ! (N_monomer,N_monomer) Flory chi character(20):: interaction_type ! 'chi' -> bare chi, 'chi_T' -> chi(T) real(long) :: chi_A(:,:) ! chi(T) = chi_A/T + chi_B real(long) :: chi_B(:,:) real(long) :: temperature ! absolute temperature
VARIABLE
integer N_monomer = # of monomer types
VARIABLE
real(long) kuhn(:) - dimension(N_monomer) kuhn(i) = Kuhn length for monomer i
VARIABLE
real(long) chi(:,:) - dimension(N_monomer,N_monomer) chi(i,j) = Flory chi for monomers i and j
VARIABLE
integer N_chain = # of species types of polymers
VARIABLE
integer N_blk_max = maximum # of blocks in any species = max(N_block)
VARIABLE
integer N_block(:) = (N_chain) # of blocks in species N_block(i) = # of blocks in species i
VARIABLE
integer block_monomer(:,:) - dimension(N_blk_max,N_chain) block_monomer(i,j) - monomer type of block i, species j
VARIABLE
real(long) block_length(:,:) - dimension(N_blk_max,N_chain) block_length(i,j) = # monomers in block i, species j
VARIABLE
real(long) chain_length(:) - dimension(N_chain) chain_length(i) = total # monomers in species i = sum(block_length(1:N_block(i))
VARIABLE
integer N_solvent = # of monomer types
VARIABLE
integer solvent_monomer - dimension(N_solvent) solvent_monomer(i) = type of solvent monomer i (string)
VARIABLE
real(long) solvent_size - dimension(N_solvent) solvent_size(i) = size of the solvent type i
VARIABLE
integer ensemble = index for statistical ensemble 0 = canonical, 1 = grand canonical
VARIABLE
real(long) phi_chain(:) - dimension(N_chain) phi_chain(i) = volume fraction of chain molecular species i
VARIABLE
real(long) phi_solvent(:) - dimension(N_solvent) phi_solvent(i) = volume fraction of solvent molecular species i
VARIABLE
real(long) mu_chain(:) - dimension(N_chain) mu_chain(i) = chemical potential of chain molecular species i units kT = 1
VARIABLE
real(long) mu_solvent(:) - dimension(N_solvent) mu_solvent(i) = chemical potential of solvent molecular species i units kT = 1
VARIABLE
character(20) interaction_type - method of specifying interaction chi -> specify bare chi, chi_T -> chi(T) = chi_A/T + chi_B
VARIABLE
real(long) chi_A(:,:) - dimension(N_monomer,N_monomer) chi(i,j;T) = chi_A(i,j)/T + chi_B(i,j)
VARIABLE
real(long) chi_B(:,:) - dimension(N_monomer,N_monomer) chi(i,j;T) = chi_A(i,j)/T + chi_B(i,j)
VARIABLE
real(long) temperature = absolute temperature
SUBROUTINE
input_chemistry(i_unit,fmt_flag)
PURPOSE
Read information about system chemistry and composition. Allocate public allocatable arrays if necessary
SOURCE
subroutine input_chemistry(i_unit,fmt_flag) use io_mod integer, intent(IN) :: i_unit ! input file unit # character(1), intent(IN) :: fmt_flag ! F = formatted, U = un...
SUBROUTINE
input_monomers(i_unit,fmt_flag)
PURPOSE
Read N_monomer and kuhn Allocate chi, chi_A and chi_B arrays
SOURCE
subroutine input_monomers(i_unit,fmt_flag) use io_mod integer, intent(IN) :: i_unit ! input file unit # character(1), intent(IN) :: fmt_flag ! F = formatted, U = unformatted
SUBROUTINE
input_chains(i_unit,fmt_flag)
PURPOSE
Input information about linear block copolymers and homopolymers Read N_chain, N_block, block_monomer, block_length Allocate arrays with dimensions N_chain and N_block
SOURCE
subroutine input_chains(i_unit,fmt_flag) use io_mod integer, intent(IN) :: i_unit ! input file unit # character(1), intent(IN) :: fmt_flag ! F = formatted, U = unformatted
SUBROUTINE
input_solvents(i_unit,fmt_flag)
PURPOSE
Read information about solvent molecules. Read N_solvents, solvent_monomer, solvent_size
SOURCE
subroutine input_solvents(i_unit,fmt_flag) use io_mod integer, intent(IN) :: i_unit ! input file unit # character(1), intent(IN) :: fmt_flag ! F = formatted, U = unformatted
SUBROUTINE
input_composition(i_unit,fmt_flag)
PURPOSE
Read information about system composition. Allocate public allocatable arrays if necessary
SOURCE
subroutine input_composition(i_unit,fmt_flag) use io_mod integer, intent(IN) :: i_unit ! input file unit # character(1), intent(IN) :: fmt_flag ! F = formatted, U = unformatted
SUBROUTINE
input_interaction(i_unit,fmt_flag)
PURPOSE
Read information about interaction free energy Allocate public allocatable arrays if necessary
SOURCE
subroutine input_interaction(i_unit,fmt_flag) use io_mod integer, intent(IN) :: i_unit ! input file unit # character(1), intent(IN) :: fmt_flag ! F = formatted, U = un...
SUBROUTINE
output_chemistry(o_unit,fmt_flag)
PURPOSE
Write information about system chemistry and composition.
SOURCE
subroutine output_chemistry(o_unit,fmt_flag) use io_mod integer, intent(IN) :: o_unit ! input unit # character(len=1), intent(IN) :: fmt_flag ! F = formatted, U = un...
SUBROUTINE
output_monomers(o_unit,fmt_flag)
PURPOSE
Output N_monomer and kuhn Allocate chi, chi_A and chi_B arrays
SOURCE
subroutine output_monomers(o_unit,fmt_flag) use io_mod integer, intent(IN) :: o_unit ! output file unit # character(1), intent(IN) :: fmt_flag ! F = formatted, U = unformatted
SUBROUTINE
output_chains(o_unit,fmt_flag)
PURPOSE
Input information about linear block copolymers and homopolymers Allocate related arrays
SOURCE
subroutine output_chains(o_unit,fmt_flag) use io_mod integer, intent(IN) :: o_unit ! output file unit # character(1), intent(IN) :: fmt_flag ! F = formatted, U = unformatted
SUBROUTINE
output_solvents(o_unit,fmt_flag)
PURPOSE
Output information about solvent identities and volumes Allocate public allocatable arrays if necessary
SOURCE
subroutine output_solvents(o_unit,fmt_flag) use io_mod integer, intent(IN) :: o_unit ! output file unit # character(1), intent(IN) :: fmt_flag ! F = formatted, U = unformatted
SUBROUTINE
output_composition(o_unit,fmt_flag)
PURPOSE
Output information about system composition. Allocate public allocatable arrays if necessary
SOURCE
subroutine output_composition(o_unit,fmt_flag) use io_mod integer, intent(IN) :: o_unit ! output file unit # character(1), intent(IN) :: fmt_flag ! F = formatted, U = unformatted
SUBROUTINE
output_interaction(o_unit,fmt_flag)
PURPOSE
Output information about interaction free energy Allocate public allocatable arrays if necessary
SOURCE
subroutine output_interaction(o_unit,fmt_flag) use io_mod integer, intent(IN) :: o_unit ! output file unit # character(1), intent(IN) :: fmt_flag ! F = formatted, U = un...
SUBROUTINE
rescale_vref(scale)
PURPOSE
Rescale reference volume, such that: vref -> vref/scale chi -> chi/scale kuhn -> kuhn/sqrt(scale) block_length -> block_length*scale Omega is not rescaled by routine, but must be scaled as: omega -> omega/scale
SOURCE
subroutine rescale_vref(scale) real(long) :: scale