|
[Sponsors] |
Problems with semiImplicitSource and buoyantBoussinesqSimpleFoam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 20, 2020, 15:35 |
Problems with semiImplicitSource and buoyantBoussinesqSimpleFoam
|
#1 |
Member
Andrea Di Ronco
Join Date: Nov 2016
Location: Milano, Italy
Posts: 57
Rep Power: 10 |
Hello!
I'm working on a custom solver derived from buoyantBoussinesqSimpleFoam (OF6). I need a simple sink for energy (linear in temperature), so until now what I did was something like: Code:
fvScalarMatrix TEqn ( fvm::div(phi, T) - fvm::laplacian(alphaEff, T) == radiation->ST(rhoCpRef, T) - heatExchanger*(HXCoeff/rhoCp)*(fvm::Sp(1, T) - TExt) + fvOptions(T) ); Everything runs ok so far and the results are exactly as expected. The problems come when I try to get rid of this hard-coded solution and use the semiImplicitSource fvOptions source, which in principle should allow to model the same sink at run-time. I removed the sink term from T equation, and added a fvOptions file which contains: Code:
heatExchanger { type scalarSemiImplicitSource; selectionMode all; volumeMode specific; injectionRateSuSp { T (Su Sp); } } Code:
Su = TExt * HXCoeff / rhoCp Sp = - HXCoeff / rhoCp I tried everything, such as switching from specific to absolute mode, changing signs and other stuff, but it seems a can't replicate the behaviour I desire. Can anyone tell me what I'm doing wrong? I have no clue, except (maybe) for having noticed that TEqn has dimensions [0 3 -1 1 0 0 0] and I don't understand how it is related to the way I have to implement a scalarSemiImplicitSource for the T equation. Thank you in advance for the help! Andrea EDIT: I figured out that the dimensions of TEqn are ok. They are basically K/s (the dimensions of the "physical" equation) multiplied by volume. This feature seems common to all kinds of equations and I guess it being related to the finite volume discretisation (they are the dimensions of the discretised/volume-integrated equation, not the physical one). This also explains why the addSup member function from SemiImplicitSource.C reads Code:
template<class Type> void Foam::fv::SemiImplicitSource<Type>::addSup ( fvMatrix<Type>& eqn, const label fieldi ) { [...] const GeometricField<Type, fvPatchField, volMesh>& psi = eqn.psi(); typename GeometricField<Type, fvPatchField, volMesh>::Internal Su ( IOobject ( name_ + fieldNames_[fieldi] + "Su", mesh_.time().timeName(), mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), mesh_, dimensioned<Type> ( "zero", eqn.dimensions()/dimVolume, Zero ), false ); [...] } Anyway, this explains the "strange" dimensions but doesn't solve my problem. Indeed, this also confirms that the fvOptions (Su Sp) coefficients for the T equation are supposed to have dimensions K/s and 1/s respectively, which means the I'm not messing up with the coefficients. The specific/absolute switch, if I got it right, basically determines if the coefficients are good as they are provided or if they need to be normalised by the cellZone volume before being applied to the equation. So I really don't get what I'm doing wrong, since I only have to set two simple coefficients... Last edited by Diro7; April 21, 2020 at 14:30. Reason: added information and reasoning |
|
February 8, 2023, 03:09 |
|
#2 |
New Member
Join Date: Sep 2022
Posts: 5
Rep Power: 4 |
Hi!
Did you figure out why it was diverging? I am running a similar case using semiImplicitSource and buoyantBoussinesqSimpleFoam. I want to confirm if the method of calculating Su Sp and explanations that you have provided are correct. |
|
February 8, 2023, 03:35 |
|
#3 |
Member
Andrea Di Ronco
Join Date: Nov 2016
Location: Milano, Italy
Posts: 57
Rep Power: 10 |
I don't exactly remember the issue, but my calculations were right.
The issue, if I'm correct, was related with how semiImplicitSource switches between implicit and explicit treatment of the linear term of the source based on the sign of the coefficient. If you are experiencing similar issues I can give you more detail (I'm pretty sure there was a thread specifically on this matter but I can't find it right now). |
|
Tags |
buoyant boussinesq, semiimplicitsource |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
fvOptions SemiImplicitSource - scalarSemiImplicitSourceCoeffs | ChrisHa | OpenFOAM Post-Processing | 4 | March 6, 2019 05:24 |
Customized semiImplicitSource | Ricky-11 | OpenFOAM Programming & Development | 1 | November 25, 2016 13:04 |
Inactive debug switches for fvOption SemiImplicitSource | GerhardHolzinger | OpenFOAM Bugs | 6 | March 28, 2015 17:06 |
SemiImplicitSource injection rate is per timestep? | derekm | OpenFOAM Running, Solving & CFD | 1 | January 1, 2015 12:46 |
Problems in my first attempt with chtMultiRegionSimpleFoam | zfaraday | OpenFOAM Running, Solving & CFD | 1 | April 8, 2014 19:20 |