Skip to content

Addition of scalar point source and its inclusion into a new solver - #660

Open
uttamcadambi07 wants to merge 13 commits into
mdolab:mainfrom
uttamcadambi07:main
Open

Addition of scalar point source and its inclusion into a new solver#660
uttamcadambi07 wants to merge 13 commits into
mdolab:mainfrom
uttamcadambi07:main

Conversation

@uttamcadambi07

@uttamcadambi07 uttamcadambi07 commented Jul 3, 2024

Copy link
Copy Markdown

Purpose

This PR adds the passive scalar point source as a FvSource class and includes it into a solver , DAMySimpleTFoam.

Type of change

What types of change is it?

  • New feature (non-breaking change which adds functionality)

Testing

Explain the steps needed to test the new code to verify that it does indeed address the issue and produce the expected behavior.

Checklist

  • I have run unit and regression tests which pass locally with my changes
  • I have added new tests that prove my fix is effective or that my feature works
  • [x ] I have added necessary documentation

Error

Seems like the overloaded function is not working. The calcFvSource function is overloaded with volScalarField and volVectorField as outputs in DAFvSource base class. One would expect that this overloading allows flexibility (as can be seen in DAFvSourceHeatSource where calcFvSource returns a volScalarField. However, on testing, this error is reported

[0] 
[0] 
[0] --> FOAM FATAL ERROR: 
[0] calcFvSource not implemented 
 in the child class for 
[0] 
[0]     From function 
[0]     in file DAFvSource/DAFvSource.C at line 98.

@uttamcadambi07
uttamcadambi07 requested a review from a team as a code owner July 3, 2024 10:20
@friedenhe

Copy link
Copy Markdown
Collaborator

The new DAFvSourceScalar class looks good. The error you saw was caused by not adding DAFvSourceScalar.C in src/adjoint/Make/files_Incompressible. Also, please modify the existing DASImpleTFoam class, instead of creating a new solver DAMySimpleTFoam.

@uttamcadambi07

uttamcadambi07 commented Jul 4, 2024

Copy link
Copy Markdown
Author

Hi,

thanks for the feedback. I forgot to mention - I have added DAFvSourceScalar.C in src/adjoint/Make/files_Incompressible and still face this error.

I should also mention that the min and max is not being recognized.

[3] 
[3] 
[3] 
[3] --> FOAM FATAL IO ERROR: 
[3] Entry 'min' not found in dictionary ""Entry 'max' not found in dictionary ""
[3] 
[3] file: 
[3] 
[3]     From function bool Foam::dictionary::readEntry(const Foam::word&, T&, Foam::keyType::option, bool) const [with T = Foam::Vector<codi::ActiveType<codi::JacobianLinearTape<codi::JacobianTapeTypes<double, double, codi::LinearIndexManager<int>, codi::DefaultChunkedData, codi::LocalAdjoints> > > >]

@uttamcadambi07

Copy link
Copy Markdown
Author

Added a test case and also modified existing residual class to include source term.

@friedenhe

friedenhe commented Jul 17, 2024

Copy link
Copy Markdown
Collaborator

@uttamcadambi07 Can you (1) delete all the DAMySimpleTFoam related files, (2) delete the test case from the repo and upload to here (we do not put test files in the repo, it will make the repo too large), (3) Many of the regression test failed, please check and make sure you pass all the tests.

@uttamcadambi07

Copy link
Copy Markdown
Author

Hi,
Thank you for your feedback.
(1) Done.
(2) Done. test_case_passive_scalar.zip
(3) Done. I added a new Turbulence model (SA without fv3). Made all necessary changes in Make/files, models/ and in DATurbulenceModel classes.

@friedenhe
friedenhe requested review from friedenhe and removed request for bernardopacini November 20, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants