跳转至

LandSubsidence

user_L2LandSubsidence1.m
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
%build the geometrical model
clear;
fs.randSeed(2);%build random model
B=obj_Box;%build a box object
B.name='BoxLandSubsidence';
B.GPUstatus='auto';
B.ballR=1;%default value is 0.5, use 1 to increase speed
B.isClump=0;
B.distriRate=0.2;
B.sampleW=200;
B.sampleL=0;
B.sampleH=80;
B.type='GeneralSlope';
%B.type='TriaxialCompression';
B.setType();
B.buildInitialModel();%B.show();

B.setUIoutput();
d=B.d;
d.mo.setGPU('auto');
%--------------end initial model------------
B.gravitySediment();
%------------return and save result--------------
d.status.dispEnergy();%display the energy of the model

d.clearData(1);%clear dependent data
d.recordCalHour('Box1Finish');
save(['TempModel/' B.name '1.mat'],'B','d');
save(['TempModel/' B.name '1R' num2str(B.ballR) '-distri' num2str(B.distriRate)  'aNum' num2str(d.aNum) '.mat']);
d.calculateData();
d.show('aR');
user_L2LandSubsidence2.m
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
%set the material of the model
clear
load('TempModel/BoxLandSubsidence1.mat');
B.setUIoutput();%set output of message
d=B.d;
d.calculateData();
d.mo.setGPU('off');
d.getModel();%get xyz from d.mo

%---------set material of model
matTxt=load('Mats\SoilLandSubsidence.txt');%material of soil
Mats{1,1}=material('Soil1',matTxt,B.ballR);
Mats{1,1}.Id=1;
matTxt2=load('Mats\Rock1.txt');
Mats{2,1}=material('Rock1',matTxt2,B.ballR);%material of rock
Mats{2,1}.Id=2;
d.Mats=Mats;
%---------end set material of model

%---------cut model and make layers
C=Tool_Cut(d);%cut the model
lSurf=load('slope/LandSubsidence.txt');%load the surface data
C.addSurf(lSurf);%add the surfaces to the cut
C.setLayer({'sample'},[1,2,3]);%set layers according geometrical data
gNames={'lefPlaten';'rigPlaten';'botPlaten';'layer1';'layer2'};
d.makeModelByGroups(gNames);%build new model using layer1 and 2
%set material of group
d.setGroupMat('layer1','Rock1');
d.setGroupMat('layer2','Soil1');
d.defineWallElement('layer1');%change rigid rock to wall
%d.show();
d.groupMat2Model({'layer1','layer2'});
%---------end cut model and make layers

%---------balance the model
d.balanceBondedModel0();
d.mo.bFilter(:)=true;
d.balance('Standard');
d.mo.bFilter(:)=true;
d.balance('Standard');
%---------end balance the model

%---------save data
d.mo.setGPU('off');
d.clearData(1);
d.recordCalHour('BoxModel2Finish');
save(['TempModel/' B.name '2.mat'],'B','d');
save(['TempModel/' B.name '2R' num2str(B.ballR) '-distri' num2str(B.distriRate)  'aNum' num2str(d.aNum) '.mat']);
d.calculateData();
user_L2LandSubsidence3.m
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
clear;
load('TempModel/BoxLandSubsidence2.mat');
B.setUIoutput();
d=B.d;
d.calculateData();
d.mo.setGPU('off');

%-------------initializing parameters
mGZ0=d.mo.mGZ;%record the initial gravity of element
mZ=d.mo.aZ(1:d.mNum);
mR=d.mo.aR(1:d.mNum);
mVolumn=4/3*pi*mR.*mR.*mR;%volumn of elements
waterDensity=1e3;
waterTable1=55;%initial water table
waterTable2=25;
mBuoyancy=-waterDensity*mVolumn*d.mo.g;%buoyancy of element
%-------------end initializing parameters

%-------------initializing model
waterFilter=mZ<waterTable1;%filter of element under the water table
d.mo.mGZ=mGZ0+mBuoyancy.*waterFilter;
d.balanceBondedModel0();%bond the model and balance it without friction
d.mo.bFilter(:)=true;%bond all elements
d.balance('Standard');

d.mo.isCrack=1;%record the information of cracks
d.getModel();%d.setModel();%reset the initial status of the model
d.resetStatus();%initialize model status, which records running information
d.mo.isHeat=1;%calculate heat in the model
visRate=1;
d.mo.mVis=d.mo.mVis*visRate;%change the viscosity of the simulation
d.setStandarddT();
%-------------end initializing model

%-------------when water table drops
waterFilter=mZ<waterTable2;%filter of element under the water table
mBuoyancy=-waterDensity*mVolumn*d.mo.g;
d.mo.mGZ=mGZ0+mBuoyancy.*waterFilter;
d.balance('Standard');

d.show('Displacement');
d.mo.setGPU('off');
d.clearData(1);
d.recordCalHour('BoxModel3Finish');
save(['TempModel/' B.name '3.mat'],'B','d');
save(['TempModel/' B.name '3R' num2str(B.ballR) '-distri' num2str(B.distriRate)  'aNum' num2str(d.aNum) '.mat']);
d.calculateData();