https://linen.dev logo
I see several problems with your approach. The fir...
# programming
s
I see several problems with your approach. The first is that the fvc::grad() is going to be cached so a second call to fvc::grad() is just goingt to bring the "old one" even if you "shallow" copy U. The second problem is that you'll have to call the specific gradient scheme you wanna use, and not the templated fvc::grad(). The third, and less obvious, is that you are generating too many fields.! What you want to do is to is for example to store the gradients via (1) tmp<> , and (2) call the specific gradient you need via autoPtr<> instead of calling the templated fvc::grad().