|
[Sponsors] |
March 2, 2022, 17:18 |
Conservatively Smoothing a Source Term
|
#1 |
Member
Kellis
Join Date: Mar 2017
Posts: 39
Rep Power: 9 |
Hello all,
I am attempting to solve a conjugate heat transfer problem where viscous heating plays an important role in the overall process. I am solving the energy equation as follows: Due to the nature of the problem, the viscous heating term varies many orders of magnitude over the width of a few cells, and causes some instabilities / oscillations when solving for the temperature. To combat this, I am hoping to implement some sort of smoothing algorithm which conserves the overall amount of viscous heating, but distributes it within a wider area to make the computation more stable. For instance in 1D, assuming a uniform grid spacing, this smoothing algorithm might turn a field that looks like this: [ 1 1 1 10 1 1 1 ] Into one which looks like this: [ 1 2 3 4 3 2 1 ] Ideally, the "width" of the spread would be controllable by the user. I am sure such an algorithm exists already, but I am not sure what the correct search terms would be, and my initial efforts to find such a method have not yielded any good leads. If anyone has a suggestion for a method I might try, I would be grateful. Additionally, any other strategies I might try to increase the stability of the problem would be appreciated. Thanks, Kellis |
|
March 3, 2022, 05:44 |
|
#2 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
Hello,
You can try to first interpolate to the faces and then avarage over the faces of the cell. The code would look like this: Code:
volScalarField smoothedSoure (fvc::average(fvc::interpolate(source))); |
|
March 3, 2022, 06:14 |
|
#3 |
Senior Member
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21 |
You can solve diffusion equation in pseudo-time, like that:
dimensionedScalar pseudoDeltaT ("dT", dimTime, 1.0); dimensionedScalar Dphi ("Dphi", dimLength*dimLength/dimTime, 1.0); solve ( fvm::Sp(1.0/pseudoDeltaT, Phi) - fvc::Sp(1.0/pseudoDeltaT, Phi) - fvm::laplacian(Dphi, Phi) );
__________________
MDPI Fluids (Q2) special issue for OSS software: https://www.mdpi.com/journal/fluids/..._modelling_OSS GitHub: https://github.com/unicfdlab Linkedin: https://linkedin.com/in/matvey-kraposhin-413869163 RG: https://www.researchgate.net/profile/Matvey_Kraposhin |
|
March 3, 2022, 06:59 |
|
#4 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
What's the purpose of
fvm::Sp(1.0/pseudoDeltaT, Phi) - fvc::Sp(1.0/pseudoDeltaT, Phi) Numerical stability of the equations? |
|
March 3, 2022, 07:15 |
|
#5 | |
Senior Member
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21 |
Quote:
If you use diffusion equation w/o temporal term, then your Phi distribution will be smoothed across a whole domain. But with adjustment of ratio between "pseudoDeltaT" and Dphi you can tune how many cells around initial field will be affected during one pseudo iteration.
__________________
MDPI Fluids (Q2) special issue for OSS software: https://www.mdpi.com/journal/fluids/..._modelling_OSS GitHub: https://github.com/unicfdlab Linkedin: https://linkedin.com/in/matvey-kraposhin-413869163 RG: https://www.researchgate.net/profile/Matvey_Kraposhin |
||
March 3, 2022, 07:25 |
|
#6 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
That's interesting. Can you recommend someone regarding about the method?
|
|
March 3, 2022, 07:28 |
|
#7 |
Senior Member
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21 |
This is a simple idea, which arises from the concept of numerical diffusion of convection equation.
http://www.mathematik.tu-dortmund.de.../Transport.pdf Or just walk around this personal page: http://www.mathematik.tu-dortmund.de/~kuzmin/
__________________
MDPI Fluids (Q2) special issue for OSS software: https://www.mdpi.com/journal/fluids/..._modelling_OSS GitHub: https://github.com/unicfdlab Linkedin: https://linkedin.com/in/matvey-kraposhin-413869163 RG: https://www.researchgate.net/profile/Matvey_Kraposhin Last edited by mkraposhin; March 3, 2022 at 07:38. Reason: grammar correction |
|
March 5, 2022, 15:12 |
|
#8 | |
Senior Member
Josh Williams
Join Date: Feb 2021
Location: Scotland
Posts: 113
Rep Power: 5 |
Quote:
I used code from the CFDEMcoupling library to do something similar. You can copy the function from this GitHub repository. There are some user-defined lengths and lower/upper limits you can use to tune the diffusion. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[openSmoke] LaminarSMOKE compilation error | mdhfiz | OpenFOAM Community Contributions | 8 | July 2, 2024 11:32 |
[Other] Tabulated thermophysicalProperties library | chriss85 | OpenFOAM Community Contributions | 62 | October 2, 2022 04:50 |
polynomial BC | srv537 | OpenFOAM Pre-Processing | 4 | December 3, 2016 10:07 |
"parabolicVelocity" in OpenFoam 2.1.0 ? | sawyer86 | OpenFOAM Running, Solving & CFD | 21 | February 7, 2012 12:44 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 02:24 |