CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Inject tracer within the simulation volume via fvOptions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 9, 2017, 09:31
Default Inject tracer within the simulation volume via fvOptions
  #1
Member
 
Sebastian Trunk
Join Date: Mar 2015
Location: Erlangen, Germany
Posts: 60
Rep Power: 11
sisetrun is on a distinguished road
Hello everybody,

I am struggeling with fvOptions in OF2.3.x . I want to use a cellZone as a source of tracer T and solve the equations with scalarTransportFoam on a steady simpleFoam velocity field. I have tube and an obstacle, so I do not want to inject the tracer at the beginning of the tube but right before the obstacle. I want to use the source more or less as a internal "inlet-patch" for the tracer. Values should be 1 in the source and after a while in the whole domain after the source (just like with the fixedValue inlet BC for scalarTransportFoam).

I made the cellZone, set up the fvOptions file like this:

Code:
tracer
{
   type scalarSemiImplicitSource ;
   active on;
   timeStart 0;
   duration 10000;
   selectionMode cellZone;
   cellZone Tracer;

   scalarSemiImplicitSourceCoeffs
   {
      volumeMode absolute; //implicit
      injectionRateSuSp
      {
         T (1 0);
      }
   }
}
I end up with very high values of T around 5.4e4.

Is the source of 1 mole / itteration added to the domain every time step?

Can I set a fixedValue BC for fvOption like in inletBC?


Every help is thankfully appreciated. Thank you

Best regards,

Sebastian

Last edited by sisetrun; February 10, 2017 at 02:06.
sisetrun is offline   Reply With Quote

Old   February 10, 2017, 03:27
Default
  #2
Member
 
Sebastian Trunk
Join Date: Mar 2015
Location: Erlangen, Germany
Posts: 60
Rep Power: 11
sisetrun is on a distinguished road
FYI:

I managed the problem in a different way...

Copied the scalarTransportFoam and added the following:

Code:
    // Reading from the tracerInletDict from constant folder
    Info<< "\n*** Detecting injection Plane from tracerInletDict in control directory***\n" << endl;
    Info<< "Z position is " << z_position << endl;
    Info<< "Deviation is " << deviation << endl;

    // List to store the indices of the matching mesh.C()
    DynamicList<label> tracer_location(0);
    
    // Extract all Cells which are in the proper range
    forAll(mesh.C(), idx)
    {
      if (mesh.C()[idx].component(2) >= (z_position.value() - deviation.value()))
          if (mesh.C()[idx].component(2) <= (z_position.value() + deviation.value()))
          {
               tracer_location.append(idx);
          }
    }

    // solver loop
    while (simple.loop())
    {
        Info<< "Time = " << runTime.timeName() << nl << endl;
    
        while (simple.correctNonOrthogonal())
        { 
          // set the T value of proper cells to 1
          forAll(tracer_location,tracer_idx)
             {
                 T[tracer_location(tracer_idx)] = 1;
             }
            
            solve
            (
                fvm::ddt(T)
              + fvm::div(phi, T)
              - fvm::laplacian(DT, T)
             ==
                fvOptions(T)
            );
sisetrun is offline   Reply With Quote

Old   February 16, 2017, 03:42
Default
  #3
Member
 
Sebastian Trunk
Join Date: Mar 2015
Location: Erlangen, Germany
Posts: 60
Rep Power: 11
sisetrun is on a distinguished road
I have to open the question again...

My proposed solution worked fine on one core.
When I run the simulation on a HPC, I can not use my approach.

Does anybody have an idea how to run the code in parallel? Or an idea of a different solution?

Thanks a lot,

Best regards
sisetrun is offline   Reply With Quote

Old   August 16, 2021, 05:20
Default Injecting a tracer from a patch inside a geometry
  #4
New Member
 
Luckmore Kadzungura
Join Date: Jul 2021
Posts: 12
Rep Power: 4
Lucky is on a distinguished road
Hallo Foamers, i am new to OpenFoam, i am trying to calculate the RTD over a small section of porous media. This means that i have ti inject my tracer at some plane inside the geometry, to do this, i created an inside patch using topoSet and createBaffles, when i then impose the tracer inlet boundary condition on that boundary condition, my scalarTransportFoam simulation diverges within the first two timesteps. i read one thread mentioning the use of fvOptions, i have never used that before, i need help. While i am still at that. I am using OF9 and it got rid of fvOptions and introduced fvModels and fvConstraints instead. i need help on how i can set up my ksimulation to be able to inject this pulse tracer at an inside zone or patch


Best regards


Lucky
Lucky is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[blockMesh] edges not aligned with or perpendicular to non-empty directions ynos OpenFOAM Meshing & Mesh Conversion 6 March 26, 2020 15:02
Simulation crashed shortly after it started ce73stargazer OpenFOAM Running, Solving & CFD 0 September 2, 2016 00:16
Air flow simulation in volume with fan and opening koziymf FLUENT 0 November 14, 2011 17:44
Tracer gas simulation with CFX4.3 CFX 4.3 users CFX 3 August 15, 2003 05:38
tidal flow simulation using finite volume method Jason Qiu Main CFD Forum 0 October 20, 2002 02:34


All times are GMT -4. The time now is 14:57.