CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Method of manufactred solutions MMC (https://www.cfd-online.com/Forums/main/160290-method-manufactred-solutions-mmc.html)

zaynab October 5, 2015 09:41

Method of manufactred solutions MMC
 
Dear all,

I developed a conduction diffusion code and I want to verify it with the manufactred solutions method.

My question: is there a known form for the supposed equation that fit the best with a conduction diffusion problem, otherwise How to choose an appropriate manufactred solution ?

Thanks in advance.

mprinkey October 5, 2015 09:58

I've only used this method once, but I think you should try to construct a base solution that fully represents the array of physical phenomena that you are trying to model. For conduction/diffusion, you will probably have linear behavior in slow moving areas and approximately passive advection in fast moving areas. Maybe build an approximate model the tries to encompass that.

While, in theory, any solution could be generated by the method, it is probably important to known what to avoid. Like, in your case, you probably don't want to include some high-frequency harmonics in the base solution, because that type of behavior is not going to be manifest in your typical problem.

I would also caution that you match the treatment of the manufactured solution source terms and boundary conditions carefully. For example, if you are using FVM, remember that the source terms needs to be integrated over each control volume, not just evaluated at the centroid--if you are looking closely at conservation, etc.

zaynab October 6, 2015 04:40

Thank you mprinkey, but I didn't get your last remark about the source term.

kaya October 6, 2015 06:23

I am not sure what would you call the best since that pretty much depends how you solve your system.

I did a similar study with a spectral code. I had to manufacture a solution with using exp(sin) etc. like polynomials to make it hard to catch with fourier modes else with a simple sin(x), I could reach the machine accuracy with 2 grid points.

If you're using finite difference on derivatives you can start by picking some trigonometric polynomials from the shelf.

I personally don't believe that you need to think about physics but math at this stage. I might not be correct.

You can also use periodic b.c. which comes in handy with trigonometric guys.

mprinkey October 6, 2015 08:28

Quote:

Originally Posted by zaynab (Post 566720)
I didn't get your last remark about the source term.

If you have a system F(u) = 0, where F() is a differential operator, and you pick a solution v that you manufacture, then the source term that you need to apply to the RHS is F(v). So the system you try to solve is F(u) = F(v) where u is your unknown variable.

So, F(v) is the source term I am talking about. When you discretize it, be sure to use a scheme consistent with FVM. If you just do the continuous derivative operations on F(v) and and then evaluate at it at the centroid, you will only being getting a second-order approximation. You will need to do the full integral over each control volume to get the correct error convergence. For example, in 1D:

d^2/dx^2(u) = 0 -> d^2/dx^2(u) = d^2/dx^2(sin(x)) where we want the solution to be sin(x)

that reduces to d^2/sx^2(u) = -sin(x). To implement that source term over a CV from x=0.1 to x=0.2, you should make the source term integral(-sin(x),0.1,0.2) and NOT make the source term 0.1 * (-sin(0.15)). Those two are only the same to order dx^2 and that error will pollute your convergence plots....assuming you are using higher-order schemes.

zaynab October 6, 2015 11:08

mprinkey, Thanks!
It's clear now :)


All times are GMT -4. The time now is 21:15.