Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

uttamcadambi07
Copy link

@uttamcadambi07 uttamcadambi07 commented Jul 3, 2024

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
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
Copy link
Author

uttamcadambi07 commented Jul 4, 2024

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
Author

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

@friedenhe
Copy link
Collaborator

friedenhe commented Jul 17, 2024

@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
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.

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