I don't have the theoretical background in my PhD topic. I can't justify getting the degree I did my PhD in computational materials science. I used molecular dynamics simulations and finite element method to carry out my research investigations. I have published several publications and about to defend my thesis next month.

But, I did not take any classes on finite element analysis or molecular dynamics during my undergraduate or graduate school. Whatever theory I know about them is through self study and through work experience. I understand the concepts of the methods, but I never got a chance to have a formal course with exams and assignments on the subjects. So, my self study hasn't been very meticulous.

Now, I feel like a charlatan, and don't feel like I deserve a PhD degree. I am also feeling lost and like a loser. Saddest thing is that, I passed all my qualifiers, proposals and no one questioned my abilities. 

I don't know what can I do to feel confident again. I am 31 years old. I always thought that by the end of PhD I will be a confident researcher.
First, learn something about Imposter Syndrome. This sounds like a classic case of it. You have been a success already. Your advisor, I assume, had no doubts about your ability. So try to just ignore the "feelings" and keep on doing what you do. 

Success comes from hard work, not from feeling like you are capable of it. Your feelings might well change as you produce more in your field. But even if they don't, you can still be a success. 

But I suggest, also, that you build up a circle of collaborators that you can interact with. You will learn from them, but you may also learn from them that you have all the necessary qualifications. 

Moreover, your education needn't end when you finish your degree. Books and papers can help you fill in the formal bits you think you lack. Your advisor has, I hope, given you feedback. The same will be true of reviewers of papers you submit. If they don't notice and lack, then you probably aren't lacking in fact. At least not by a lot. Everyone can learn at every stage of life.