|
[Sponsors] |
source term that stays constant over outerCorrectors of pimple loop |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 18, 2022, 23:45 |
source term that stays constant over outerCorrectors of pimple loop
|
#1 |
Member
Jnana Bhaskar Rao
Join Date: Mar 2020
Posts: 46
Rep Power: 6 |
Dear all,
My transient compressible flow calculation requires addition of random disturbances to the boundary layers of a nozzle at a particular location. The way I tried to do it is 1) create a cellSet of the boundary cells at the location. 2) Add random momentum source terms (disturbances) of the necessary magnitude using fvOptions active only at the aforementioned cellSet. The issue: For reasons I can't elaborate here, I need to use a pimple solver with 5 outerCorrector loops. I would like to keep my source term constant over all the 5 correctors. Unfortunately, when I tried to do so, I realized that fvOptions is called each time the U.Eqn is solved and it modifies the disturbances at each outer corrector step. My code for fvOptions is shared below Code:
codedSource { type vectorCodedSource; selectionMode cellSet; cellSet boundaryLayerForce; fields (U); name disturbance; codeInclude #{ #include "Random.H" # include "clock.H" #}; codeCorrect #{ #}; codeAddSup #{ const Time& time = mesh().time(); Random rng(time.value());//Random rng(clock::getTime() + pid()); vectorField& USource = eqn.source(); // Start time const scalar startTime = -1.0; if (time.value() > startTime) { const labelList& cellIDs = cells(); // Apply the source forAll(cellIDs, i) { label cellI = cellIDs[i]; vector epsilon (1, 1, 1); epsilon.x() = -1.0 + 2.0*(rng.scalar01()); epsilon.y() = -1.0 + 2.0*(rng.scalar01()); epsilon.z() = 2.0*(-1.0 + 2.0*(rng.scalar01())); USource[cellI].x() =1e-4*508*epsilon.x(); USource[cellI].y() =1e-4*508*epsilon.y(); USource[cellI].z() = 1e-4*508*epsilon.z(); }; } #}; codeSetValue #{ #}; } { The constant updating of the disturbances within a time step is not what I want and it leads to immediate blow up of the calculation. My questions: Is it possible to use fvOptions to add source terms that stay constant at a time step over all the outer correctors? It seems possible as fvOptions can access the time value. Do I have to modify my solver in order to add disturbances and solve with a pimple loop? Last edited by jnanabrao; February 20, 2022 at 03:33. Reason: I realized I didn't need to multiply the source term with rho. The main question is still open |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[openSmoke] LaminarSMOKE compilation error | mdhfiz | OpenFOAM Community Contributions | 7 | October 4, 2022 13:57 |
[swak4Foam] swak4foam for OpenFOAM 4.0 | mnikku | OpenFOAM Community Contributions | 80 | May 17, 2022 08:06 |
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 | ordinary | OpenFOAM Installation | 19 | September 3, 2019 18:13 |
Trouble compiling utilities using source-built OpenFOAM | Artur | OpenFOAM Programming & Development | 14 | October 29, 2013 10:59 |
centOS 5.6 : paraFoam not working | yossi | OpenFOAM Installation | 2 | October 9, 2013 01:41 |