跳转至

TunnelNew

user_BoxTunnelNew1.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
%build the geometrical model
clear;
fs.randSeed(1);%build random model
B=obj_Box;%build a box object
B.name='BoxTunnelNew';
B.GPUstatus='auto';
width=50;length=0;height=50;ballR=0.2;%width, length, height, radius
distriRate=0.2;%define distribution of ball radius, 
isClump=0;
%--------------initial model------------
B.isUI=0;%when run the code in UI_command, isUI=1
B.ballR=ballR;
B.isClump=isClump;
B.distriRate=distriRate;
B.sampleW=width;
B.sampleL=length;
B.sampleH=height;
%B.BexpandRate=4;
%B.PexpandRate=4;
B.type='topPlaten';
%B.type='TriaxialCompression';
B.setType();
B.buildInitialModel();%B.show();
d=B.d;
%--------------end initial model------------
B.gravitySediment();
B.compactSample(6);%input is compaction time
%------------return and save result--------------
mfs.reduceGravity(d,10);
d.balance('Standard');
d.status.dispEnergy();%display the energy of the model
d.clearData(1);%clear dependent data
d.recordCalHour('BoxTunnelNew1Finish');
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_BoxTunnelNew2.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
%set the material of the model
clear
load('TempModel/BoxTunnelNew1.mat');
%------------initialize model-------------------
B.setUIoutput();
d=B.d;
d.calculateData();
d.mo.setGPU('off');
d.getModel();%get xyz from d.mo
%------------end initialize model-------------------

%-------------set new material----------------
matTxt=load('Mats\StrongRock.txt');
Mats{1,1}=material('StrongRock',matTxt,B.ballR);
Mats{1,1}.Id=1;
d.Mats=Mats;
d.groupMat2Model({'sample'},1);
%-------------end set new material----------------

%-------------------apply stress, and balance model------------------
B.SET.stressZZ=-10e6;
B.setPlatenFixId();
d.resetStatus();
fs.setPlatenStress(d,0,0,B.SET.stressZZ,B.ballR*5);%apply no
%-------------------end apply stress, and balance model------------------

%--------------------make tunnel-----------------------
sampleId=d.getGroupId('sample');
sX=d.mo.aX(sampleId);sY=d.mo.aY(sampleId);sZ=d.mo.aZ(sampleId);
dipD=0;dipA=90;radius=4;height=30;
mX=d.mo.aX(1:d.mNum);mY=d.mo.aY(1:d.mNum);mZ=d.mo.aZ(1:d.mNum);mR=d.mo.aR(1:d.mNum);
columnFilter=f.run('fun/getColumnFilter.m',sX,sY,sZ,dipD,dipA,radius+B.ballR,height);
d.addGroup('Tunnel',find(columnFilter));
tunnelId=d.getGroupId('Tunnel');
d.delElement(tunnelId);
%--------------------end make tunnel-----------------------

B.name='BoxTunnelNew';
innerR=radius;
layerNum=3;
minBallR=min(mR);
Rrate=0.8;
ringObj=f.run('fun/makeRing.m',innerR,layerNum,minBallR,Rrate);
ringObj=mfs.rotate(ringObj,'YZ',90);%rotate the group along XZ plane

ringId=d.addElement(1,ringObj);%add a slope boundary
d.addGroup('ring',ringId);%add a new group
d.setClump('ring');%set the pile clump
d.moveGroup('ring',(max(mX)+min(mX))/2,0,(max(mZ)+min(mZ))/2);
d.minusGroup('sample','ring',0.4);%remove overlap elements from sample
d.breakGroup();
B.gravitySediment();
d.show();

%--------------------save data-----------------------
d.mo.setGPU('off');
d.clearData(1);
d.recordCalHour('BoxTunnel2Finish');
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']);
%--------------------end save data-----------------------

d.calculateData();
d.show('ZDisplacement');
user_BoxTunnelNew3.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
50
51
52
53
54
55
56
57
58
%-------------------user_mxSlope3.m;
clear;
load('TempModel/BoxTunnelNew2.mat');
B.setUIoutput();
%------------initialize model-------------------
d=B.d;
d.calculateData();
d.mo.setGPU('off');
d.mo.bFilter(:)=true;
d.deleteConnection('boundary');
d.mo.zeroBalance();
d.getModel();%d.setModel();%reset the initial status of the model
d.resetStatus();
d.mo.isHeat=1;%calculate heat in the model
d.setStandarddT();
d.mo.isCrack=1;
%------------end initialize model-------------------

%--------------------apply initial stress-----------------------
fs.setPlatenStress(d,0,0,B.SET.stressZZ,B.ballR*5);
d.mo.setGPU('auto');
d.balance('Standard',1);%standard balance

%--------------------end apply initial stress-----------------------

%--------------------set block force--------------------
tp=d.GROUP.topPlaten;
blockWidth=8;
tpX=d.mo.aX(tp);
tpXCenter=(max(tpX)+min(tpX))/2;
blockFilter=tpX>(tpXCenter-blockWidth/2)&tpX<(tpXCenter+blockWidth/2);
blockId=tp(blockFilter);
d.addGroup('block',blockId);
blockForceZ=d.mo.mGZ(blockId);

%--------------------end set block force--------------------

totalCircle=2;
d.tic(totalCircle);%record the initial time of loop
fName=['data/step/' B.name  num2str(B.ballR) '-' num2str(B.distriRate) 'loopNum'];
save([fName '0.mat']);%return;
gpuStatus=d.mo.setGPU('auto');
for i=1:totalCircle
    d.mo.mGZ(blockId)=d.mo.mGZ(blockId)+blockForceZ;
    d.balance('Standard',1);%standard balance
    d.clearData(1);
    d.mo.setGPU('off');
    save([fName num2str(i) '.mat']);
    d.calculateData();
    d.mo.setGPU(gpuStatus);
    d.toc();%show the note of time;
end

d.recordCalHour('BoxTunnel3Finish');
d.mo.setGPU('off');
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.show('aR');