CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Solving transport equations with known velocity field (https://www.cfd-online.com/Forums/openfoam-solving/105664-solving-transport-equations-known-velocity-field.html)

 Mojtaba.a August 6, 2012 05:20

Solving transport equations with known velocity field

Hi.
1) I want to solve 2 transport equations with known velocity field. First i want to solve coupled equations of momentum, energy and mass conservation to compute velocity field and pressure and also temperature. after solving these equations and by known velocity field i want to solve 2 other transport equations. How can i do that in openFoam?

2)
my second question is that is there anyway to include heat transfer coefficient in openfoam? or it will be computed automatically? if yes, then how can I find it?

3) I am modeling a room with heat sources which both natural convection and forced convection are significant. my case is incompressible. which solver do u suggest to use and how can i see the effects of forced convection?

Regards
Mojtaba ~

 chegdan August 6, 2012 05:49

Quote:
 Originally Posted by Mojtaba.a (Post 375549) Hi. 1) I want to solve 2 transport equations with known velocity field. First i want to solve coupled equations of momentum, energy and mass conservation to compute velocity field and pressure and also temperature. after solving these equations and by known velocity field i want to solve 2 other transport equations. How can i do that in openFoam? 2) my second question is that is there anyway to include heat transfer coefficient in openfoam? or it will be computed automatically? if yes, then how can I find it? 3) I am modeling a room with heat sources which both natural convection and forced convection are significant. my case is incompressible. which solver do u suggest to use and how can i see the effects of forced convection? Regards Mojtaba ~
1. Yes, have a look at (http://openfoamwiki.net/index.php/ScalarTransportFoam).

2. Not sure

3. buoyantBoussinesqSimplFoam?

Give the forum a good search for passive scalar transport, natural convection, buoyancy,.... This will answer all of your questions. Hopefully this will get you started.

 Mojtaba.a August 6, 2012 06:08

Quote:
 Originally Posted by chegdan (Post 375555) 1. Yes, have a look at (http://openfoamwiki.net/index.php/ScalarTransportFoam). 2. Not sure 3. buoyantBoussinesqSimplFoam? Give the forum a good search for passive scalar transport, natural convection, buoyancy,.... This will answer all of your questions. Hopefully this will get you started.
1) well i have already seen that tutorials. i want to know how can i solve transport equation after finishing solving for U,p and T. is it possible?

regards

 chegdan August 6, 2012 06:27

Yes, its possible. You will need to add your volScalarField for your scalar, formulate the implicit equation and then solve it as usual. If it is strongly coupled with the momentum equation (active) you can solve it inside the PISO/SIMPLE loop and if its a passive scalar (one-way coupled) you can solve it at the end of the time-step.

 Mojtaba.a August 6, 2012 06:42

Quote:
 Originally Posted by chegdan (Post 375566) Yes, its possible. You will need to add your volScalarField for your scalar, formulate the implicit equation and then solve it as usual. If it is strongly coupled with the momentum equation (active) you can solve it inside the PISO/SIMPLE loop and if its a passive scalar (one-way coupled) you can solve it at the end of the time-step.
Here is the source code for buoyantBoussinesqSimpleFoam:

Quote:
 while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; p_rgh.storePrevIter(); // Pressure-velocity SIMPLE corrector { #include "UEqn.H" #include "TEqn.H" #include "pEqn.H" } turbulence->correct(); runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; }
By "end of the time step" you mean where?

 chegdan August 6, 2012 07:24

Quote:
 Originally Posted by Mojtaba.a (Post 375569) By "end of the time step" you mean where?
Code:

```while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; p_rgh.storePrevIter(); // Pressure-velocity SIMPLE corrector { #include "UEqn.H" #include "TEqn.H" //<--here for active scalar #include "pEqn.H" } turbulence->correct(); //<-- here for passive scalar that depends on turbulence runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; }```
You could try it in several places, compare execution time and solution and see which one is best. Good luck

 Mojtaba.a August 6, 2012 07:43

Quote:
 Originally Posted by chegdan (Post 375578) Code: ```while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; p_rgh.storePrevIter(); // Pressure-velocity SIMPLE corrector { #include "UEqn.H" #include "TEqn.H" //<--here for active scalar #include "pEqn.H" } turbulence->correct(); //<-- here for passive scalar that depends on turbulence runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; }``` You could try it in several places, compare execution time and solution and see which one is best. Good luck
I understand it now,
Thanks chegdan ~

 All times are GMT -4. The time now is 09:17.