function out = model % % cam.m % % Model exported on Apr 6 2013, 16:44 by COMSOL 4.3.1.115. import com.comsol.model.* import com.comsol.model.util.* model = ModelUtil.create('Model'); model.modelPath('C:\Users\Administrator\Desktop'); model.name('Camclaycompression2.mph'); model.comments(['Isotropic Compression With Cam-Clay Material Model\n\nThis model simulates isotropic compression of a sample of soil in 2D axisymmetry using the Cam-Clay material model. The aim of the model is to reproduce analytical curves showing Virgin Consolidation Line (VCL) and Unloading/Reloading Line (URL).']); model.param.set('param', '0', 'Parameter'); model.param.set('P0', '200[kPa]', 'Initial pressure'); model.param.set('ec0', '0.7+0.032*log(0.25)'); model.param.set('e0', 'ec0+0.013*log(2)'); model.param.set('rhof', '1000[kg/m^3]'); model.modelNode.create('mod1'); model.geom.create('geom1', 2); model.geom('geom1').axisymmetric(true); model.geom('geom1').feature.create('r1', 'Rectangle'); model.geom('geom1').feature('r1').set('size', {'50e-3' '100e-3'}); model.geom('geom1').run; model.view.create('view2', 3); model.view.create('view3', 3); model.material.create('mat1'); model.material('mat1').propertyGroup.create('CamClayModel', 'Cam-Clay material'); model.material('mat1').propertyGroup.create('MohrCoulomb', 'Mohr-Coulomb'); model.physics.create('solid', 'SolidMechanics', 'geom1'); model.physics('solid').feature.create('ccmm1', 'CamClayModel', 2); model.physics('solid').feature('ccmm1').selection.set([1]); model.physics('solid').feature('ccmm1').feature.create('iss1', 'InitialStressandStrain', 2); model.physics('solid').feature.create('roll1', 'Roller', 1); model.physics('solid').feature('roll1').selection.set([2]); model.physics('solid').feature.create('bndl1', 'BoundaryLoad', 1); model.physics('solid').feature('bndl1').selection.set([3]); model.physics('solid').feature.create('bndl2', 'BoundaryLoad', 1); model.physics('solid').feature('bndl2').selection.set([4]); model.physics.create('dl', 'DarcysLaw', 'geom1'); model.physics('dl').feature.create('pr1', 'Pressure1', 1); model.physics('dl').feature('pr1').selection.set([3]); model.physics('dl').feature.create('weak1', 'WeakContribution', 2); model.physics('dl').feature('weak1').selection.set([1]); model.mesh.create('mesh1', 'geom1'); model.mesh('mesh1').feature.create('map1', 'Map'); model.mesh('mesh1').feature('map1').selection.geom('geom1', 2); model.mesh('mesh1').feature('map1').selection.set([1]); model.result.table.create('evl2', 'Table'); model.view('view1').axis.set('xmin', '-0.12805534899234772'); model.view('view1').axis.set('ymin', '-0.04626375064253807'); model.view('view1').axis.set('xmax', '0.19636406004428864'); model.view('view1').axis.set('ymax', '0.11365136504173279'); model.material('mat1').propertyGroup('def').set('poissonsratio', '0.2'); model.material('mat1').propertyGroup('def').set('density', '2400'); model.material('mat1').propertyGroup('CamClayModel').set('kappaSwelling', ''); model.material('mat1').propertyGroup('CamClayModel').set('lambdaComp', ''); model.material('mat1').propertyGroup('CamClayModel').set('Nvoid', ''); model.material('mat1').propertyGroup('CamClayModel').set('M', ''); model.material('mat1').propertyGroup('CamClayModel').set('kappaSwelling', '0.013'); model.material('mat1').propertyGroup('CamClayModel').set('lambdaComp', '0.032'); model.material('mat1').propertyGroup('CamClayModel').set('Nvoid', '0.7'); model.material('mat1').propertyGroup('MohrCoulomb').set('cohesion', ''); model.material('mat1').propertyGroup('MohrCoulomb').set('internalphi', '30[deg]'); model.physics('solid').prop('StructuralTransientBehavior').set('StructuralTransientBehavior', 'Quasistatic'); model.physics('solid').feature('lemm1').set('E_mat', 'userdef'); model.physics('solid').feature('lemm1').set('E', '2[MPa]'); model.physics('solid').feature('ccmm1').set('M_mat', 'MatchtoMC'); model.physics('solid').feature('ccmm1').set('evoid0', '0.6556'); model.physics('solid').feature('ccmm1').set('Pc0', '400[kPa]'); model.physics('solid').feature('ccmm1').set('minput_pressure_src', 'root.mod1.p'); model.physics('solid').feature('ccmm1').set('minput_pressure', '0'); model.physics('solid').feature('ccmm1').set('RefPressureCheck', '0'); model.physics('solid').feature('ccmm1').feature('iss1').set('Sil', {'-400[kPa]'; '0'; '0'; '0'; '-400[kPa]'; '0'; '0'; '0'; '-400[kPa]'}); model.physics('solid').feature('bndl1').set('LoadType', 'FollowerPressure'); model.physics('solid').feature('bndl1').set('FollowerPressure', '(2+param)*P0'); model.physics('solid').feature('bndl2').set('LoadType', 'FollowerPressure'); model.physics('solid').feature('bndl2').set('FollowerPressure', '2*P0'); model.physics('dl').feature('dlm1').set('rho_mat', 'userdef'); model.physics('dl').feature('dlm1').set('rho', '1000'); model.physics('dl').feature('dlm1').set('kappa_mat', 'userdef'); model.physics('dl').feature('dlm1').set('epsilon_mat', 'userdef'); model.physics('dl').feature('dlm1').set('epsilon', '0.1'); model.physics('dl').feature('dlm1').set('ktype', 'conductivity'); model.physics('dl').feature('dlm1').set('K', {'1e1[m/s]'; '0'; '0'; '0'; '1e1[m/s]'; '0'; '0'; '0'; '1e1[m/s]'}); model.physics('dl').feature('pr1').selection.active(false); model.physics('dl').feature('pr1').active(false); model.physics('dl').feature('weak1').set('weakExpression', '-d(solid.evol,TIME)*rhof*test(p)'); model.mesh('mesh1').feature('size').set('hauto', 9); model.mesh('mesh1').run; model.result.table('evl2').name('Evaluation 2D'); model.result.table('evl2').comments('Interactive 2D values'); model.study.create('std1'); model.study('std1').feature.create('time', 'Transient'); model.sol.create('sol1'); model.sol('sol1').study('std1'); model.sol('sol1').attach('std1'); model.sol('sol1').feature.create('st1', 'StudyStep'); model.sol('sol1').feature.create('v1', 'Variables'); model.sol('sol1').feature.create('t1', 'Time'); model.sol('sol1').feature('t1').feature.create('tp1', 'TimeParametric'); model.sol('sol1').feature('t1').feature.create('fc1', 'FullyCoupled'); model.sol('sol1').feature('t1').feature.remove('fcDef'); model.result.dataset.create('cpt1', 'CutPoint2D'); model.result.create('pg1', 'PlotGroup1D'); model.result('pg1').feature.create('ptgr1', 'PointGraph'); model.result('pg1').feature.create('ptgr2', 'PointGraph'); model.study('std1').feature('time').set('tlist', 'range(0,1e-6,1e-5)'); model.study('std1').feature('time').set('plistarr', {'range(0.1,0.1,1)'}); model.study('std1').feature('time').set('useparam', 'on'); model.study('std1').feature('time').set('pname', {'param'}); model.sol('sol1').attach('std1'); model.sol('sol1').feature('st1').name('Compile Equations: Time Dependent'); model.sol('sol1').feature('st1').set('studystep', 'time'); model.sol('sol1').feature('v1').set('control', 'time'); model.sol('sol1').feature('v1').feature('mod1_u').set('scaleval', '1e-2*0.11180339887498951'); model.sol('sol1').feature('v1').feature('mod1_u').set('scalemethod', 'manual'); model.sol('sol1').feature('t1').set('control', 'time'); model.sol('sol1').feature('t1').set('tlist', 'range(0,1e-6,1e-5)'); model.sol('sol1').feature('t1').feature('tp1').set('plistarr', {'range(0.1,0.1,1)'}); model.sol('sol1').feature('t1').feature('tp1').set('pname', {'param'}); model.sol('sol1').feature('t1').feature('tp1').set('control', 'time'); model.result.dataset('cpt1').set('pointx', '0'); model.result.dataset('cpt1').set('pointy', '0.025'); model.result.dataset('cpt1').set('bndsnap', true); model.result('pg1').set('xlabel', '-(solid.I1s/3+solid.pf) (N/m2)'); model.result('pg1').set('ylabel', '(3*solid.II2s)^0.5 (Pa)'); model.result('pg1').set('ylabelactive', false); model.result('pg1').set('xlabelactive', false); model.result('pg1').feature('ptgr1').set('xdataexpr', '-(solid.I1s/3+solid.pf)'); model.result('pg1').feature('ptgr1').set('descr', '(3*solid.II2s)^0.5'); model.result('pg1').feature('ptgr1').set('xdatadescr', '-(solid.I1s/3+solid.pf)'); model.result('pg1').feature('ptgr1').set('unit', 'Pa'); model.result('pg1').feature('ptgr1').set('xdataunit', 'N/m^2'); model.result('pg1').feature('ptgr1').set('xdata', 'expr'); model.result('pg1').feature('ptgr1').set('expr', '(3*solid.II2s)^0.5'); model.result('pg1').feature('ptgr2').set('xdataexpr', '-solid.I1s/3'); model.result('pg1').feature('ptgr2').set('descr', '(3*solid.II2s)^0.5'); model.result('pg1').feature('ptgr2').set('xdatadescr', '-solid.I1s/3'); model.result('pg1').feature('ptgr2').set('unit', 'Pa'); model.result('pg1').feature('ptgr2').set('xdataunit', 'N/m^2'); model.result('pg1').feature('ptgr2').set('xdata', 'expr'); model.result('pg1').feature('ptgr2').set('expr', '(3*solid.II2s)^0.5'); out = model;