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

writing of several variables within updateCoeffs()

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 25, 2016, 10:44
Default writing of several variables within updateCoeffs()
  #1
Member
 
Fynn
Join Date: Feb 2016
Posts: 48
Rep Power: 10
PanPeter is on a distinguished road
Hi,
I have the following problem: for an internal boundary the following class returns the velocity at every boundary face. That works fine. But I also want to write an interim value at every boundary face.
In the code snippet below it is the quantity 'jout' that I also want to have printed (which is calculated at every boundary face).
What I tried was to define another volScalarField registry object jout, with NO_READ and AUTO_WRITE options. But this will not compile, if I refer 'mesh' instead of some function in createFields.H.

So any ideas how to extract my jout directly in updateCoeffs?
Cheers!

Code:
void Foam::explicitFOmembraneVelocityFvPatchVectorField::updateCoeffs()
{
    if(updated())
    {
        return;
    }

    {
        // get the surface normals
        tmp<vectorField> tvfnf = patch().nf();
        const vectorField& vfnf = tvfnf();

            // get the pressure field
            const fvPatchField<scalar>& ppsf = patch().lookupPatchField<volScalarField, scalar>(pName_);

            scalar rho = rho0_.value();
            forAll(ppsf, facei)
            {
                // set the velocity
                operator[](facei) = vfnf[facei] * (A_*(ppsf[facei]-ppsf[fm_[facei]])) / rho;
                jout = rho*ppsf[facei];
            }
            
}
PanPeter is offline   Reply With Quote

Reply

Tags
objectregistry, read/write, updatecoeffs()


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
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Community Contributions 58 December 23, 2021 03:36
TimeVaryingMappedFixedValue irishdave OpenFOAM Running, Solving & CFD 32 June 16, 2021 07:55
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 06:38
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 19:57
[snappyHexMesh] crash sHM H25E OpenFOAM Meshing & Mesh Conversion 11 November 10, 2014 12:27


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