Fundamental Sorption Models

NELF

The NELF model is a fundamental model that describes sorption in polymers through lattice fluid equations of state. The actual underlying equation of state

SorptionModels.NELFModelType
NELFModel(bulk_model, polymer_model, polymer_dry_density)

Create a NELF sorption model, using two equations of state, one representing the bulk phase and one representing the polymer phase.

Notes:

  • The polymer_dry_density should reflect the density of the pure polymer at STP.
  • Requires that these models contain the polymer is the first index when referencing compositions and interaction parameters. The remaining indexes must match penetrants in the predictions functions.

F. Doghieri, G.C. Sarti, Nonequilibrium Lattice Fluids: A Predictive Model for the Solubility in Glassy Polymers, Macromolecules. 29 (1996) 7885–7896. https://doi.org/10.1021/ma951366c.

source
SorptionModels.fit_kijMethod
fit_kij(NELF(), isotherms, bulk_parameters, polymer_parameters; [interpolation_model]=DualMode(), [kij_fit_p_mpa]=1e-4)

Find the best kij and ksw parameters for the NELF model according to the Sanchez Lacombe EOS.

Arguments

  • isotherms: Vector of IsothermData structs using the polymer in question with only one kind of component. Temperature, pressure, density, and concentration must be provided.
  • bulk_parameters: vector of the gas or vapor's characteristic parameters, in the format of [p★_mpa, t★_k, ρ★_g_cm3, mw_g_mol].
  • polymer_parameters: vector of the polymer's characteristic parameters, in the format of [p★_mpa, t★_k, ρ★_g_cm3, mw_g_mol].
source
SorptionModels.fit_modelMethod
fit_model(::NELF, model_choice, isotherms, bulk_phase_characteristic_params, [polymer_molecular_weight]; [custom_densities], [initial_search_resolution], [uncertainty_method])

Find the EOS parameters of a polymer from a vector of IsothermDatas using the NELF model.

Arguments

  • model_choice: MembraneEOS model to use
  • isotherms: Vector of IsothermData structs using the polymer in question. Temperature, pressure, density, and concentration must be provided.
  • bulk_phase_characteristic_params: Vector of pure characteristic parameter vectors following the same order as the isotherms.
    • E.g., for Sanchez Lacombe and two input isotherms, bulk_phase_characteristic_params = [[p★_1, t★_1, ρ★_1, mw_1], [p★_2, t★_2, ρ★_2, mw_2]]
  • polymer_molecular_weight: A known molecular weight for the polymer (otherwise a default, arbitrarily large value is assumed)
  • custom_densities: An array (matching the dimensions of the input isotherms) of densities to use instead of the ones in the isotherm data provided.
  • uncertainty_method: Calculate the uncertainty of the parameters from the fitting. For NELF, the Hessian method is currently the only one implemented.
source
SorptionModels.scan_for_starting_point_and_bounds_3_dimsFunction
scan_for_starting_point_and_bounds_3_dims(target_function::Function, naive_lower::Vector{Float64}, naive_lower::Vector{Float64}, resolutions=missing; return_grid=false, verbose=true)

Search for a vector of parameters, bounded by naive_lower and naive_lower, that is closest to minimizing a target_function by trying every possible value in a grid of resolutions.

  • resolutions can be a vector of the same length as the bounds and arguments to the target_function. If a single integer is passed, it will assume you want the same resolution on all input dimensions.
  • This search algorithm assumes that the targetfunction contains one obvious local minima, but is robust to NaN, missing, and nothing output from `targetfunction`.

Returns min_results, min_args, lower_bounds, upper_bounds, or rather, the output of the function that was searched, the argument vector to get said output, and the lower and upper bounds in which a better solution may exist. Returns only the error grid that was evaluated and skips finding any other results if return_grid is true. (used for diagnostic purposes)

Example
function expensive_func(x)
    return (x[1]-15)^2 + (x[2]-10)^2 + (x[3]-12)^2
end
@show scan_for_starting_point_and_bounds_3_dims(expensive_func, (1.0, 1.0, 1.), (20., 20., 20.), (10, 11, 12); verbose=true)

source

DGRPT

The dry glass reference perturbation theory (DGRPT) model attempts to improve the NELF model by predicting polymer swelling rather than being supplied (or fitting) a swelling coefficient for each component in the polymer phase.

SorptionModels.DGRPTModelType
DGRPTModel(bulk_model, polymer_model, polymer_dry_density)

Create a DGRPT sorption model, using two equations of state, one representing the bulk phase and one representing the polymer phase.

Notes:

  • The polymer_dry_density should reflect the density of the pure polymer at STP.
  • Requires that these models contain the polymer is the first index when referencing compositions and interaction parameters. The remaining indexes must match penetrants in the predictions functions.

B.D. Marshall, R. Mathias, R.P. Lively, B.A. McCool, Theoretically Self-Consistent Nonequilibrium Thermodynamics of Glassy Polymer Theory for the Solubility of Vapors and Liquids in Glassy Polymers, Ind. Eng. Chem. Res. 60 (2021) 13377–13387. https://doi.org/10.1021/acs.iecr.1c02194.

source