|
[Sponsors] |
June 17, 2019, 07:28 |
Modifying buoyantBoussinesqPimpleFoam
|
#1 |
Member
Join Date: Apr 2019
Location: India
Posts: 81
Rep Power: 7 |
Hello Everyone,
Please forgive me if my question is too simple. I am very new to openFoam. I want to modify the buoyantBoussinesqPimpleFoam solver, such that it takes into account rho0, mu, cp, k, given by me to calculate nu and Pr. Now, I do not understand how it calculates Pr, when cp and k is missing. I want to explicitly declare mu, rho0 and other thermo-physical properties in order to add governing equations of another physics, which I want to add with this solver. Thank You. With Thanks, Pavithra. Last edited by Pavithra; July 5, 2019 at 04:48. |
|
June 24, 2019, 17:13 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quick question: Why don't you use the solver buoyantPimpleFoam, which has full thermophysical properties and does account for buoyancy!
As for the solver you asked about, the the Pr and other properties are defined in the "transportProperties" file, e.g.: https://github.com/OpenFOAM/OpenFOAM...portProperties
__________________
|
|
June 26, 2019, 04:14 |
|
#3 | |
Member
Join Date: Apr 2019
Location: India
Posts: 81
Rep Power: 7 |
Quote:
Thank you so much for your reply. Sir, I want to use buoyantBoussinessqPimpleFoam, because, I want Boussinessq approximation in my momentum equation to account for the gravitational body force term. Yes Sir, the physical properties are specified in the file transportProperties. But, the properties are specified in terms of nu and Pr. But I individually want to specify density, dynamic viscosity, specific heat and thermal conductivity. Kindly, please help me in this regard. Thank You. With Thanks, Pavithra. |
||
June 26, 2019, 14:37 |
|
#4 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
I think all the functionality you want are already implemented in the existing thermophysical model in OF.
See https://cfd.direct/openfoam/user-gui...hermophysical/ |
|
June 28, 2019, 01:11 |
|
#5 | |
Member
Join Date: Apr 2019
Location: India
Posts: 81
Rep Power: 7 |
Quote:
Thank you so much for your kind reply. I am new to OpenFoam. I did not know that, I can have Boussinesq approximation in buoyantPimpleFoam. I was thinking that, in order to have Boussinesq approximation, I have to depend only on buoyantBoussinesqPimpleFoam. Now, I have understood how I can use Boussinesq with buoyantPimpleFoam. BTW, I am trying to couple equations for electric potential and charge conservation with the N-S equations. I know that there are some solvers already available for this. But, I am just trying to do this on my own, so that, I can have a chance to explore and learn openFoam. Thank you once again. With Thanks, Pavithra. Last edited by Pavithra; June 28, 2019 at 01:15. Reason: adjust alignment |
||
June 30, 2019, 07:18 |
|
#6 | |
Member
Join Date: Apr 2019
Location: India
Posts: 81
Rep Power: 7 |
Quote:
Sir, As you suggested, I tried to use buoyuantPimpleFoam. I could specify the thermophysical properties as required. But, I face a new problem here. I get an dimension mismatch when I add the Electric equations. The dimension mismatch is due to the difference in dimensions of the velocity flux (phi) in compressible and incompressible solvers. Could you please give me a direction to overcome this problem? Thank You. With Thanks, Pavithra. |
||
June 30, 2019, 14:26 |
|
#7 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
Can you post the equations you try to solve
|
|
July 1, 2019, 13:29 |
|
#8 |
Member
Join Date: Apr 2019
Location: India
Posts: 81
Rep Power: 7 |
Thank u so much sir. I am trying to solve
I am trying to solve equations of EHD as given in https://www.sciencedirect.com/scienc...04388615000030 I know there are existing solvers for EHD problems. But, 1) I want to learn myself 2) I want to extend to gas discharge and phase-change problems. Hence, I want to use an incompressible solver. Thank You so much for ur kind help. |
|
July 1, 2019, 14:48 |
|
#9 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
Unfortunately I do not have access to the paper
|
|
July 2, 2019, 01:11 |
|
#10 |
Member
Join Date: Apr 2019
Location: India
Posts: 81
Rep Power: 7 |
Respected Sir, First of all, thank u so much for trying to help me. As a first step, I want to add the Coulomb force term to the momentum equation. I am beginning with the buoyantBoussinessqPimpleFoam. I want to add the term F = qE as body force to the momentum equation. where, q is the charge density which is a volume scalar field of dimension [0 -3 1 0 0 1 0]. and E is the electric field which is a volume vector field of dimension [1 1 -3 0 0 -1 0]. I have calculated q and E by solving the Poisson equation for electric potential and charge conservation equation. Then I define Code:
volVectorField F = q * E and add this to UEqn.H as follows: Code:
fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) + MRF.DDt(U) + turbulence->divDevReff(U) == fvOptions(U) + F ); I am stuck at this point. Kindly, please give me some direction to move forward. Thank You. With Thanks, Pavithra. |
|
July 2, 2019, 03:49 |
|
#11 |
Member
Join Date: Apr 2019
Location: India
Posts: 81
Rep Power: 7 |
Respected Sir,
I just figured out that, I can make the dimension of the body force term consistent with other terms in the equation by dividing by density. Sorry, for the previous silly question. Now I have defined F = (q*E)/den; where, den = 1 kgm-3 By following this approach the solver gets compiled successfully. I have started a simulation for a benchmark case, Will let u know if I am able to validate. Please, give your comments on my approach. If it is right or should I make any changes. Thank You. With Thanks, Pavithra. Last edited by Pavithra; July 2, 2019 at 04:50. |
|
July 2, 2019, 05:59 |
|
#12 | |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hey everybody,
I just want to make a clear statement which is not correct by the Thread-Starter. Quote:
To your qustion about adding Maxwell stuff. Start with a simpler solver which has no gravity included. This makes things easier to understand for your and limits mistakes you make. After the implementation into, e.g., pimpleFoam works, you can re-implement it to the buoyancy solver. This is just a hint. Surely, you can direct implement it into your solver. Good luck.
__________________
Keep foaming, Tobias Holzmann |
||
July 2, 2019, 06:19 |
|
#13 | |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
Quote:
The approach is correct. You have to divide your force by the density since in the solver you want to use the equations are divided by the density |
||
July 2, 2019, 22:25 |
|
#14 | |
Member
Join Date: Apr 2019
Location: India
Posts: 81
Rep Power: 7 |
Quote:
Thank you so much for pointing out. Now, I understand it clearly. Yes Sir, as you have suggested I will start with simple solvers, then move to solvers with complex physics. Thank You. |
||
July 2, 2019, 22:27 |
|
#15 | |
Member
Join Date: Apr 2019
Location: India
Posts: 81
Rep Power: 7 |
Quote:
Thank you so much sir. Your inputs gave me a good direction. I am able to validate with the paper which I have posted in the previous comments. Thank you once again. |
||
July 4, 2019, 23:13 |
|
#16 |
Member
Join Date: Apr 2019
Location: India
Posts: 81
Rep Power: 7 |
Respected Sir,
Based on your directions and inputs, I was able to solve the charge transport equation coupled with buoyantBoussinessqPimpleFoam. I was also able to validate my results. As a next step, I am trying to solve a scalar transport equation coupled with buoyantPimpleFoam, which is a compressible solver. Code:
fvScalarMatrix rhoEEqn ( fvm::ddt(rhoE) + fvm::div(phi, rhoE) - fvm::laplacian(a, rhoE) ); rhoEEqn.solve(); I get the following dimension mismatch error. Code:
--> FOAM FATAL ERROR: incompatible dimensions for operation [rhoE[0 -3 0 0 0 1 0] ] + [rhoE[1 -6 0 0 0 1 0] ] From function void Foam::checkMethod(const Foam::fvMatrix<Type>&, const Foam::fvMatrix<Type>&, const char*) [with Type = double] in file /home/user/OpenFOAM/OpenFOAM-6/src/finiteVolume/lnInclude/fvMatrix.C at line 1283. The error pops up when the divergence term is included. I was able to successfully add this scalar equation to buoyantBoussinesqPimpleFoam (incompressible solver). Unfortunately, I could not find much tutorials on adding a scalar transport equation to a compressible solver. Kindly, please give me a direction in solving this. Thank You. With Thanks, Pavithra. |
|
July 5, 2019, 02:31 |
|
#17 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
In the compressible solvers the equations are not divided by the density where in the incompressible they are. Probably your error comes from this. Phi in the compressible equations has an other dimension compared to the incompressible
|
|
July 5, 2019, 04:47 |
|
#18 | |
Member
Join Date: Apr 2019
Location: India
Posts: 81
Rep Power: 7 |
Quote:
Respected Sir, Thank you so much for your kind help. I followed your suggestion and advice of Dr. Tobias Holzmann (from my another thread) and defined the scalar transport equation as below Code:
fvScalarMatrix rhoEEqn ( fvm::ddt(rho, rhoE) //Time derivative + fvm::div(phi, rhoE) //Convective term - fvm::laplacian(a*rho, rhoE) //Diffusive Term ); rhoEEqn.solve(); Thank You. With Thanks, Pavithra. |
||
July 6, 2019, 06:10 |
|
#19 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
I'm not sure the equation above makes much sense.
Since rhoE (at least in rhoCentralFaonm) has already the dimension of an energy [kg/m^3 * m/s^2]. I have never seen an density weighted energy equation. That is what your solving: the evolution of the density weighted energy equation. Is this what you want to do? |
|
July 8, 2019, 05:39 |
|
#20 | |
Member
Join Date: Apr 2019
Location: India
Posts: 81
Rep Power: 7 |
Quote:
Respected Sir, Thank you so much for your reply. I am solving the electrical charge conservation equation. Here, rhoE is the charge density which is a scalar of dimension [0 -3 1 0 0 1 0]. Thank You. With Thanks, Pavithra. |
||
Tags |
buoyantboussinesqpimple, modify solver, openfoam v6 |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Modifying the laplacian operator | mlawson | OpenFOAM Running, Solving & CFD | 22 | July 16, 2018 05:56 |
Error while modifyinG reactingFoam!! | sonGoku | OpenFOAM Pre-Processing | 0 | May 27, 2018 14:57 |
Modifying the convection term in IcoFOAM code | fluidflowsteel | OpenFOAM Programming & Development | 0 | November 28, 2017 06:51 |
Modifying sonicFoam to add EM terms | Alexee | OpenFOAM Programming & Development | 0 | February 11, 2015 11:55 |
modifying radial distribution function | ravindra | FLUENT | 2 | September 2, 2014 15:03 |