Calibrate Any COMSOL Multiphysics Material Model using MCalibration

Introduction

MCalibration can calibrate all material models in Abaqus, Ansys, LS-DYNA, MSC.Marc, Radioss, and now also COMSOL Multiphysics. Some COMSOL material models have a very fast internal solver that is part of MCalibration, and some material models have not yet been internally implemented in MCalibration and will require the stress-strain calculations to be performed using the target FE software using a single finite element. In these cases, MCalibration will automatically generate the FE simulation files, run them when needed, and extract the stress-strain results for the specified load histories. The material model in this case is specified as a MCalibration template, which is basically the FE solver commands that specify the desired material model. 

Most COMSOL Multiphysics material models are specified using the GUI, and COMSOL does not use a traditional input file in txt-file format. Fortunately, it is possible to drive COMSOL using a Java file that is using Java API commands. In this tutorial I will show how to: (1) Generate a COMSOL material model from Java commands, (2) Insert the Java commands into a MCalibration template; and (3) Run a material model calibration using MCalibration.

Step 1: Create the Java Commands for a Material Model

I have not found documentation that explains the details of the COMSOL Multiphysics Java API language. Instead I recommend using the following approach to generate the Java commands. First, create a simple virtual load case in MCalibration. In my example I used a tension test.

Then select a COMSOL material model that has a native MCalibration implementation. Select COMSOL as the solver in the load case dialog. Run the simulation. MCalibration will generate a directory called Tension_LC1, containing the file mcal_simulation.java

Open the java file that was generated by MCalibration in a newCOMSOL Multiphysics main window.

Setup the material model that you would like to calibrate. Then save the file as a Java file.

Quit COMSOL Multiphysics, and open the java file that you saved. Extract the material model commands from the file.

				
					    model.result().numerical("sxz").appendResult();
    model.result().table("tbl1")
         .save("D:\\web_PolymerFEM_com\\Blog_Youtube_Linkedin_Docs\\COMSOL_Calibrate_Template\\Tension_LC1\\mcal_simulation.data");
    model.component("comp1").physics("solid").feature("hmm1").create("mul1", "MullinsEffect", 3);
    model.component("comp1").physics("solid").feature("hmm1").feature("mul1").set("dmginfty", 0.9);
    model.component("comp1").physics("solid").feature("hmm1").feature("mul1").set("Wmsat", "0.9e6[J/m^3]");
    model.component("comp1").physics("solid").feature("hmm1").feature("mul1").set("alphamul", 0.1);
    return model;
  }
  public static void main(String[] args) {
    run();
  }
}
				
			

Step 2: Insert the Java Commands as a Template Model

Create a new txt-file that contains all Java material model commands and make the parameter values into MCalibration variables by adding the %variable=value% syntax. Then copy the contents of the file into a MCalibration COMSOL Multiphysics template.

Save the COMSOL material model template. Back in the main window of MCalibration you will now see the material parameters of the selected model. You can now calibrate the material model just like any other material model in MCalibration. In this case, MCalibration will call COMSOL Multiphysics for the stress calculations.

That is all there is to it. Best of luck with your calibration project.

Facebook
Twitter
LinkedIn

More to explore

Leave a Comment