|
[Sponsors] |
fvc::laplacian(rAUf, p_rgh) versus fvm::laplacian(rAUf, p_rgh) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 23, 2015, 12:46 |
|
#21 |
Senior Member
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 15 |
Hello Bruno,
Regarding point 1.: yes, I did write a thesis myself a while ago. I do not dare to reread it... Point 2: I have to correct myself: doing the balance on a reduced by cell volume basis is not possible, since you cannot balance flows reduced by volume, but only flows. You end up getting the same equation system, since if you build the matrix on a "divided by cell volume" basis, you end up to multiply the matrix by that cell volume. I was thinking a little bit too fast.... Point 3: I mean that there is a an implementation of Laplacian in gaussLaplacianScheme.C and gaussLaplacianSchemes.C, whereas the later is called both for Laplacians of vector fileds (in Ueq) and scalar fields (pEq) and the code is enbedded in a #define statement with these back slash at the end of each line. I have not found such long code lines after #define anywhere else in the OpenFoam code. Regards, Daniel |
|
October 18, 2015, 08:51 |
|
#22 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Daniel,
Quote:
But I see your point... let me see if I can find where OpenFOAM uses the general implementation... ah, OK, this is one of those situations where they seem to first implement the generic class, but then only create one specialization. There are a few other times that they did this in OpenFOAM. In theory, this is a good programming manoeuvre, because this means that you're planning for possible future implementations. Problem might be if you don't test the generic implementation with other situations... Oh, wait, there is another reason for this: the template class defined in "laplacianScheme.C" is also fully generalized: https://github.com/OpenFOAM/OpenFOAM...lacianScheme.C - which is why the main template class for "gaussLaplacianScheme" is also fully generalized. Have a look here: https://github.com/OpenFOAM/OpenFOAM...acianSchemes.C - you'll see that the fully generalized Laplacian will take into account creating variants that use "scalar", "symmTensor" and "tensor". But for the Gaussian implementation, the "scalar" has a special implementation, i.e. a specialization. In review, the generic Laplacian accounts for the following types:
Quote:
And this one in particular might give a clearer notion of all of the variants that are used for the Laplacian: https://github.com/OpenFOAM/OpenFOAM...nScheme.H#L224 Best regards, Bruno |
|||
Tags |
laplacian operator |
|
|