Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find equations/theory for SLAB subroutine #52

Closed
EmilSoleymani opened this issue May 17, 2022 · 7 comments
Closed

Find equations/theory for SLAB subroutine #52

EmilSoleymani opened this issue May 17, 2022 · 7 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@EmilSoleymani
Copy link
Collaborator

EmilSoleymani commented May 17, 2022

Find equations/theory for SLAB subroutine in lines 218-266 of the FORTRAN code. More info here in issue #14.

@EmilSoleymani
Copy link
Collaborator Author

This comment and this show my analysis of the subroutine, and the Boussineq equations I suspect are used in the code. I was hoping you could confirm which formula exactly is used.

@smiths
Copy link
Owner

smiths commented May 30, 2022

@EmilSoleymani, could you be more specific about which lines of code you mean? Maybe this is a good question for @dstolle?

@EmilSoleymani
Copy link
Collaborator Author

I updated the link

@EmilSoleymani
Copy link
Collaborator Author

@dstolle @smiths

I have translated the original FORTRAN code of this subroutine into Julia in the wip-slab-calc branch. The code can be found here.

function getSurchargePressure(behaviour, P::Array{Float64}, PP::Array{Float64})
# foundationDepth = behaviour.bottomPointIndex * behaviour.dx
dxx = 0.0
wt = PP[behaviour.bottomPointIndex]
pressure1 = behaviour.appliedPressure - wt
pressure = pressure1
for i=behaviour.bottomPointIndex:behaviour.nodalPoints
if dxx < 0.01
P[i] += pressure
dxx += behaviour.dx
continue
end
# material = behaviour.soilLayerNumber[i-1]
if behaviour.foundation == "LongStripFooting"
db = dxx / behaviour.foundationWidth
ps = (db < 2.5 && behaviour.center) ? -0.28*db : -0.157 - 0.22*db
ps *= 10
P[i] += pressure*ps
else
basePressure = (behaviour.center) ? pressure : pressure/4
length = (behaviour.center) ? behaviour.foundationLength/2 : behaviour.foundationLength
width = (behaviour.center) ? behaviour.foundationWidth/2 : behaviour.foundationWidth
ve2 = (length^2 + width^2 + dxx^2)/(dxx^2)
ve = sqrt(ve2)
an = length*width/(dxx^2)
enm = (2 * an * ve / (ve2 + an^2)) * (ve2+1)/ve2
fnm = (2 * an * ve / (ve2 - an^2))
ab = (fnm < 0) ? atan(fnm) + pi : atan(fnm)
P[i] += basePressure * (enm+ab)/pi
end
dxx += behaviour.dx
end
return P
end

I am having a hard time matching the code to formulas from the textbook. I am getting really close, but I can't show a 1:1 correspondence. It seems the SLAB subroutine is using the Boussinesq equation for the stress at a point under the corner of a rectangular area, as seen on p.141 of Settlment's Analysis textbook:

image

Chunks of the code seem very alike to the above screenshot, however I can't seem to prove that they match exactly. For reference, here is their code:

50 VE2=(BL**2.+BW**2.+DXX**2.)/(DXX**2.)
VE=VE2**0.5
AN=BL*BW/(DXX**2.)
AN2=AN**2.
ENM=(2.*AN*VE/(VE2+AN2))*(VE2+1.)/VE2
FNM=2.*AN*VE/(VE2-AN2)

The variable FNM is what gets passed in as the argument to the ATAN function. Looking at the equation, this matches ab/zC. BL is a, BW is b, and DXX is z. Here are screenshots of me trying to equate FNM to ab/zC:

image

image

Would it be better to copy how they did their FORTRAN code in our Julia (which I have already done), or to calculate exactly the formula given in the screenshots from the textbook.

Furthermore, everything discussed above was what happens for Rectangular Slab foundations. For Long Strip Footings, there is a different calculation used which I cannot find in any resources:

if behaviour.foundation == "LongStripFooting"
db = dxx / behaviour.foundationWidth
ps = (db < 2.5 && behaviour.center) ? -0.28*db : -0.157 - 0.22*db
ps *= 10
P[i] += pressure*ps
else

I couldn't think of any better/more meaningful names for all these intermediate variables (like ps, ve, ve2, an, ...), so I am hoping for some suggestions as well.

Also, the original fortran code calculates some variables that are never used:

ANBX=FLOAT(NBX)*DX

MTYP=IE(I-1,1)

I had originally copied these in the code, only to realize they are never used. I commented them out incase there is some use for them.

There is also this weird code:

BPRE1=Q-WT
BPRES=BPRE1

I have copied it just like this (BPRE1 is called pressure1, BPRES is called pressure). However, I don't see the need for BPRE1 since they never update BPRES and always just use its value.

Finally, I am pretty confident that the following code uses the 2:1 method for calculating stress at center of slab (divides length and with by 2 and pressure by 4):

basePressure = (behaviour.center) ? pressure : pressure/4
length = (behaviour.center) ? behaviour.foundationLength/2 : behaviour.foundationLength
width = (behaviour.center) ? behaviour.foundationWidth/2 : behaviour.foundationWidth

image

@dstolle
Copy link
Collaborator

dstolle commented Jun 6, 2022 via email

@smiths
Copy link
Owner

smiths commented Jun 6, 2022

@EmilSoleymani good summary of your question. In the short term you should definitely use the translation of the FORTRAN code. We are confident that the FORTRAN code is correct. As we get a better understanding of the mapping between the theory and code, we may decide to change to something more understandable. As long as you continue to add test cases as you write the code, continuous integration should give us confidence that any changed code is still correct.

@dstolle that would be great if you could help @EmilSoleymani with this issue. When you reply, please use the web-interface for GitHub, rather than replying via e-mail. You can find the web-interface for this issue here:

#52

You should be able to just click on the hyperlink.

@smiths
Copy link
Owner

smiths commented Jun 6, 2022

@dstolle, this isn't the proper way to use the issue tracker, but did you get the e-mail I sent about the meeting on Wednesday (June 8)? Emil and I are meeting at 1:00 pm in my office if you are available to join us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants