|
[Sponsors] |
March 29, 2022, 12:53 |
codedSource and semiImplicitSource Mix?
|
#1 |
New Member
Lukas Kutej
Join Date: Jan 2016
Location: Darmstadt
Posts: 20
Rep Power: 10 |
Hello guys...I would like to have Su Sp source applied on a part of field under if condition.
- semiImplicitSorce: here I can define Su and Sp source sadly only for whole field Code:
sourceTerm { type scalarSemiImplicitSource; enabled true; scalarSemiImplicitSourceCoeffs { selectionMode all; volumeMode absolute; injectionRateSuSp { k (1e30 1e30); } } } - codedSource: here I can do a "if" loop over the partial domain, but I don't know how to define Su and Sp Code:
sourceTerm { type scalarCodedSource; name sourceTerm; scalarCodedSourceCoeffs { selectionMode all; volumeMode absolute; fields (k); codeInclude #{ #}; codeCorrect #{ #}; codeAddSup #{ // Cell center coordinates const volVectorField& C = mesh_.C(); const volScalarField& ySwitch = mesh_.thisDb().lookupObject<volScalarField>("ySwitch"); scalarField& kSource = eqn.source(); // Apply the source forAll (C, i) { if (ySwitch[i] > 0.9999) { // cell volume specific source kSource[i] += 1e30; } }; #}; codeConstrain #{ #}; } } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Customized semiImplicitSource | Ricky-11 | OpenFOAM Programming & Development | 1 | November 25, 2016 12:04 |