|
[Sponsors] |
Implementing scalarcoded source in chtmultiregionFoam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 8, 2021, 12:46 |
Implementing scalarcoded source in chtmultiregionFoam
|
#1 |
New Member
Anish Pal
Join Date: Dec 2020
Posts: 3
Rep Power: 5 |
I want to implement a time varying vol. heat generation in chtmultiregionFoam. I have done so following the previous threads but my temperature is not increasing. Can anyone please help me. And sometimes while running the solver it is saying selection mode not define although i have defined it. I think the codedsource is not being properly read by the solver. I am attaching the case here as well.
|
|
March 10, 2021, 11:55 |
|
#2 |
New Member
Anish Pal
Join Date: Dec 2020
Posts: 3
Rep Power: 5 |
Can anyone please help me?
|
|
July 27, 2021, 10:22 |
|
#3 |
New Member
Sergey
Join Date: Apr 2018
Posts: 16
Rep Power: 8 |
In all examples heat source value is added to the heSource field:
Code:
heSource += 1e3*(time.value())*V; |
|
July 27, 2021, 17:15 |
|
#4 |
New Member
Sergey
Join Date: Apr 2018
Posts: 16
Rep Power: 8 |
After investigation using method described in this post I've learned that additional heat source value should be negative and must be divided among mesh cells. So I came up with this line:
Code:
heSource -= (heatW / (heSource.size())); Make sure that heatW is a floating point variable, otherwise you'll get rounded integer division. |
|
July 27, 2021, 17:38 |
|
#5 | |
Member
Join Date: Mar 2021
Posts: 39
Rep Power: 5 |
Quote:
Please correct me if I am wrong, but to implement a source term with fvOptions I think you should have the following: Code:
const scalarField& V = mesh_.V(); scalarField& S = eqn.source(); forAll(S, cellI) { // Calculation of your source term for each cell in the domain mySourceTermForCelllI = Something S[cellI] = -V[cellI] * mySourceTermForCelllI; } OpenFOAM documentation says that the file can "live" in both folders [https://www.openfoam.com/documentati...voptions.html]. This must be one of the only dictionaries with this type of flexibility ... |
||
July 27, 2021, 17:53 |
|
#6 |
New Member
Sergey
Join Date: Apr 2018
Posts: 16
Rep Power: 8 |
Yes, I've skipped boilerplate code. Additionally, mesh_.V() is a cell volume list. You'll need it only if you define your heat source in [W/m^3] units.
|
|
July 27, 2021, 19:02 |
|
#7 | |
Member
Join Date: Mar 2021
Posts: 39
Rep Power: 5 |
Quote:
Sorry if this is too basic, but do you know the reason why I am multiplying by the cell volume and the heat source is being given in [W/m^3]. |
||
July 28, 2021, 04:57 |
|
#8 |
New Member
Sergey
Join Date: Apr 2018
Posts: 16
Rep Power: 8 |
||
Tags |
chtmultiregionfoam, scalarcodedsource |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.com] swak4foam compiling issues on a cluster | saj216 | OpenFOAM Installation | 5 | January 17, 2023 17:05 |
polynomial BC | srv537 | OpenFOAM Pre-Processing | 4 | December 3, 2016 10:07 |
OpenFOAM without MPI | kokizzu | OpenFOAM Installation | 4 | May 26, 2014 10:17 |
[swak4Foam] funkySetFields compilation error | tayo | OpenFOAM Community Contributions | 39 | December 3, 2012 06:18 |
friction forces icoFoam | ofslcm | OpenFOAM | 3 | April 7, 2012 11:57 |