About to write my PhD thesis and I don't know the basics and fundamentals. I am feeling unworthy of the PhD title. What should I do? My PhD work is on modeling a 3D printing process using a commercial FEM software. But I am not confident with basics of finite element theory, non linear Finite element analysis to be accurate, which I learnt by self study. My work was mostly application of established models, so I didn’t have to do any numerical work in my research. It's my final year (starting to write my thesis) and I am not happy with my level of expertise. I am freaking out. What do I do? Sad part is I am in 6th year of PhD.
Nobody knows everything. In many fields it is impossible to know everything about that field. In mathematics it was possible for an individual to know everything up through the end of the 19th century, and a few people did. Henri Poincaré was a likely candidate. But after that it soon became impossible as there was just too much. Computer Science has probably passed out of the era where it was possible to know it all, but it was (possibly) somewhere around the end of the 20th century. 

There is a psychological effect called Imposter Syndrome in which you don't believe that you are as good as others know you to be. It affects many people, including many academics. 

Learning is a life-long activity. I suggest that in the short term you just get on with it and write the thesis, working as you normally do, which I'm sure includes study. In the longer term you can, as you would likely do anyway, work to fill in those bits that you think you are missing. 

But don't delay your work now until you think you are ripe. That point may never come, even though you are perfectly capable at each point at which it matters. 

The feeling may never go away. But if you know it for what it is, it needn't inhibit you or become debilitating.