|
[Sponsors] |
Momentum source containing div(tensor) using fvOptions |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 2, 2022, 08:46 |
Momentum source containing div(tensor) using fvOptions
|
#1 |
New Member
Sreehari Perumanath
Join Date: Jun 2022
Posts: 28
Rep Power: 4 |
Hi Foamers,
I'm fairly new to OpenFOAM and I'm using v6. In my momentum equations, I have a source term that contains a divergence of a random symmetric stress tensor. Is it possible to define this term using fvOptions? If yes, please let me know how. Many thanks in advance! sreehahaha |
|
August 2, 2022, 10:50 |
|
#2 |
Senior Member
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15 |
How is that tensor defined? If it is already defined in your solver you could add the term directly there.
Otherwise you could try with a codeStream fvOption |
|
August 2, 2022, 11:25 |
|
#3 |
New Member
Sreehari Perumanath
Join Date: Jun 2022
Posts: 28
Rep Power: 4 |
Thanks for the reply agustinvo.
I already tried adding this term directly into the UEqn definition within a new solver (myIcoFoam). However, it looks like it has some issues. That is why I thought to use fvOptions instead. But, I'm confused how to define div(tensor) in fvOptions. If possible, could you please elaborate your suggestion on using codeStream? Many thanks! |
|
August 3, 2022, 19:21 |
|
#4 |
Senior Member
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15 |
What are these issues? Can you show your equations?
I am not an expert in codeStream, however I think it could be easy to add it in your solver if the tensor is already created there. |
|
August 4, 2022, 07:37 |
|
#5 |
New Member
Sreehari Perumanath
Join Date: Jun 2022
Posts: 28
Rep Power: 4 |
Hi agustinvo,
Sorry for the slight delay in replying. So my UEqn goes like: Code:
fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) - fvm::laplacian(nu, U) == fvc::div(stochTau)/rho ); Code:
forAll(stochTau,i) { Tcell=T.internalField()[i]; // local temperature rhocell=rho.internalField()[i]; local density visc=nu.value()*rhocell; // viscosity=kinematic_viscosity*density dv=mesh.V()[i]; //cell volume dt=runTime.deltaTValue(); dummy=vector(rnumxx.scalarNormal(),rnumyy.scalarNormal(),rnumzz.scalarNormal()); //random vector; uncorrleated elements diag=dummy&chol; //correlated elements with sum=0. [chol is predefined and this step is correct] stochTau[i]=Foam::sqrt(2*visc*kb*Tcell/dv/dt)*symmTensor(diag.x(),rnumxy.scalarNormal(),rnumxz.scalarNormal(),diag.y(),rnumyz.scalarNormal(),diag.z()); } Last edited by sreehahaha; August 4, 2022 at 09:04. |
|
August 4, 2022, 10:20 |
|
#6 |
Senior Member
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15 |
I would need to see the reference model to check what can be missing. Do you have a test case? Which OpenFOAM version are you using?
|
|
Tags |
divergence, fvoptions momentum source, stress tensor |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Tabulated thermophysicalProperties library | chriss85 | OpenFOAM Community Contributions | 62 | October 2, 2022 04:50 |
[snappyHexMesh] Invalid Normals for source face to target face while making AMI? | Sorabh | OpenFOAM Meshing & Mesh Conversion | 1 | August 3, 2021 07:35 |
[swak4Foam] funkyDoCalc with OF2.3 massflow | NiFl | OpenFOAM Community Contributions | 14 | November 25, 2020 04:30 |
polynomial BC | srv537 | OpenFOAM Pre-Processing | 4 | December 3, 2016 10:07 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 14:59 |