Example #1
0
def griffinmodel(conductivity_medium, permittivity_medium, permittivity_dish):

    with open('parameters_griffin2011meshmaster.yml', 'r') as stream:
        data = yaml.load(stream)

    # update parameters
    data['conductivity']['medium'] = float(conductivity_medium)
    data['permittivity']['medium'] = float(permittivity_medium)
    data['permittivity']['dish'] = float(permittivity_dish)
    data['solver']['linear_solver'] = 'mumps'

    with open('parameters_griffin2011mesh.yml', 'w') as stream:
        yaml.dump(data, stream)

    model = Simulation('parameters_griffin2011mesh.yml')
    model.set_log_level("DEBUG")
    model.run()

    field = model.fenics_study.normEr(0.05, 0.05, 0.01101)
    print("Solved for conductivity of medium: ", data['conductivity']['medium'])
    print("Solved for permittivity of medium: ", data['permittivity']['medium'])
    print("Solved for conductivity of dish: ", data['conductivity']['dish'])
    print("Got field: ", field)

    return 1, field
from emstimtools import Simulation

model = Simulation('parameters_griffin2011.yml')
model.set_log_level('DEBUG')
model.run()
print("success")
from emstimtools import Simulation

model = Simulation('parametersRobinBCNaturalConvectionTimeDependent.yml')
model.set_log_level('DEBUG')
model.run()
print("success")
Example #4
0
iterations = 7
max_list = []
min_list = []
dof_list = []
current1_list = []
current2_list = []
field_list = []
error_list = [np.nan]

with open('parameters_case_study_cg_convergence_master.yml', 'r') as stream:
    input_dict = yaml.safe_load(stream)
input_dict_file = 'parameters_case_study_cg_convergence.yml'
for i in range(iterations):
    prepare_input_dict(max_size, min_size, input_dict)
    model = Simulation(input_dict_file)
    model.run()
    if i > 0:
        error = model.fenics_study.get_solution_error(old_solution,
                                                      save_difference=True)
        l2error = model.fenics_study.get_solution_l2error(old_solution)
        error_list.append((error, l2error))

    dofs = model.fenics_study.V.dim()
    model.fenics_study.get_field()
    current1 = model.fenics_study.compute_current("Contact1")
    current2 = model.fenics_study.compute_current("Contact1")
    old_solution = model.fenics_study.u.copy(deepcopy=True)
    dof_list.append(dofs)
    max_list.append(max_size)
    min_list.append(min_size)
    data = yaml.load(stream)

# run the model for all configurations and get results
results = []

for i in range(0, 2**k):
    # update parameters
    data['conductivity']['medium'] = float(configs_df[0][i])
    data['permittivity']['medium'] = float(configs_df[1][i])
    data['permittivity']['dish'] = float(configs_df[2][i])
    data['solver']['linear_solver'] = 'mumps'

    with open('parameters_griffin2011mesh.yml', 'w') as stream:
        yaml.dump(data, stream)

    model = Simulation('parameters_griffin2011mesh.yml')
    model.run()
    results.append(model.fenics_study.normEr(0.05, 0.05, 0.01101))

results_df = pd.DataFrame(results)
print(results_df)

# Compute the individual effect of a factor on the response
individual_effects = list(itertools.repeat(0, k))
total_effects = list(itertools.repeat(0, k))
interaction_effects = list(itertools.repeat(0, k))
# Go through configurations
for row in range(0, 2**k):
    indList = []
    # Get the change in the output for this configuration
    change = results_df.iloc[row, 0] - results_df.iloc[0, 0]
Example #6
0
from emstimtools import Simulation

model = Simulation('parameters_case_study_cg_mesh.yml')
model.set_log_level('DEBUG')
model.run()
print("success")
Example #7
0
from emstimtools import Simulation

model = Simulation('parameters_mobini2017.yml')
model.set_log_level('DEBUG')
model.run()
print("success")

Example #8
0
from emstimtools import Simulation

# dielectric heating
# model = Simulation('parameters_RFA.yml')
# model.set_log_level('DEBUG')
# model.run()

# direct Joule heating (no frequency dependence)
model = Simulation('parameters_RFA_direct.yml')
model.set_log_level('DEBUG')
model.run()

# dielectric heating with surface impedance on patch
# model = Simulation('parameters_RFA_patch.yml')
# model.set_log_level('DEBUG')
# model.run()

print("success")
from emstimtools import Simulation

model = Simulation('parameters_RFAstationary.yml')
model.set_log_level('DEBUG')
model.run()
print("success")
Example #10
0
from emstimtools import Simulation

model = Simulation('parameters_ionoptix.yml')
model.set_log_level('DEBUG')
model.run()
print("success")