rvesimulator.benchmarks

rvesimulator.benchmarks.shared_functionalities

Module for simulation base class

class SimulationBase[source]

Bases: object

base class of rve simulation problems

_create_working_folder(folder_index=None, sub_folder_index=None, third_folder_index=None)[source]

create folders for executing abaqus simulations, it’s a third layer folder structure, you have to provide at least one folder index

Parameters:
  • folder_index (int, optional) – first folder index , by default None

  • sub_folder_index (int, optional) – second folder index , by default None

  • third_folder_index (int, optional) – third folder index, by default None

Raises:
Return type:

None

_print_sim_info(info)[source]

print simulation information to screen

Parameters:

info (dict) – a dict contains simulation information

Return type:

None

_update_sample_info(sample)[source]

update the sample information

Parameters:

sample (dict) – sample

Return type:

None

run_batch_simulation()[source]

run batch simulation

Returns:

should be defined according to different problems

Return type:

Any

Raises:

NotImplementedError – should be implemented in specific problems

run_simulation()[source]

run simulation

Returns:

should be defined according to different problems

Return type:

Any

update_sim_info()[source]

update the required simulation information

Raises:

NotImplementedError – should be implemented in specific problems

Return type:

None

rvesimulator.benchmarks.cddm_rve

CDDM RVE case

class CDDM_RVE[source]

Bases: SimulationBase

Interface between python and abaqus of the CDDM RVE case

Parameters:

SimulationBase (class) – base class for simulation

Interface between python and abaqus of the Hollow plate case

__init__()[source]

Interface between python and abaqus of the Hollow plate case

_get_sim_info()[source]

get simulation information

Return type:

None

run_simulation(sample=None, folder_index=None, sub_folder_index=None, third_folder_index=None)[source]

run single simulation

Parameters:
  • sample (dict, optional) – a dict contains the information of design variables

  • folder_index (int, optional) – first folder index, by default None

  • sub_folder_index (int, optional) – second folder index, by default None

  • third_folder_index (int, optional) – third folder index, by default None

Returns:

all the simulation results from abaqus

Return type:

dict

update_sim_info(size=0.048, radius_mu=0.003, radius_std=0.0, vol_req=0.3, youngs_modulus_matrix=100.0, poisson_ratio_matrix=0.3, youngs_modulus_fiber=1.0, poisson_ratio_fiber=0.19, mesh_partition=30, strain=[0.1, 0.0, 0.0], strain_amplitude=None, num_steps=100, simulation_time=1.0, num_cpu=1, platform='ubuntu', hardening_law=<rvesimulator.additions.hardening_law.LinearHardeningLaw object>, seed=None, print_info=False)[source]

path dependent rve for cddm

Parameters:
  • size (float, optional) – size of the rve, by default 0.048

  • radius_mu (float, optional) – radius mean of the rve, by default 0.003

  • radius_std (float, optional) – radius deviation of the rve, by default 0.0

  • vol_req (float, optional) – volume fraction requirement, by default 0.30

  • youngs_modulus_matrix (float, optional) – youngs modulus of the matrix material, by default 100.0

  • poisson_ratio_matrix (float, optional) – poisson ratio of the matrix material, by default 0.3

  • youngs_modulus_fiber (float, optional) – youngs modulus of the fiber material, by default 1.0

  • poisson_ratio_fiber (float, optional) – poisson ratio of the fiber material, by default 0.19

  • mesh_partition (int, optional) – mesh partition for the edges, by default 30

  • strain (list, optional) – applied maximum strain, by default [0.1, 0.0, 0.0]

  • strain_amplitude (list, optional) – applied strain amplitude to mimic path dependence, by default None

  • num_steps (int, optional) – number of simulation steps, by default 100

  • simulation_time (float, optional) – total simulation time, by default 1.0

  • num_cpu (int, optional) – number of cpu used for simulation, by default 1

  • platform (str, optional) – platform for simulation, by default “ubuntu”

  • hardening_law (class, optional) – hardening law for the simulation, by default LinearHardeningLaw()

  • seed (Any, optional) – seed number, by default None

  • print_info (bool, optional) – print simulation information or not, by default False

Return type:

None

rvesimulator.benchmarks.hollow_plate_sve

Hollow plate simulation case, with different material models and path loading

class ElasticRegularLoads[source]

Bases: HollowPlateBase

Interface between python and abaqus of the Hollow plate case

__init__()[source]

Interface between python and abaqus of the Hollow plate case

update_sim_info(size=1.0, radius=0.2, youngs_modulus=100.0, poisson_ratio=0.3, mesh_partition=30, strain=[0.1, 0.0, 0.0], num_cpu=1, platform='ubuntu', print_info=False)[source]

update simulation information

Parameters:
  • size (float, optional) – size of rve , by default 1.0

  • radius (float, optional) – radius of hollow plate , by default 0.2

  • youngs_modulus (float, optional) – youngs modulus, by default 100.0

  • poisson_ratio (float, optional) – poisson ratio, by default 0.3

  • mesh_portion (int, optional) – mesh portion, by default 30

  • strain (list, optional) – applied strain, by default [0.1, 0.0, 0.0]

  • num_cpu (int, optional) – number of cpu for simulation, by default 1

  • platform (str, optional) – platform of execution, by default “ubuntu”

  • print_info (bool, optional) – print the simulation information, by default False

Return type:

None

class HollowPlateBase[source]

Bases: SimulationBase

_get_sim_info()[source]

get simulation info

Return type:

None

run_simulation(sample=None, folder_index=None, sub_folder_index=None, third_folder_index=None)[source]

run single simulation

Parameters:
  • sample (dict, optional) – a dict contains the information of design variables

  • folder_index (int, optional) – first folder index, by default None

  • sub_folder_index (int, optional) – second folder index, by default None

  • third_folder_index (int, optional) – third folder index, by default None

Returns:

all the simulation results from abaqus

Return type:

dict

class VonMisesPlasticPathLoads[source]

Bases: HollowPlateBase

Hollow plate simulation case, with von mises plasticity and path loading

Parameters:

HollowplateBase (class) – base class of hollow plate simulation case

Interface between python and abaqus of the Hollow plate case

__init__()[source]

Interface between python and abaqus of the Hollow plate case

update_sim_info(size=1.0, radius=0.2, youngs_modulus=100.0, poisson_ratio=0.3, mesh_partition=30, strain=[0.1, 0.0, 0.0], strain_amplitude=None, num_steps=100, simulation_time=1.0, num_cpu=1, platform='ubuntu', hardening_law=<rvesimulator.additions.hardening_law.LinearHardeningLaw object>, print_info=False)[source]

update simulation information

Parameters:
  • size (float, optional) – size of RVE, by default 1.0

  • radius (float, optional) – radius of hollow plate, by default 0.2

  • youngs_modulus (float, optional) – young modulus, by default 100.0

  • poisson_ratio (float, optional) – poisson ratio, by default 0.3

  • mesh_partition (int, optional) – mesh partition, by default 30

  • strain (list, optional) – strain, by default [0.1, 0.0, 0.0]

  • strain_amplitude (list, optional) – strain amplitude, by default None

  • num_steps (int, optional) – number of steps, by default 100

  • simulation_time (float, optional) – simulation time, by default 1.0

  • num_cpu (int, optional) – number of cpu been used, by default 1

  • platform (str, optional) – simulation platform, by default “ubuntu”

  • hardening_law (Any, optional) – hardening law, by default LinearHardeningLaw()

  • print_info (bool, optional) – print simulation information to the screen, by default False

Return type:

None

class VonMisesPlasticRegularLoads[source]

Bases: HollowPlateBase

Interface between python and abaqus of the Hollow plate case

__init__()[source]

Interface between python and abaqus of the Hollow plate case

update_sim_info(size=1.0, radius=0.2, youngs_modulus=100.0, poisson_ratio=0.3, mesh_partition=30, strain=[0.1, 0.0, 0.0], hardening_law=<rvesimulator.additions.hardening_law.LinearHardeningLaw object>, num_steps=100, simulation_time=1.0, num_cpu=1, platform='ubuntu', print_info=False)[source]

update simulation information

Parameters:
  • size (float, optional) – size of rve, by default 1.0

  • radius (float, optional) – radius of hollow plate, by default 0.2

  • youngs_modulus (float, optional) – youngs modulus, by default 100.0

  • poisson_ratio (float, optional) – poisson ratio, by default 0.3

  • mesh_partition (int, optional) – mesh partition, by default 30

  • strain (list, optional) – strain, by default [0.1, 0.0, 0.0]

  • hardening_law (Any, optional) – hardening law, by default LinearHardeningLaw()

  • num_steps (int, optional) – number of step, by default 100

  • simulation_time (float, optional) – simulation time, by default 1.0

  • num_cpu (int, optional) – number of cpu been used, by default 1

  • platform (str, optional) – platform of simulation, by default “ubuntu”

  • print_info (bool, optional) – print simulation info to screen, by default False

Return type:

None

rvesimulator.benchmarks.pppe_no_cohesive_rve

Class for uni-axial tension for pp/pe Mixture/composite without cohesive

class PPPEMixtureNoCohesive[source]

Bases: SimulationBase

uni-axial tension for pp/pe Mixture/composite without cohesive elements in between fiber and matrix material phases

_get_sim_info()[source]

get simulation information

Return type:

None

run_simulation(sample=None, folder_index=None, sub_folder_index=None, third_folder_index=None)[source]

run single simulation

Parameters:
  • sample (dict, optional) – a dict contains the information of design variables

  • folder_index (int, optional) – first folder index, by default None

  • sub_folder_index (int, optional) – second folder index, by default None

  • third_folder_index (int, optional) – third folder index, by default None

Returns:

all the simulation results from abaqus

Return type:

dict

update_sim_info(size=0.02, radius_mu=0.0031, radius_std=0.0, vol_req=0.3, paras_pp=[748.234, 0.45, 296.0, 0.1, 0.0153, 0.6608, 733.0, 251000000.0, 3.3e-26, 7420000.0, 0.0267, 48.26, 1.52, 1.303], paras_pe=[611.6, 0.45, 296.0, 0.1, 0.44, 0.0051, 772.1, 229000000.0, 9.94e-26, 5010000.0, 0.3234, 15.88, 13.52, 0.043], mesh_partition=100, strain=[0.1, 0.0, 0.0], num_steps=1000, simulation_time=100.0, num_cpu=8, platform='ubuntu', seed=None, print_info=False)[source]

update simulation information

Parameters:
  • size (float, optional) – size of rve, by default 0.02

  • radius_mu (float, optional) – radius mean, by default 0.0031

  • radius_std (float, optional) – radius standard deviation, by default 0.0

  • vol_req (float, optional) – volume fraction requirement, by default 0.30

  • paras_pp (list, optional) – parameters of pp

  • paras_pe (list, optional) – parameters of pe

  • mesh_partition (int, optional) – mesh partition, by default 100

  • strain (list, optional) – maximum strain, by default [0.1, 0.0, 0.0]

  • num_steps (int, optional) – number of simulation steps, by default 1000

  • simulation_time (float, optional) – simulation time, by default 100.0

  • num_cpu (int, optional) – number of cpu, by default 8

  • platform (str, optional) – platform, by default “ubuntu”

  • seed (Any, optional) – seed, by default None

  • print_info (bool, optional) – print simulation information to the screen or not, by default False

Return type:

None

rvesimulator.benchmarks.asca_rve

Class for ASCA RVE case

class ASCA_RVE[source]

Bases: SimulationBase

Interface between python and abaqus of the ASCA RVE case

Parameters:

SimulationBase (class) – base class for simulation

Interface between python and abaqus of the ASCA case

__init__()[source]

Interface between python and abaqus of the ASCA case

_get_sim_info()[source]

get simulation information

Return type:

None

run_simulation(sample=None, folder_index=None, sub_folder_index=None, third_folder_index=None)[source]

run single simulation

Parameters:
  • sample (dict, optional) – a dict contains the information of design variables

  • folder_index (int, optional) – first folder index, by default None

  • sub_folder_index (int, optional) – second folder index, by default None

  • third_folder_index (int, optional) – third folder index, by default None

Returns:

all the simulation results from abaqus

Return type:

dict

update_sim_info(size=0.048, radius_mu=0.003, radius_std=0.0, vol_req=0.3, youngs_modulus_matrix=100.0, poisson_ratio_matrix=0.3, youngs_modulus_fiber=1.0, poisson_ratio_fiber=0.19, mesh_partition=30, strain=[0.1, 0.0, 0.0], num_steps=100, simulation_time=1.0, num_cpu=1, platform='ubuntu', hardening_law=<rvesimulator.additions.hardening_law.LinearHardeningLaw object>, seed=None, print_info=False)[source]

path dependent rve for cddm

Parameters:
  • size (float, optional) – size of the rve, by default 0.048

  • radius_mu (float, optional) – radius mean of the rve, by default 0.003

  • radius_std (float, optional) – radius deviation of the rve, by default 0.0

  • vol_req (float, optional) – volume fraction requirement, by default 0.30

  • youngs_modulus_matrix (float, optional) – youngs modulus of the matrix material, by default 100.0

  • poisson_ratio_matrix (float, optional) – poisson ratio of the matrix material, by default 0.3

  • youngs_modulus_fiber (float, optional) – youngs modulus of the fiber material, by default 1.0

  • poisson_ratio_fiber (float, optional) – poisson ratio of the fiber material, by default 0.19

  • mesh_partition (int, optional) – mesh partition for the edges, by default 30

  • strain (list, optional) – applied maximum strain, by default [0.1, 0.0, 0.0]

  • num_steps (int, optional) – number of simulation steps, by default 100

  • simulation_time (float, optional) – total simulation time, by default 1.0

  • num_cpu (int, optional) – number of cpu used for simulation, by default 1

  • platform (str, optional) – platform for simulation, by default “ubuntu”

  • hardening_law (class, optional) – hardening law for the simulation, by default LinearHardeningLaw()

  • seed (Any, optional) – seed number, by default None

  • print_info (bool, optional) – print simulation information or not, by default False

Return type:

None

rvesimulator.benchmarks.utils

create_dir(current_folder, dir_name)[source]

create new directory

Parameters:
  • current_folder (str) – current working folder

  • dirname (str) – new folder name

Returns:

path of created folder

Return type:

str

rve_microstructure_plot(fibers, size, save_fig=False, fig_name='rve.png', **kwargs)[source]

plot the microstructure if needed

Parameters:
  • fibers (np.ndarray) – fiber locations

  • size (float) – size of rve

  • save_fig (bool, optional) – save figure, by default False

  • fig_name (str, optional) – figure name, by default “rve.png”

Return type:

None

write_json(sim_info, file_name)[source]

write json file for abaqus

Parameters:
  • sim_info (dict) – dict that constains

  • file_name (str) – file name of json file

Return type:

None