|
[Sponsors] |
scalarTransport functionObjects--coefficients alphaD and alphaDt have no effects |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 16, 2022, 06:45 |
scalarTransport functionObjects--coefficients alphaD and alphaDt have no effects
|
#1 |
New Member
Thomas Shi
Join Date: Jan 2018
Posts: 20
Rep Power: 8 |
Hi foamers!
I am trying to simulate passive scalar transport in water with OpenFOAM-V2206. I used scalarTransport function in controlDict. As for the diffusion coefficient, a specified constant coefficient D did have effects on the results though I didn't get a good result in this way. Then I noticed the desciption in scalarTransport.H and got these lines below: Code:
Alternatively if a turbulence model is available a turbulent diffusivity may be constructed from the laminar and turbulent viscosities using the optional diffusivity coefficients alphaD and alphaDt (which default to 1): D = alphaD*nu + alphaDt*nut Code:
Foam::tmp<Foam::volScalarField> Foam::functionObjects::scalarTransport::D ( const volScalarField& s, const surfaceScalarField& phi ) const { const word Dname("D" + s.name()); if (constantD_) { return tmp<volScalarField>::New ( IOobject ( Dname, mesh_.time().timeName(), mesh_.time(), IOobject::NO_READ, IOobject::NO_WRITE ), mesh_, dimensionedScalar(Dname, phi.dimensions()/dimLength, D_) ); } if (nutName_ != "none") { const volScalarField& nutMean = mesh_.lookupObject<volScalarField>(nutName_); return tmp<volScalarField>::New(Dname, nutMean); } // Incompressible { const auto* turb = findObject<incompressible::turbulenceModel> ( turbulenceModel::propertiesName ); if (turb) { return tmp<volScalarField>::New ( Dname, alphaD_ * turb->nu() + alphaDt_ * turb->nut() ); } } // Compressible { const auto* turb = findObject<compressible::turbulenceModel> ( turbulenceModel::propertiesName ); if (turb) { return tmp<volScalarField>::New ( Dname, alphaD_ * turb->mu() + alphaDt_ * turb->mut() ); } } Code:
alphaD_ = dict.getOrDefault<scalar>("alphaD", 1); alphaDt_ = dict.getOrDefault<scalar>("alphaDt", 1); From this way, I edited the scalarTransport function in my controlDict as follows: Code:
sTransport { type scalarTransport; libs (solverFunctionObjects); enabled true; writeControl writeTime; writeInterval 1; field s; bounded01 false; phase alpha.water; rho rho; p p_rgh; nut nut; nCorr 2; alphaD 1; alphaDt 1.42857; write true; resetOnStartUp false; } Did anybody have some experience on the simulation using these two coefficients? Or could anyone point out the errors in my defination of scalarTransport function? Thanks in advance! |
|
October 17, 2022, 01:28 |
|
#2 |
New Member
Thomas Shi
Join Date: Jan 2018
Posts: 20
Rep Power: 8 |
Nobody is interested in this issue?
|
|
October 18, 2022, 11:21 |
|
#3 |
Senior Member
|
Hi Thomas,
Not 100% sure, but it might be related to: Code:
if (nutName_ != "none") { const volScalarField& nutMean = mesh_.lookupObject<volScalarField>(nutName_); return tmp<volScalarField>::New(Dname, nutMean); } Code:
nut nut; Can you check if you see an effect if you comment that line in your setup? Good luck, Tom |
|
October 19, 2022, 01:30 |
|
#4 |
New Member
Thomas Shi
Join Date: Jan 2018
Posts: 20
Rep Power: 8 |
Thanks for your reply! I'm very grateful to you for your help!
|
|
Tags |
alphad, alphadt, diffusion coefficient, functionobjects, scalartransport |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Passive Scalar Function Object - Setting of alphaD and alphaDt | foamF | OpenFOAM | 12 | October 13, 2022 05:45 |